From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24861: [PATCH] Fix annoying "Parsing...done" message in c++-mode Date: Sat, 19 Nov 2016 09:50:40 +0200 Message-ID: <83mvgvc3hr.fsf@gnu.org> References: <87r36tn2ka.fsf@topbug.net> <87oa1xmyok.fsf@topbug.net> <83d1idmy3c.fsf@gnu.org> <87pomdihhd.fsf@topbug.net> <831sysmnvc.fsf@gnu.org> <87a8dgo13q.fsf@topbug.net> <877f84mgu0.fsf@topbug.net> <83zikxcejl.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1479541873 16955 195.159.176.226 (19 Nov 2016 07:51:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 19 Nov 2016 07:51:13 +0000 (UTC) Cc: 24861@debbugs.gnu.org To: Hong Xu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 19 08:51:09 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 1c80QW-0003sb-Oh for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Nov 2016 08:51:08 +0100 Original-Received: from localhost ([::1]:40408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c80Qa-0005KT-0j for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Nov 2016 02:51:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c80QU-0005KO-QT for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 02:51:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c80QU-0002w5-0z for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2016 02:51:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47222) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c80QP-0002vf-V8; Sat, 19 Nov 2016 02:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c80QP-0008Eq-Ly; Sat, 19 Nov 2016 02:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sat, 19 Nov 2016 07:51:01 +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.147954184531646 (code B ref 24861); Sat, 19 Nov 2016 07:51:01 +0000 Original-Received: (at 24861) by debbugs.gnu.org; 19 Nov 2016 07:50:45 +0000 Original-Received: from localhost ([127.0.0.1]:34388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c80Q9-0008EL-En for submit@debbugs.gnu.org; Sat, 19 Nov 2016 02:50:45 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c80Q7-0008E6-AT for 24861@debbugs.gnu.org; Sat, 19 Nov 2016 02:50:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c80Py-0002rp-Rg for 24861@debbugs.gnu.org; Sat, 19 Nov 2016 02:50:38 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c80Py-0002rj-NX; Sat, 19 Nov 2016 02:50:34 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3387 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c80Px-000169-On; Sat, 19 Nov 2016 02:50:34 -0500 In-reply-to: (message from Hong Xu on Fri, 18 Nov 2016 11:55:28 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:125860 Archived-At: > Cc: 24861@debbugs.gnu.org > From: Hong Xu > 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'. Thanks, but there are still left-overs: > +(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.