diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2017-11-25 09:18:30 +0100 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2017-11-25 09:18:30 +0100 |
commit | 282bbfad4b0ef3f5ec19688717316a20ae943493 (patch) | |
tree | e4a83a8d48f59ef88e27e2948dc8ad22fe6e0158 /helm-utils.el | |
parent | c8bfb714d85716761f90edbc94510c5466e1d2b0 (diff) |
Fix org-reveal no more working in outline buffers (#1919)
* helm-utils.el (helm-goto-char): Use org-reveal only in org buffers.
Diffstat (limited to 'helm-utils.el')
-rw-r--r-- | helm-utils.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/helm-utils.el b/helm-utils.el index ea99cb91..6e595d62 100644 --- a/helm-utils.el +++ b/helm-utils.el @@ -404,12 +404,13 @@ Default is `helm-current-buffer'." (defun helm-goto-char (loc) "Go to char, revealing if necessary." + (require 'org) ; On some old Emacs versions org may not be loaded. (goto-char loc) - (when (or (eq major-mode 'org-mode) - (and (boundp 'outline-minor-mode) - outline-minor-mode)) - (require 'org) ; On some old Emacs versions org may not be loaded. - (org-reveal))) + (let ((fn (cond ((eq major-mode 'org-mode) #'org-reveal) + ((and (boundp 'outline-minor-mode) + outline-minor-mode) + #'outline-show-subtree)))) + (and fn (funcall fn)))) (defun helm-goto-line (lineno &optional noanim) "Goto LINENO opening only outline headline if needed. |