From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Hong Xu Newsgroups: gmane.emacs.bugs Subject: bug#24861: [PATCH] Fix annoying "Parsing...done" message in c++-mode Date: Wed, 02 Nov 2016 16:34:22 -0700 Message-ID: <87pomdihhd.fsf@topbug.net> References: <87r36tn2ka.fsf@topbug.net> <87oa1xmyok.fsf@topbug.net> <83d1idmy3c.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1478129742 19979 195.159.176.226 (2 Nov 2016 23:35:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 2 Nov 2016 23:35:42 +0000 (UTC) User-Agent: mu4e 0.9.17; emacs 25.1.50.8 Cc: 24861@debbugs.gnu.org, Andreas Schwab To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 03 00:35:38 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c253m-0001Xw-Ok for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Nov 2016 00:35:10 +0100 Original-Received: from localhost ([::1]:58233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c253p-0006JJ-AP for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Nov 2016 19:35:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c253i-0006Gl-BQ for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2016 19:35:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c253e-0006ER-HU for bug-gnu-emacs@gnu.org; Wed, 02 Nov 2016 19:35:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53803) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c253e-0006EL-Eu; Wed, 02 Nov 2016 19:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c253e-0005jO-9I; Wed, 02 Nov 2016 19:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 02 Nov 2016 23:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24861 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: patch Original-Received: via spool by 24861-submit@debbugs.gnu.org id=B24861.147812967421976 (code B ref 24861); Wed, 02 Nov 2016 23:35:02 +0000 Original-Received: (at 24861) by debbugs.gnu.org; 2 Nov 2016 23:34:34 +0000 Original-Received: from localhost ([127.0.0.1]:40960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c253B-0005iN-Q1 for submit@debbugs.gnu.org; Wed, 02 Nov 2016 19:34:33 -0400 Original-Received: from sender163-mail.zoho.com ([74.201.84.163]:21404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c253A-0005iA-9y for 24861@debbugs.gnu.org; Wed, 02 Nov 2016 19:34:32 -0400 Original-Received: from localhost (usc-secure-wireless-088-061.usc.edu [68.181.88.61]) by mx.zohomail.com with SMTPS id 1478129665960259.9143649185362; Wed, 2 Nov 2016 16:34:25 -0700 (PDT) In-reply-to: <83d1idmy3c.fsf@gnu.org> X-Zoho-Virus-Status: 1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:125283 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain On 2016-11-02 Wed 13:21 GMT-0700, Eli Zaretskii wrote: > (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. I've added some explanation in the docstring. The attachment is a new version. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=cpp-message.patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el index 7d641ab47f09..a0705023b448 100644 =2D-- a/lisp/progmodes/cpp.el +++ b/lisp/progmodes/cpp.el @@ -104,6 +104,15 @@ cpp-edit-list (const :tag "Both branches writable" both)))) :group 'cpp) =20 +(defcustom cpp-message-min-time-interval 1 + "Indicate the minimum time interval in seconds that `cc-mode' +should print messages. If set to nil, `cc-mode' will print no +message. This may be useful to set when the message `cc-mode' +prints too many messages that competes with other information in +the echo area." + :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 +287,7 @@ cpp-highlight-buffer (cpp-parse-close from to)) (t (cpp-parse-error "Parser error")))))))) =2D (message "Parsing...done")) + (cpp-progress-message "Parsing...done")) (if cpp-state-stack (save-excursion (goto-char (nth 3 (car cpp-state-stack))) @@ -823,12 +832,14 @@ cpp-progress-time ;; Last time we issued a progress message. =20 (defun cpp-progress-message (&rest args) =2D ;; Report progress at most once a second. Take same ARGS as `message'. =2D (let ((time (nth 1 (current-time)))) =2D (if (=3D time cpp-progress-time) =2D () =2D (setq cpp-progress-time time) =2D (apply 'message args)))) + "Report progress at most once a second. Take same ARGS as +`message'." + (when cpp-message-min-time-interval + (let ((time (nth 1 (current-time)))) + (when (>=3D (- time cpp-progress-time) + cpp-message-min-time-interval) + (setq cpp-progress-time time) + (apply 'message args))))) =20 (provide 'cpp) =20 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJYGnf+AAoJECZsfTOCL4R4S9QP/Rw4VIw8XhZpwqEapDu20IVc u1kTBmIYpLRnrsi6ccGXP8ATUozMn8ncIHhTeHcmweps4U+gdAGOpatzR4Dqab6+ OzFRRlDX9Fqj96eWUfbWv8PvL8RejZryfaG5GFKGTNd9ALoJZNMaYUA9Cof3a9KR DL4OOi8d76E21ZzGFFuhT7qeaW95J0vgk7Q/UAQx4P1miFI2565SnFiIYB5Is7T6 zf3faxvlNFAV6sNM0QRCLpTXizLapIxqaezCUvqptOAdfUt6MQIUVnkYhPlifM9G ktngSrthVZoSBxUfFMQjL15JKvKKv0Kifn/Y4vRvf1coe5/5yqAIoKwVic6o+ytl qu+23kdF0hzbt6j4Krm1Y1N0MyEW2JuNgQKiAwkcfeh5WyrAAGJONBwCJOXUOthZ nAaVXJeKDPvdpup61mTSfZhyueoITSa6bCkNj1ReAOl1LpX+SuReL3BYp2upQOi1 Wl1IvmGKicbLcIMnInlCNT+CqTM+kxyjhrYLbCGFVez5kDKcp4T8klCZOqI8zKJr prUxoYQ+Vnq4hz1TcvxF5h4p9TayevmctMn9WS8jZW/c/SpWoZOCkrHGpiV1G973 yNwjwMNMsW3l7NeXB9jRq64bL3MiywhUtjqgrL2bB37U903wThS+NOVF/CzJ//ou ZJI48kwZVqQ2K35KMayt =mx7u -----END PGP SIGNATURE----- --==-=-=--