Discussion:
bug#24861: [PATCH] Fix annoying "Parsing...done" message in c++-mode
Richard Stallman
2016-11-03 16:39:08 UTC
Permalink
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
Please avoid using passive tense as much as possible (in the last
sentence).
Thank you for reminding people of this point.
--
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.
Hong Xu
2016-11-02 23:39:20 UTC
Permalink
(Not that I understand why this particular message needs to be
customizable.)
Also note that this patch does NOT ONLY customize this particular
message: it affects all messages printed by `cpp-progress-message'.



Hong
Andreas Schwab
2016-11-02 22:05:35 UTC
Permalink
diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el
index 7d641ab47f09..75ed7827adf8 100644
--- a/lisp/progmodes/cpp.el
+++ b/lisp/progmodes/cpp.el
@@ -104,6 +104,13 @@ cpp-edit-list
(const :tag "Both branches writable" both))))
:group 'cpp)
+(defcustom cpp-message-min-time-interval 1
+ "The minimum time interval in seconds that cpp-mode should
The first line of a doc string should be a full sentence.

Andreas.
--
Andreas Schwab, ***@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."



------------------------------------------------------------------------------
Eli Zaretskii
2016-11-03 18:15:03 UTC
Permalink
Date: Wed, 02 Nov 2016 16:34:22 -0700
(Not that I understand why this particular message needs to be
customizable.)
Because the messages by cpp.el is so frequent that it often competes
with other useful information.
Yes, but we have lots of similar messages in other places. A search
for a call to 'message' that displays "SOMETHING...done" turns up more
than 270 hits. Why is this particular package being singled out?

Also, what useful information does it conceal? Can you show a use
case where this happens?
I've added some explanation in the docstring.
That should not be necessary, such explanations should be in comments
and commit log messages.

Thanks.



------------------------------------------------------------------------------
Eli Zaretskii
2016-11-19 07:50:40 UTC
Permalink
Date: Fri, 18 Nov 2016 11:55:28 -0800
Allow users to customize the maximum frequency that
`cpp-progress-message' prints messages.
* progmodes/cpp.el (cpp-message-min-time-interval)
(cpp-progress-message): Add variable
`cpp-message-min-time-interval' to indicate the minimum time
interval in seconds that `cpp-progress-message' prints messages.
* progmodes/cpp.el (cpp-progress-time): Initialize to '(0 0 0 0) instead of
0 and improve the documentation.
* progmodes/cpp.el (cpp-highlight-buffer): Use
`cpp-progress-message' instead of `message'.
+(defcustom cpp-message-min-time-interval 1.0
+ "Indicate the minimum time interval in seconds that
+`cpp-progress-message' should print messages.
This should be one line, so the sentence should be shorter to fit. If
you drop the redundant "Indicate the" part, it will come close.
-(defvar cpp-progress-time 0)
-;; Last time we issued a progress message.
+(defvar cpp-progress-time '(0 0 0 0)
You could leave it at 0, no need to have a list here.
+ "Indicate the last time `cpp-progress-message' issued a
+ progress message.")
This should be a single line. Once again, please drop the uneeded
"Indicate" part.
(defun cpp-progress-message (&rest args)
- ;; Report progress at most once a second. Take same ARGS as `message'.
- (let ((time (nth 1 (current-time))))
- (if (= time cpp-progress-time)
- ()
- (setq cpp-progress-time time)
- (apply 'message args))))
+ "Report progress by printing messages at most once every
+`cpp-message-min-time-interval' seconds for functions whose names
+start with \"cpp-\". If `cpp-message-min-time-interval' is nil,
+it prints no message. The ARGS are the same as in `message'."
The first sentence of the doc string should take only one line.



------------------------------------------------------------------------------
Hong Xu
2016-11-20 00:20:10 UTC
Permalink
Post by Eli Zaretskii
Date: Fri, 18 Nov 2016 11:55:28 -0800
Allow users to customize the maximum frequency that
`cpp-progress-message' prints messages.
* progmodes/cpp.el (cpp-message-min-time-interval)
(cpp-progress-message): Add variable
`cpp-message-min-time-interval' to indicate the minimum time
interval in seconds that `cpp-progress-message' prints messages.
* progmodes/cpp.el (cpp-progress-time): Initialize to '(0 0 0 0) instead of
0 and improve the documentation.
* progmodes/cpp.el (cpp-highlight-buffer): Use
`cpp-progress-message' instead of `message'.
+(defcustom cpp-message-min-time-interval 1.0
+ "Indicate the minimum time interval in seconds that
+`cpp-progress-message' should print messages.
This should be one line, so the sentence should be shorter to fit. If
you drop the redundant "Indicate the" part, it will come close.
-(defvar cpp-progress-time 0)
-;; Last time we issued a progress message.
+(defvar cpp-progress-time '(0 0 0 0)
You could leave it at 0, no need to have a list here.
+ "Indicate the last time `cpp-progress-message' issued a
+ progress message.")
This should be a single line. Once again, please drop the uneeded
"Indicate" part.
(defun cpp-progress-message (&rest args)
- ;; Report progress at most once a second. Take same ARGS as `message'.
- (let ((time (nth 1 (current-time))))
- (if (= time cpp-progress-time)
- ()
- (setq cpp-progress-time time)
- (apply 'message args))))
+ "Report progress by printing messages at most once every
+`cpp-message-min-time-interval' seconds for functions whose names
+start with \"cpp-\". If `cpp-message-min-time-interval' is nil,
+it prints no message. The ARGS are the same as in `message'."
The first sentence of the doc string should take only one line.
Thanks, updated.



Allow users to customize the maximum frequency that `cpp-progress-message' prints messages.

* progmodes/cpp.el (cpp-message-min-time-interval)
(cpp-progress-message): Add variable
`cpp-message-min-time-interval' to indicate the minimum time
interval in seconds that `cpp-progress-message' prints messages.

* progmodes/cpp.el (cpp-progress-time): Improve the documentation.

* progmodes/cpp.el (cpp-highlight-buffer): Use
`cpp-progress-message' instead of `message' to print messages.
Eli Zaretskii
2016-11-25 10:53:45 UTC
Permalink
Date: Sat, 19 Nov 2016 16:20:10 -0800
Thanks, updated.
Thanks, pushed to master.



------------------------------------------------------------------------------
Loading...