From e32a45ed36d6000db4b39171149072d11b77af72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Delafond?= Date: Sun, 13 Jul 2014 13:35:27 +0200 Subject: Imported Upstream version 8.0.7 --- contrib/lisp/org-git-link.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'contrib/lisp/org-git-link.el') 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 ;; 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" -- cgit v1.2.3