bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow


From: Juri Linkov
Subject: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Mon, 05 Feb 2018 23:31:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

> Could we use message-truncate-lines and just one message call instead?

Maybe.  But currently what is truncated is not the whole command line,
but each of the command switches.  I don't know how important this is.

> The 20 characters limit seems arbitrary, we just need to avoid resizing the
> echo area. And if the "in background... done" part being truncated is
> a worry, we can rephrase them to go at the beginning of the sentence.

Indeed, truncating "in background... done" is not nice, and I have
no idea how to rephrase it.

Anyway, this is the current patch to try:

diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index b0d2221..21f2b98 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -290,16 +290,12 @@ vc-do-command
   (let* ((files
          (mapcar (lambda (f) (file-relative-name (expand-file-name f)))
                  (if (listp file-or-list) file-or-list (list file-or-list))))
+        (message-truncate-lines t)
         (full-command
-         ;; What we're doing here is preparing a version of the command
-         ;; for display in a debug-progress message.  If it's fewer than
-         ;; 20 characters display the entire command (without trailing
-         ;; newline).  Otherwise display the first 20 followed by an ellipsis.
          (concat (if (string= (substring command -1) "\n")
                      (substring command 0 -1)
                    command)
-                 " "
-                 (vc-delistify (mapcar (lambda (s) (if (> (length s) 20) 
(concat (substring s 0 2) "...")  s)) flags))
+                 " " (vc-delistify flags)
                  " " (vc-delistify files))))
     (save-current-buffer
       (unless (or (eq buffer t)
@@ -332,7 +328,8 @@ vc-do-command
                (setq status proc)
                (when vc-command-messages
                  (vc-run-delayed
-                  (message "Running %s in background... done" full-command))))
+                   (let ((message-truncate-lines t))
+                     (message "Running %s in background... done" 
full-command)))))
            ;; Run synchronously
            (when vc-command-messages
              (message "Running %s in foreground..." full-command))





reply via email to

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