diff options
Diffstat (limited to '')
-rw-r--r-- | emacs.d/custom/fcuny-defuns.el | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/emacs.d/custom/fcuny-defuns.el b/emacs.d/custom/fcuny-defuns.el index 88e73a3..cb117f4 100644 --- a/emacs.d/custom/fcuny-defuns.el +++ b/emacs.d/custom/fcuny-defuns.el @@ -299,4 +299,31 @@ For instance, given the string: What's all this then? (interactive) (fcuny/org-refile-subtree-to-file org-default-technical-dir)) +(defun fcuny/org-journal-date-format-func (time) + "Custom function to insert journal date header. + + When buffer is empty prepend a header in front the entry header." + (concat (when (= (buffer-size) 0) + (concat + (pcase org-journal-file-type + (`daily "#+TITLE: Daily Journal") + (`weekly "#+TITLE: Weekly Journal") + (`monthly "#+TITLE: Monthly Journal") + (`yearly "#+TITLE: Yearly Journal")))) + org-journal-date-prefix + (format-time-string "%x (%A)" time))) + +(defun fcuny/uniquify-region-lines (beg end) + "Remove duplicate adjacent lines in region." + (interactive "*r") + (save-excursion + (goto-char beg) + (while (re-search-forward "^\\(.*\n\\)\\1+" end t) + (replace-match "\\1")))) + +(defun fcuny/gocs () + (interactive) + (let ((text (read-string "Search for: " (thing-at-point 'word)))) + (browse-url (format "http://go/cs/%s" text)))) + (provide 'fcuny-defuns) |