From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Annoying "Parsing...done" message when editing C++ files Date: Wed, 02 Nov 2016 13:31:57 -0400 Message-ID: References: <87mvhiwte6.fsf@topbug.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1478110755 21477 195.159.176.226 (2 Nov 2016 18:19:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 2 Nov 2016 18:19:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 02 19:19:12 2016 Return-path: Envelope-to: geh-help-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 1c207r-0003vO-JJ for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Nov 2016 19:19:03 +0100 Original-Received: from localhost ([::1]:56848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c207u-0004IM-DW for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Nov 2016 14:19:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1zPU-0000R1-5d for help-gnu-emacs@gnu.org; Wed, 02 Nov 2016 13:33:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1zP4-0008I0-IV for help-gnu-emacs@gnu.org; Wed, 02 Nov 2016 13:33:12 -0400 Original-Received: from [195.159.176.226] (port=55396 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c1zP4-0008Gw-CW for help-gnu-emacs@gnu.org; Wed, 02 Nov 2016 13:32:46 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1c1zOf-0003xr-Dt for help-gnu-emacs@gnu.org; Wed, 02 Nov 2016 18:32:21 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:FfBI9jUcHVcx0RIJ4eMAucyIndc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-Mailman-Approved-At: Wed, 02 Nov 2016 14:18:21 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111656 Archived-At: > (defun my-cpp-highlight-buffer-advice (orig &rest args) > (let ((inhibit-message t)) > (apply orig args))) > > (with-eval-after-load 'cpp > (advice-add 'cpp-highlight-buffer :around > #'my-cpp-highlight-buffer-advice)) One more thing: just like with the docstring, it's often better to name the function after what it *does* than after who uses it. This applies less to hooks and such (which tend to be rather specific/ad-hoc), but here it does because your piece of advice is actually quite generic: (defun my-inhibit-messages (orig &rest args) (let ((inhibit-message t)) (apply orig args))) (advice-add 'cpp-highlight-buffer :around #'my-inhibit-messages) Oh, yet another thing: you can shorten the function slightly to (defun my-inhibit-messages (&rest args) (let ((inhibit-message t)) (apply args))) -- Stefan