summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2014-03-25 12:04:09 +0100
committerBastien Guerry <bzg@altern.org>2014-03-25 12:04:09 +0100
commit0e344ae04a6b7673578ba8306ce330e12554b818 (patch)
treea033db84c4c5027a16987bcbab0fd030d1dd7a29
parent2e79bd8119a0c8ec1141873706b04aa6fe3d932f (diff)
downloadorg-mode-0e344ae04a6b7673578ba8306ce330e12554b818.tar.gz
org-compat.el (org-move-to-column): Fix bug
* org-compat.el (org-move-to-column): Temporarily set `buffer-invisibility-spec' more accurately. Thanks to Samuel Wales for reporting this.
-rw-r--r--lisp/org-compat.el24
1 files changed, 12 insertions, 12 deletions
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 33a799d..70c41d5 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -347,18 +347,18 @@ Works on both Emacs and XEmacs."
"Move to column COLUMN.
Pass COLUMN and FORCE to `move-to-column'.
Pass BUFFER to the XEmacs version of `move-to-column'."
- (let ((buffer-invisibility-spec
- (if (or
- ;; Ignore all visibility spec in agenda
- (not (derived-mode-p 'org-mode))
- ;; Ignore bracket links elsewere
- (and (save-excursion
- (forward-line 0)
- (looking-at (concat "^.*" org-bracket-link-regexp)))
- (member '(org-link)
- buffer-invisibility-spec)))
- t
- buffer-invisibility-spec)))
+ (let* ((with-bracket-link
+ (save-excursion
+ (forward-line 0)
+ (looking-at (concat "^.*" org-bracket-link-regexp))))
+ (buffer-invisibility-spec
+ (cond
+ ((or (not (derived-mode-p 'org-mode))
+ (and with-bracket-link (org-invisible-p2)))
+ (remove '(org-link) buffer-invisibility-spec))
+ (with-bracket-link
+ (remove t buffer-invisibility-spec))
+ (t buffer-invisibility-spec))))
(if (featurep 'xemacs)
(org-xemacs-without-invisibility
(move-to-column column force buffer))