Browse Source

Make sure outline path display uses full path, even in a narrowed buffer

When a buffer was narrowed, the path was truncated.
Carsten Dominik 15 years ago
parent
commit
2129ea6494
2 changed files with 7 additions and 4 deletions
  1. 1 0
      lisp/ChangeLog
  2. 6 4
      lisp/org.el

+ 1 - 0
lisp/ChangeLog

@@ -1,6 +1,7 @@
 2009-11-15  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-set-effort): Improve prompt.
+	(org-get-outline-path): Widen to get full path.
 
 	* org-latex.el (org-export-as-latex): Add the :drawers property.
 

+ 6 - 4
lisp/org.el

@@ -9006,10 +9006,12 @@ avoiding backtracing."
 	  (aset org-olpa level heading)))
     (let (rtn)
       (save-excursion
-	(while (org-up-heading-safe)
-	  (when (looking-at org-complex-heading-regexp)
-	    (push (org-match-string-no-properties 4) rtn)))
-	rtn))))
+	(save-restriction
+	  (widen)
+	  (while (org-up-heading-safe)
+	    (when (looking-at org-complex-heading-regexp)
+	      (push (org-match-string-no-properties 4) rtn)))
+	  rtn)))))
 
 (defun org-format-outline-path (path &optional width prefix)
   "Format the outlie path PATH for display.