From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: canonical verbose? Date: Sat, 21 Sep 2013 07:03:40 -0700 (PDT) Message-ID: <6d1a31f3-98ce-40c6-b416-97134021b5ae@default> References: <> <> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1379772249 10452 80.91.229.3 (21 Sep 2013 14:04:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Sep 2013 14:04:09 +0000 (UTC) To: Barry Margolin , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 21 16:04:11 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VNNn9-0002DQ-7i for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Sep 2013 16:04:11 +0200 Original-Received: from localhost ([::1]:60300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNNn8-00079e-GS for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Sep 2013 10:04:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNNmq-00079V-L7 for help-gnu-emacs@gnu.org; Sat, 21 Sep 2013 10:04:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNNmi-0007Ja-3A for help-gnu-emacs@gnu.org; Sat, 21 Sep 2013 10:03:52 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:25924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNNmh-0007JV-RQ for help-gnu-emacs@gnu.org; Sat, 21 Sep 2013 10:03:44 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r8LE3f0n002720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 21 Sep 2013 14:03:41 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8LE3e14026160 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 21 Sep 2013 14:03:40 GMT Original-Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r8LE3diA008876; Sat, 21 Sep 2013 14:03:39 GMT In-Reply-To: <> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93493 Archived-At: > > writing quite often commands which should give some reports when being > > successful, like that: > > > > (defun ar-up-list () > > "Returns position reached when successful, nil otherwise" > > (interactive)... > > (when (interactive-p) (message "%s" erg)) > > erg)) > > > > However, binding the message at interactive-usage alone seems not optim= al. > > Does Emacs provide some variable setting verbosity? >=20 > Another option is to have two functions: one that does all the work, and > a command that calls the first function and then displays a message. I do not know of a general, global approach. You could perhaps, for your o= wn code, use a macro or even add a global variable etc. But there is nothi= ng built in, AFAIK. But I did want to mention, for those who might not be aware of it (not Barr= y or Andreas, no doubt), what the Elisp manual (node `Distinguish Interacti= ve') recommends for an individual command: Sometimes a command should display additional visual feedback (such as an informative message in the echo area) for interactive calls only. There are three ways to do this. The recommended way to test whether the function was called using `call-interactively' is to give it an optional argument `print-message' and use the `interactive' spec to make it non-`nil' in interactive calls. Here's an example: (defun foo (&optional print-message) (interactive "p") (when print-message (message "foo"))) We use `"p"' because the numeric prefix argument is never `nil'. Defined in this way, the function does display the message when called from a keyboard macro. The above method with the additional argument is usually best, because it allows callers to say "treat this call as interactive".