GNU bug report logs - #24861
[PATCH] Fix annoying "Parsing...done" message in c++-mode

Previous Next

Packages: cc-mode, emacs;

Reported by: Hong Xu <hong <at> topbug.net>

Date: Wed, 2 Nov 2016 18:46:01 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Hong Xu <hong <at> topbug.net>
Subject: bug#24861: closed (Re: bug#24861: [PATCH] Fix annoying
 "Parsing...done" message in c++-mode)
Date: Fri, 25 Nov 2016 10:55:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#24861: [PATCH] Fix annoying "Parsing...done" message in c++-mode

which was filed against the emacs,cc-mode package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 24861 <at> debbugs.gnu.org.

-- 
24861: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24861
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Hong Xu <hong <at> topbug.net>
Cc: 24861-done <at> debbugs.gnu.org
Subject: Re: bug#24861: [PATCH] Fix annoying "Parsing...done" message in
 c++-mode
Date: Fri, 25 Nov 2016 12:53:45 +0200
> From: Hong Xu <hong <at> topbug.net>
> Cc: 24861 <at> debbugs.gnu.org
> Date: Sat, 19 Nov 2016 16:20:10 -0800
> 
> Thanks, updated.

Thanks, pushed to master.

[Message part 3 (message/rfc822, inline)]
From: Hong Xu <hong <at> topbug.net>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Fix annoying "Parsing...done" message in c++-mode
Date: Wed, 02 Nov 2016 11:45:25 -0700
[Message part 4 (text/plain, inline)]
This patch adds a customizable variable cpp-message-min-time-interval to
avoid over messaging.

[cpp-message.patch (text/x-diff, inline)]
diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el
index 7d641ab47f09..1dd179d9103f 100644
--- a/lisp/progmodes/cpp.el
+++ b/lisp/progmodes/cpp.el
@@ -104,6 +104,12 @@ 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
+print messages.  No message will be printed if set to 0."
+  :type 'integer
+  :group 'cpp)
+
 (defvar cpp-overlay-list nil)
 ;; List of cpp overlays active in the current buffer.
 (make-variable-buffer-local 'cpp-overlay-list)
@@ -278,7 +284,7 @@ cpp-highlight-buffer
 			  (cpp-parse-close from to))
 			 (t
 			  (cpp-parse-error "Parser error"))))))))
-      (message "Parsing...done"))
+      (cpp-progress-message "Parsing...done"))
     (if cpp-state-stack
       (save-excursion
 	(goto-char (nth 3 (car cpp-state-stack)))
@@ -823,10 +829,10 @@ cpp-progress-time
 ;; Last time we issued a progress message.
 
 (defun cpp-progress-message (&rest args)
-  ;; Report progress at most once a second.  Take same ARGS as `message'.
+  "Report progress at most once a second.  Take same ARGS as `message'."
   (let ((time (nth 1 (current-time))))
-    (if (= time cpp-progress-time)
-	()
+    (when (>= (- time cpp-progress-time)
+              cpp-message-min-time-interval)
       (setq cpp-progress-time time)
       (apply 'message args))))
 

This bug report was last modified 8 years and 176 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.