diff options
author | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:27 +0200 |
---|---|---|
committer | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:27 +0200 |
commit | e32a45ed36d6000db4b39171149072d11b77af72 (patch) | |
tree | b5f4a7d43022c08c3298e82b3e9fc50f68be660f /contrib/lisp/org-git-link.el | |
parent | 7697fa4daf3ec84f85711a84035d8f0224afd4e3 (diff) |
Imported Upstream version 8.0.7
Diffstat (limited to 'contrib/lisp/org-git-link.el')
-rw-r--r-- | contrib/lisp/org-git-link.el | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/lisp/org-git-link.el b/contrib/lisp/org-git-link.el index 8223712..b9e6a4e 100644 --- a/contrib/lisp/org-git-link.el +++ b/contrib/lisp/org-git-link.el @@ -1,10 +1,12 @@ ;;; org-git-link.el --- Provide org links to specific file version -;; Copyright (C) 2009-2012 Reimar Finken +;; Copyright (C) 2009-2013 Reimar Finken ;; Author: Reimar Finken <reimar.finken@gmx.de> ;; Keywords: files, calendar, hypermedia +;; This file is not part of GNU Emacs. + ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or @@ -130,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 @@ -171,7 +174,7 @@ (let* ((gitdir (first (org-git-find-gitdir (file-truename file)))) (branchname (org-git-get-current-branch gitdir)) (timestring (format-time-string "%Y-%m-%d" (current-time)))) - (contact "git:" file "::" (org-git-create-searchstring branchname timestring)))) + (concat "git:" file "::" (org-git-create-searchstring branchname timestring)))) (defun org-git-store-link () "Store git link to current file." @@ -194,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" |