From 18339d46597d0c6d5a949f55f8a2c3235d61bb32 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 15 Nov 2014 21:18:15 -0500 Subject: Rework command for opening default Org notes file Almost every time I used `km/open-main-orgfile', I would jump to the "Inbox" heading right after, so just have the command do that for me. --- lisp/init-org.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lisp') diff --git a/lisp/init-org.el b/lisp/init-org.el index 66dc1e7..555d80e 100644 --- a/lisp/init-org.el +++ b/lisp/init-org.el @@ -45,10 +45,6 @@ (defadvice org-open-file (after km/org-open-add-to-recentf activate) (recentf-add-file path)) -(defun km/open-main-orgfile () - (interactive) - (find-file org-default-notes-file)) - (defun km/org-open-file-at-point () "Open file at point with `org-open-file'." (interactive) @@ -105,7 +101,6 @@ The hook functions and `org-store-link' are called within a (define-key km/global-org-map "a" 'org-agenda) (define-key km/global-org-map "b" 'org-iswitchb) (define-key km/global-org-map "s" 'org-save-all-org-buffers) -(define-key km/global-org-map "m" 'km/open-main-orgfile) (define-key km/global-org-map "p" 'poporg-dwim) (key-chord-define-global ",a" 'org-agenda) @@ -328,6 +323,16 @@ displayed in the agenda." (define-key km/global-org-map "n" 'km/org-agenda-add-or-remove-file) +(defun km/org-open-default-notes-file-inbox () + "Open \"Inbox\" heading of `org-default-notes-file'." + (interactive) + (find-file org-default-notes-file) + (goto-char (org-find-exact-headline-in-buffer "Inbox" nil t)) + (recenter-top-bottom 0) + (show-children)) + +(define-key km/global-org-map "m" 'km/org-open-default-notes-file-inbox) + (setq org-agenda-custom-commands '(("d" todo "DONE" nil) ("u" "Unschedule TODO entries" alltodo "" -- cgit v1.2.3