Browse Source

contrib/lisp/org-git-link.el: Small fixes

* contrib/lisp/org-git-link.el: Wrap into `eval-and-compile'
to silent warnings.
(org-git-show): Use `with-current-buffer' instead
of (save-excursion (set-buffer ...))

TINYCHANGE
Aaron Ecay 8 years ago
parent
commit
69eb39a4a9
1 changed files with 6 additions and 6 deletions
  1. 6 6
      contrib/lisp/org-git-link.el

+ 6 - 6
contrib/lisp/org-git-link.el

@@ -132,10 +132,11 @@
       (list (expand-file-name ".git" dir) relpath))))
 
 
-(if (featurep 'xemacs)
-    (defalias 'org-git-gitrepos-p 'org-git-find-gitdir)
-  (defalias 'org-git-gitrepos-p 'org-git-find-gitdir
-  "Return non-nil if path is in git repository"))
+(eval-and-compile
+  (if (featurep 'xemacs)
+      (defalias 'org-git-gitrepos-p 'org-git-find-gitdir)
+    (defalias 'org-git-gitrepos-p 'org-git-find-gitdir
+      "Return non-nil if path is in git repository")))
 
 ;; splitting the link string
 
@@ -196,8 +197,7 @@
   (unless
       (zerop (call-process org-git-program nil buffer nil
                            "--no-pager" (concat "--git-dir=" gitdir) "show" object))
-    (error "git error: %s " (save-excursion (set-buffer buffer)
-                                            (buffer-string)))))
+    (error "git error: %s " (with-current-buffer buffer (buffer-string)))))
 
 (defun org-git-blob-sha (gitdir object)
   "Return sha of the referenced object"