summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-02-26 22:45:04 +0100
committerBastien Guerry <bzg@altern.org>2013-02-26 22:45:04 +0100
commit41882a99d3cf14e4c9ad45559bc3fc9e8b21b581 (patch)
tree69beb56a395e6ebf77f2246955e60e785f15234a
parent2b13d090d124fe6a7a389def71696c3b477bf8f6 (diff)
downloadorg-mode-41882a99d3cf14e4c9ad45559bc3fc9e8b21b581.tar.gz
Fix a longstanding issue with ellispsis on top of the window
* org.el (org-show-context): Remove useless catch. Make sure the top of the window is a visible headline. * org.el (org-activate-plain-links): Remove unused catch. * org-macs.el (org-get-alist-option): Return nil, not (nil), so that `org-show-context' DTRT. Thanks to Samuel Wales for his patience in reporting this.
-rw-r--r--lisp/org-macs.el2
-rw-r--r--lisp/org.el71
2 files changed, 36 insertions, 37 deletions
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index ceee306..470bcb3 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -263,7 +263,7 @@ in `org-rm-props'."
(cond ((eq key t) t)
((eq option t) t)
((assoc key option) (cdr (assoc key option)))
- (t (cdr (assq 'default option)))))
+ (t (delq nil (cdr (assq 'default option))))))
(defsubst org-check-external-command (cmd &optional use no-error)
"Check if external program CMD for USE exists, error if not.
diff --git a/lisp/org.el b/lisp/org.el
index d61295b..3e6678a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5303,21 +5303,20 @@ will be prompted for."
(defun org-activate-plain-links (limit)
"Run through the buffer and add overlays to links."
- (catch 'exit
- (let (f)
- (when (and (re-search-forward (concat org-plain-link-re) limit t)
- (not (org-in-src-block-p)))
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (setq f (get-text-property (match-beginning 0) 'face))
- (unless (or (org-in-src-block-p)
- (eq f 'org-tag)
- (and (listp f) (memq 'org-tag f)))
- (add-text-properties (match-beginning 0) (match-end 0)
- (list 'mouse-face 'highlight
- 'face 'org-link
- 'keymap org-mouse-map))
- (org-rear-nonsticky-at (match-end 0)))
- t))))
+ (let (f)
+ (when (and (re-search-forward (concat org-plain-link-re) limit t)
+ (not (org-in-src-block-p)))
+ (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
+ (setq f (get-text-property (match-beginning 0) 'face))
+ (unless (or (org-in-src-block-p)
+ (eq f 'org-tag)
+ (and (listp f) (memq 'org-tag f)))
+ (add-text-properties (match-beginning 0) (match-end 0)
+ (list 'mouse-face 'highlight
+ 'face 'org-link
+ 'keymap org-mouse-map))
+ (org-rear-nonsticky-at (match-end 0)))
+ t)))
(defun org-activate-code (limit)
(if (re-search-forward "^[ \t]*\\(:\\(?: .*\\|$\\)\n?\\)" limit t)
@@ -12845,27 +12844,27 @@ How much context is shown depends upon the variables
(following-p (org-get-alist-option org-show-following-heading key))
(entry-p (org-get-alist-option org-show-entry-below key))
(siblings-p (org-get-alist-option org-show-siblings key)))
- (catch 'exit
- ;; Show heading or entry text
- (if (and heading-p (not entry-p))
- (org-flag-heading nil) ; only show the heading
- (and (or entry-p (outline-invisible-p) (org-invisible-p2))
- (org-show-hidden-entry))) ; show entire entry
- (when following-p
- ;; Show next sibling, or heading below text
- (save-excursion
- (and (if heading-p (org-goto-sibling) (outline-next-heading))
- (org-flag-heading nil))))
- (when siblings-p (org-show-siblings))
- (when hierarchy-p
- ;; show all higher headings, possibly with siblings
- (save-excursion
- (while (and (condition-case nil
- (progn (org-up-heading-all 1) t)
- (error nil))
- (not (bobp)))
- (org-flag-heading nil)
- (when siblings-p (org-show-siblings))))))))
+ ;; Show heading or entry text
+ (if (and heading-p (not entry-p))
+ (org-flag-heading nil) ; only show the heading
+ (and (or entry-p (outline-invisible-p) (org-invisible-p2))
+ (org-show-hidden-entry))) ; show entire entry
+ (when following-p
+ ;; Show next sibling, or heading below text
+ (save-excursion
+ (and (if heading-p (org-goto-sibling) (outline-next-heading))
+ (org-flag-heading nil))))
+ (when siblings-p (org-show-siblings))
+ (when hierarchy-p
+ ;; show all higher headings, possibly with siblings
+ (save-excursion
+ (while (and (condition-case nil
+ (progn (org-up-heading-all 1) t)
+ (error nil))
+ (not (bobp)))
+ (org-flag-heading nil)
+ (when siblings-p (org-show-siblings)))))
+ (save-excursion (goto-char (window-start)) (recenter 0))))
(defvar org-reveal-start-hook nil
"Hook run before revealing a location.")