diff options
author | Bastien Guerry <bzg@altern.org> | 2013-02-27 14:49:30 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-02-27 14:49:30 +0100 |
commit | c8c26c8e1968a4b341ae05046f33374ae5b08723 (patch) | |
tree | eb25d363b865c457497090ed9294a3ca50243d2d | |
parent | 5f47cb2b9f51c8c74f64c0e3f09873a4f10d3302 (diff) | |
download | org-mode-c8c26c8e1968a4b341ae05046f33374ae5b08723.tar.gz |
Enhance the fix implemented in 41882a99
* org.el (org-mode): Add `org-fix-ellipsis-at-bol' to
`isearch-mode-end-hook' so that any isearch fixes the problem with
ellipsis on the first line.
(org-fix-ellipsis-at-bol): New defsubst.
(org-show-context, org-isearch-end): Use it.
-rw-r--r-- | lisp/org.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/org.el b/lisp/org.el index 3e6678a..8dd7bf0 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4972,7 +4972,8 @@ The following commands are available: (org-add-hook 'isearch-mode-end-hook 'org-isearch-end 'append 'local) ;; Emacs 22 deals with this through a special variable (org-set-local 'outline-isearch-open-invisible-function - (lambda (&rest ignore) (org-show-context 'isearch)))) + (lambda (&rest ignore) (org-show-context 'isearch))) + (org-add-hook 'isearch-mode-end-hook 'org-fix-ellipsis-at-bol 'append 'local)) ;; Setup the pcomplete hooks (set (make-local-variable 'pcomplete-command-completion-function) @@ -5011,6 +5012,8 @@ The following commands are available: (put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify) +(defsubst org-fix-ellipsis-at-bol () + (save-excursion (goto-char (window-start)) (recenter 0))) (defun org-find-invisible-foreground () (let ((candidates (remove @@ -12864,7 +12867,7 @@ How much context is shown depends upon the variables (not (bobp))) (org-flag-heading nil) (when siblings-p (org-show-siblings))))) - (save-excursion (goto-char (window-start)) (recenter 0)))) + (org-fix-ellipsis-at-bol))) (defvar org-reveal-start-hook nil "Hook run before revealing a location.") @@ -22181,7 +22184,8 @@ Show the heading too, if it is currently invisible." isearch-mode-end-hook-quit) ;; Only when the isearch was not quitted. (org-add-hook 'post-command-hook 'org-isearch-post-command - 'append 'local))))) + 'append 'local))) + (org-fix-ellipsis-at-bol))) (defun org-isearch-post-command () "Remove self from hook, and show context." |