emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: Patch: org-reload changes default-directory


From: Carsten Dominik
Subject: [Orgmode] Re: Patch: org-reload changes default-directory
Date: Wed, 11 Nov 2009 10:48:51 +0100

Hi Sebastian,

excellent catch, thank you very much!  This was one difficult
to trace bug.

I have applied you patch and modified it a bit further, by
wrapping it in unwind-protect.  So even if the version computation
throws an error, the working directory will be restored.

- Carsten

P.S.  In fact, Bernt did try to restore the working directory
      in his original org-version function, but that code was
      not always executed due to badly placed parenthesis.

On Nov 10, 2009, at 11:51 PM, SebastianRose wrote:

Hi,


I found out why I ran into this earlier. It's _not_ org-reload, it's
org-version that changes the default directory. Patch attached.


I don't know where my bug report is... so I cannot respond to that
post.




Best wishes,

 Sebastian

diff --git a/lisp/org.el b/lisp/org.el
index 42e229e..0b1005f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -102,7 +102,8 @@
  "Show the org-mode version in the echo area.
With prefix arg HERE, insert it at point."
  (interactive "P")
-  (let* ((version org-version)
+  (let* ((origin default-directory)
+        (version org-version)
         (git-version)
         (dir (concat (file-name-directory (locate-library "org")) "../" )))
    (if (and (file-exists-p (expand-file-name ".git" dir))
@@ -122,6 +123,7 @@ With prefix arg HERE, insert it at point."
            (cd pwd))))
    (setq version (format "Org-mode version %s" version))
    (if here (insert version))
+    (cd origin)
    (message version)
    version))


- Carsten







reply via email to

[Prev in Thread] Current Thread [Next in Thread]