* bug#12491: 24.2.50; `Info-insert-dir' should be able to not show msgs
@ 2012-09-22 22:42 Drew Adams
2012-09-22 22:52 ` Drew Adams
2012-09-22 23:50 ` Juri Linkov
0 siblings, 2 replies; 8+ messages in thread
From: Drew Adams @ 2012-09-22 22:42 UTC (permalink / raw)
To: 12491
`Info-insert-dir' is not an interactive function. It can be called by
any Lisp code that wants to insert an Info directory. Please provide an
optional MSG arg (or a NOMSG) arg, so that calling code can optionally
not show the message "Composing main Info directory...done".
In GNU Emacs 24.2.50.1 (i386-mingw-nt5.1.2600)
of 2012-09-17 on MARVIN
Bzr revision: 110062 cyd@gnu.org-20120917054104-r93rtwkrtva73ewe
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
`configure --with-gcc (4.7) --no-opt --enable-checking --cflags
-ID:/devel/emacs/libs/libXpm-3.5.8/include
-ID:/devel/emacs/libs/libXpm-3.5.8/src
-ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
-ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
-ID:/devel/emacs/libs/giflib-4.1.4-1/include
-ID:/devel/emacs/libs/jpeg-6b-4/include
-ID:/devel/emacs/libs/tiff-3.8.2-1/include
-ID:/devel/emacs/libs/gnutls-3.0.9/include
-ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include
-ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2'
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#12491: 24.2.50; `Info-insert-dir' should be able to not show msgs
2012-09-22 22:42 bug#12491: 24.2.50; `Info-insert-dir' should be able to not show msgs Drew Adams
@ 2012-09-22 22:52 ` Drew Adams
2012-09-22 23:50 ` Juri Linkov
1 sibling, 0 replies; 8+ messages in thread
From: Drew Adams @ 2012-09-22 22:52 UTC (permalink / raw)
To: 12491
Example: code that inserts the directory into a temp buffer
to do something with it. E.g.:
(Info-mode)
(info-initialize)
(Info-find-node-2 "dir" "top" t)
That invokes
(Info-virtual-call Info-directory-find-node "dir" "Top" t)
which invokes (Info-directory-find-node "dir" "Top" t)
which invokes (Info-insert-dir), which displays the message.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#12491: 24.2.50; `Info-insert-dir' should be able to not show msgs
2012-09-22 22:42 bug#12491: 24.2.50; `Info-insert-dir' should be able to not show msgs Drew Adams
2012-09-22 22:52 ` Drew Adams
@ 2012-09-22 23:50 ` Juri Linkov
2012-09-23 2:25 ` Drew Adams
` (2 more replies)
1 sibling, 3 replies; 8+ messages in thread
From: Juri Linkov @ 2012-09-22 23:50 UTC (permalink / raw)
To: Drew Adams; +Cc: 12491
> `Info-insert-dir' is not an interactive function. It can be called by
> any Lisp code that wants to insert an Info directory. Please provide an
> optional MSG arg (or a NOMSG) arg, so that calling code can optionally
> not show the message "Composing main Info directory...done".
There are many other messages that you might not want to see.
Better than adding a new arg for all of them, maybe callers
should let-bind a variable like `messages-buffer-max-lines' to nil
that will avoid showing the message.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#12491: 24.2.50; `Info-insert-dir' should be able to not show msgs
2012-09-22 23:50 ` Juri Linkov
@ 2012-09-23 2:25 ` Drew Adams
2016-04-28 15:49 ` bug#11851: " Lars Ingebrigtsen
[not found] ` <<87lh3xag2k.fsf@gnus.org>
2 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2012-09-23 2:25 UTC (permalink / raw)
To: 'Juri Linkov'; +Cc: 12491
> > `Info-insert-dir' is not an interactive function. It can
> > be called by any Lisp code that wants to insert an Info
> > directory. Please provide an optional MSG arg (or a NOMSG)
> > arg, so that calling code can optionally not show the
> > message "Composing main Info directory...done".
>
> There are many other messages that you might not want to see.
> Better than adding a new arg for all of them, maybe callers
> should let-bind a variable like `messages-buffer-max-lines' to nil
> that will avoid showing the message.
Thank works too, I suppose.
But I think that as a general rule it is better for a function that can interact
with the user (e.g. display a message) to also provide reasonably for use
without such interaction, assuming such a use makes sense for it.
If there are "many other" such messages, are there also many other such
functions displaying them? Perhaps they are all defective in this regard.
Better to set good examples than proliferate bad ones. I don't know whether the
functions you have in mind are in fact candidates for becoming better citizens.
But if they are, cleaning them up is the right approach.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#11851: bug#12491: 24.2.50; `Info-insert-dir' should be able to not show msgs
2012-09-22 23:50 ` Juri Linkov
2012-09-23 2:25 ` Drew Adams
@ 2016-04-28 15:49 ` Lars Ingebrigtsen
2016-04-28 16:05 ` Drew Adams
[not found] ` <<87lh3xag2k.fsf@gnus.org>
2 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-28 15:49 UTC (permalink / raw)
To: Juri Linkov; +Cc: 12491, 11851
Juri Linkov <juri@jurta.org> writes:
>> `Info-insert-dir' is not an interactive function. It can be called by
>> any Lisp code that wants to insert an Info directory. Please provide an
>> optional MSG arg (or a NOMSG) arg, so that calling code can optionally
>> not show the message "Composing main Info directory...done".
>
> There are many other messages that you might not want to see.
> Better than adding a new arg for all of them, maybe callers
> should let-bind a variable like `messages-buffer-max-lines' to nil
> that will avoid showing the message.
As Eli pointed out, there's now `inhibit-message'. Closing.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#12491: 24.2.50; `Info-insert-dir' should be able to not show msgs
2016-04-28 15:49 ` bug#11851: " Lars Ingebrigtsen
@ 2016-04-28 16:05 ` Drew Adams
2016-04-28 19:03 ` bug#11851: " Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2016-04-28 16:05 UTC (permalink / raw)
To: Lars Ingebrigtsen, Juri Linkov; +Cc: 12491, 11851
> As Eli pointed out, there's now `inhibit-message'. Closing.
That is not the Emacs way. It is not what is recommended
in the manual. See (elisp) `Distinguish Interactive'.
--
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". But
you can also do the job by testing 'called-interactively-p'.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#11851: bug#12491: 24.2.50; `Info-insert-dir' should be able to not show msgs
2016-04-28 16:05 ` Drew Adams
@ 2016-04-28 19:03 ` Eli Zaretskii
0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2016-04-28 19:03 UTC (permalink / raw)
To: Drew Adams; +Cc: larsi, 11851, 12491
> Date: Thu, 28 Apr 2016 09:05:02 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> Cc: 12491@debbugs.gnu.org, 11851@debbugs.gnu.org
>
> > As Eli pointed out, there's now `inhibit-message'. Closing.
>
> That is not the Emacs way.
It's in Emacs, so we clearly disagree with you.
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <<87lh3xag2k.fsf@gnus.org>]
end of thread, other threads:[~2016-04-29 0:41 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-22 22:42 bug#12491: 24.2.50; `Info-insert-dir' should be able to not show msgs Drew Adams
2012-09-22 22:52 ` Drew Adams
2012-09-22 23:50 ` Juri Linkov
2012-09-23 2:25 ` Drew Adams
2016-04-28 15:49 ` bug#11851: " Lars Ingebrigtsen
2016-04-28 16:05 ` Drew Adams
2016-04-28 19:03 ` bug#11851: " Eli Zaretskii
[not found] ` <<87lh3xag2k.fsf@gnus.org>
[not found] ` <<0d98644c-d3a0-4e38-b054-c401eb3131f5@default>
[not found] ` <<8337q5y2rd.fsf@gnu.org>
2016-04-29 0:41 ` Drew Adams
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.