emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/git-commit 2049fd6: magit-version: Bang on it some more


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 2049fd6: magit-version: Bang on it some more
Date: Wed, 22 Sep 2021 17:57:35 -0400 (EDT)

branch: elpa/git-commit
commit 2049fd6f6eae7e958b673e809299bc7d3f02a781
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-version: Bang on it some more
    
    The very first iteration of this function [1: afb15b75e] already
    looked for the source code instead of the byte code:
    
      (let ((toplib (or load-file-name buffer-file-name)))
        (unless (and toplib
                     (equal (file-name-nondirectory toplib) "magit.el"))
          (setq toplib (locate-library "magit.el")))
    
    I am unsure why I did that back then.
    
    Recently [2: d173de73e] we changed this code because the source file
    could also be named "magit.el.gz", but that failed to accomplish the
    goal, because `file-name-sans-extension' only removes one extension
    ".gz", not all of them ".el.gz", and additionally it started matching
    the byte code file "magit.elc".
    
    Matching the elc file breaks version detection when using straight
    because there we have to follow a symlink from the "build" directory
    (where the package is installed) into the "repos" directory where the
    actual git repository lives, but unlike the source file, the byte code
    file isn't a symlink from inside the former to inside the latter.
    
    Closes #4511.
    
    1: 2013-07-20 afb15b75ed897c47c18da049545ff03be065a7ec
       improve version detection and build process
    
    2: 2021-09-06 d173de73e96e207d4ba3821e1d720c8d81f6bafb
       magit-version: Make more flexible for when no *.el exists
---
 lisp/magit.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/magit.el b/lisp/magit.el
index ab869dd..82c26ea 100644
--- a/lisp/magit.el
+++ b/lisp/magit.el
@@ -496,9 +496,8 @@ and Emacs to it."
         (toplib (or load-file-name buffer-file-name))
         debug)
     (unless (and toplib
-                 (equal (file-name-sans-extension
-                         (file-name-nondirectory toplib))
-                        "magit"))
+                 (member (file-name-nondirectory toplib)
+                         '("magit.el" "magit.el.gz")))
       (setq toplib (locate-library "magit")))
     (setq toplib (and toplib (magit--straight-chase-links toplib)))
     (push toplib debug)



reply via email to

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