diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-02-18 01:46:04 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-02-18 01:46:04 -0500 |
commit | a8fc1f258874c02321c6eea74ae2b3ca0a6011d5 (patch) | |
tree | 72394b1f4e292fe02c308ba8d7679c4a17ac4c65 | |
parent | 69dea2f9a02903fbca387496f2798ee8e0462d45 (diff) | |
download | emacs.d-a8fc1f258874c02321c6eea74ae2b3ca0a6011d5.tar.gz |
Add org-open-at-point-stay as speed command
-rw-r--r-- | lisp/init-org.el | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/init-org.el b/lisp/init-org.el index bde6040..e5fad96 100644 --- a/lisp/init-org.el +++ b/lisp/init-org.el @@ -257,6 +257,17 @@ to (funcall 'pop-to-buffer buffer-or-name nil norecord))) (org-switchb arg))) +(defun km/org-open-at-point-stay () + "Like `org-open-at-point', but stay on heading. +This variant is convient to use in `org-speed-commands-user' +because remaining on the heading allows additional commands to be +called through the speed command interface." + (interactive) + (unless (org-at-heading-p) + (user-error "Not at heading")) + (save-excursion + (call-interactively #'org-open-at-point))) + (after 'org (define-key org-mode-map (kbd "C-c C-x B") 'km/org-tree-to-indirect-buffer-current-window) @@ -281,7 +292,9 @@ to ;; to C-,). (define-key org-mode-map (kbd "C-'") nil) - (define-key org-mode-map (kbd "C-c m") 'km/org-prefix-map)) + (define-key org-mode-map (kbd "C-c m") 'km/org-prefix-map) + + (add-to-list 'org-speed-commands-user '("o" . km/org-open-at-point-stay))) (define-prefix-command 'km/org-prefix-map) (define-key km/org-prefix-map "c" 'km/org-clone-and-shift-by-repeater) |