unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 19045@debbugs.gnu.org, dgutov@yandex.ru
Subject: bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow
Date: Tue, 20 Feb 2018 22:39:25 +0200	[thread overview]
Message-ID: <87sh9vtmyq.fsf@mail.linkov.net> (raw)
In-Reply-To: <83r2ple53c.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 16 Feb 2018 10:00:55 +0200")

[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]

>> -		  (message "Running %s in background..." full-command))
>> +		  (message "Running  in background: %s" full-command))
>                                    ^^
> Extra blank.
>
>> -		   (message "Running %s in background... done" full-command))))
>> +		    (let ((message-truncate-lines t))
>> +		      (message "Finished in background: %s" full-command)))))
>
> I find the original more in line with what we do elsewhere in Emacs.
> If the problem is that "done" could be truncated, then please use
>
>   Done in background: %s

Then extra blank is not needed when using “Done in background” because it
would require too many blanks to align with “Finished in background”.

>> -	      (error "Running %s...FAILED (%s)" full-command
>> -		     (if (integerp status) (format "status %d" status) status)))
>> +	      (error "Failed (%s): %s"
>> +                     (if (integerp status) (format "status %d" status) status)
>> +		     full-command))
>>  	    (when vc-command-messages
>> -	      (message "Running %s...OK = %d" full-command status))))
>> +	      (message "Success (%d): %s" status full-command))))
>
> "Failed" and "Success" don't go together well, as they use different
> grammatical form.  How about using "Done" here as well?  And won't
> status always be zero when it succeeds?  If not, I'd use

I see that the status in case of success is 1.

>   Done (status=%d): %s

Done in the following patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: vc-dispatcher.patch --]
[-- Type: text/x-diff, Size: 3191 bytes --]

diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index b0d2221..da9d346 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -290,16 +290,16 @@ 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))))
+	 ;; Keep entire commands in *Messages* but avoid resizing the
+	 ;; echo area.  Messages in this function are formatted in
+	 ;; a such way that the important parts are at the beginning,
+	 ;; due to potential truncation of long messages.
+	 (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)
@@ -324,7 +324,7 @@ vc-do-command
 		       (apply 'start-file-process command (current-buffer)
                               command squeezed))))
 		(when vc-command-messages
-		  (message "Running %s in background..." full-command))
+		  (message "Running in background: %s" full-command))
                 ;; Get rid of the default message insertion, in case we don't
                 ;; set a sentinel explicitly.
 		(set-process-sentinel proc #'ignore)
@@ -332,10 +332,11 @@ 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 "Done in background: %s" full-command)))))
 	    ;; Run synchronously
 	    (when vc-command-messages
-	      (message "Running %s in foreground..." full-command))
+	      (message "Running in foreground: %s" full-command))
 	    (let ((buffer-undo-list t))
 	      (setq status (apply 'process-file command nil t nil squeezed)))
 	    (when (and (not (eq t okstatus))
@@ -345,13 +346,14 @@ vc-do-command
                 (pop-to-buffer (current-buffer))
                 (goto-char (point-min))
                 (shrink-window-if-larger-than-buffer))
-	      (error "Running %s...FAILED (%s)" full-command
-		     (if (integerp status) (format "status %d" status) status)))
+	      (error "Failed (%s): %s"
+		     (if (integerp status) (format "status %d" status) status)
+		     full-command))
 	    (when vc-command-messages
-	      (message "Running %s...OK = %d" full-command status))))
+	      (message "Done (status=%d): %s" status full-command))))
 	(vc-run-delayed
-	 (run-hook-with-args 'vc-post-command-functions
-                             command file-or-list flags))
+	  (run-hook-with-args 'vc-post-command-functions
+			      command file-or-list flags))
 	status))))
 
 (defun vc-do-async-command (buffer root command &rest args)

  parent reply	other threads:[~2018-02-20 20:39 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 17:05 bug#19045: 25.0.50; [PATCH] vc-git-print-log use --follow Óscar Fuentes
2014-11-13 19:07 ` Dmitry Gutov
2014-11-13 21:11   ` Óscar Fuentes
2018-02-03 21:59 ` Juri Linkov
2018-02-04 21:58   ` Juri Linkov
2018-02-04 23:31     ` Dmitry Gutov
2018-02-05  3:39       ` Eli Zaretskii
2018-02-05  8:25         ` Dmitry Gutov
2018-02-05 16:18           ` Eli Zaretskii
2018-02-05 20:11             ` Dmitry Gutov
2018-02-05 21:31       ` Juri Linkov
2018-02-06 20:46         ` Dmitry Gutov
2018-02-06 21:51           ` Juri Linkov
2018-02-08 22:08             ` Dmitry Gutov
2018-02-10 21:14               ` Juri Linkov
2018-02-12  0:18                 ` Dmitry Gutov
2018-02-15 22:07                   ` Juri Linkov
2018-02-16  8:00                     ` Eli Zaretskii
2018-02-16 10:20                       ` Dmitry Gutov
2018-02-16 10:52                         ` Eli Zaretskii
2018-02-18  0:13                         ` Richard Stallman
2018-02-20 20:39                       ` Juri Linkov [this message]
2018-02-21  3:36                         ` Eli Zaretskii
2018-02-05  3:33     ` Eli Zaretskii
2018-02-05 21:17       ` Juri Linkov
2018-02-06  3:40         ` Eli Zaretskii
2018-02-06 21:04           ` Juri Linkov
2018-02-08 15:54             ` Eli Zaretskii
2018-02-08 21:09               ` Juri Linkov
2018-02-09  7:08                 ` Eli Zaretskii
2018-02-10 11:07   ` Eli Zaretskii
2018-02-10 21:08     ` Juri Linkov
2018-02-11 16:24       ` Eli Zaretskii
2018-02-11 17:03         ` Andreas Schwab
2018-02-11 17:25           ` Eli Zaretskii
2018-02-11 18:22             ` Andreas Schwab
2018-02-11 18:49               ` Eli Zaretskii
2018-02-11 21:22                 ` Juri Linkov
2018-02-12 18:09                   ` Eli Zaretskii
2018-02-12 21:50                     ` Juri Linkov
2018-02-13  5:40                       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sh9vtmyq.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=19045@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).