Suspicious code

View: New views
1 Messages — Rating Filter:   Alert me  

Suspicious code

by Stefan Monnier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can you fix the code below or add comments explaining why
it's correct?

Thank you,


        Stefan


--- lisp/org/org.el 4 Oct 2009 01:36:08 -0000 1.56
+++ lisp/org/org.el 28 Oct 2009 18:47:51 -0000
@@ -17193,6 +17189,7 @@
  'org-imenu t))
       (setq m (get-text-property p 'org-imenu-marker))
       (save-excursion
+        ;; Shouldn't the set-buffer be done before save-restriction?  --Stef
  (save-restriction
   (set-buffer (marker-buffer m))
   (goto-char m)
@@ -17207,6 +17204,7 @@
     txt (buffer-substring-no-properties (or tp (point-min))
  (or np (point-max))))
       (save-excursion
+        ;; Shouldn't the set-buffer be done before save-restriction?  --Stef
  (save-restriction
   (set-buffer (find-file-noselect
        (let ((default-directory dir))