branch: elpa/git-commit
commit ea02c8e6349b4f29c1bd325632fb12bbd65f6b2f
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit-log-buffer-file: Support using the region in blobs again
    
    Finally fix the regression introduced by [1: 293bf0d6c8].  The goal
    there was to ignore the region in Dired buffers and that was done by
    checking if the file (in this case `default-directory') is a regular
    file.  Blobs were collateral damage of this approach, because they too
    are not considered regular files.  Instead test what actually matters:
    is the current buffer a Dired buffer?
    
    1: 2018-04-02 293bf0d6c8d25cab3c583f921e9d19d42456e38b
       magit-log-buffer-file: Only trace changes if is a regular file
---
 lisp/magit-log.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/magit-log.el b/lisp/magit-log.el
index c71c51ddb9..6e9dcb0d7e 100644
--- a/lisp/magit-log.el
+++ b/lisp/magit-log.el
@@ -763,6 +763,7 @@ restrict the log to the lines that the region touches."
    (cons current-prefix-arg
          (and (region-active-p)
               (magit-file-relative-name)
+              (not (derived-mode-p 'dired-mode))
               (save-restriction
                 (widen)
                 (list (line-number-at-pos (region-beginning))
@@ -782,9 +783,7 @@ restrict the log to the lines that the region touches."
        (let ((args (car (magit-log-arguments))))
          (when (and follow (not (member "--follow" args)))
            (push "--follow" args))
-         (when (and (file-regular-p
-                     (expand-file-name file (magit-toplevel)))
-                    beg end)
+         (when (and beg end)
            (setq args (cons (format "-L%s,%s:%s" beg end file)
                             (cl-delete "-L" args :test
                                        #'string-prefix-p)))

Reply via email to