unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13159: 24.3.50; `find-file-noselect' should not display or log messages
@ 2012-12-12 18:46 Drew Adams
  2012-12-12 23:16 ` Juri Linkov
  2012-12-13 17:27 ` Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Drew Adams @ 2012-12-12 18:46 UTC (permalink / raw)
  To: 13159

I'm using `find-file-noselect', and I see this in *Messages*:
 
 Note: file is write protected
 
First, that is not helpful at all, without saying WHICH file is
write-protected.
 
More importantly, why does it make sense to display or record
such a message when the file is not visited interactively?
 
This message comes from `after-find-file'.  And there are umpteen
additional such messages issued from this function.  The call to
`after-find-file' is in `find-file-noselect-1'.
 
I see that this is nothing new - it is the case even in Emacs 20.
Nevertheless, I do not understand why `find-file-noselect' would issue
messages.
 
If you decide to keep this behavior, please consider adding the file
name to such a message.  At least that way, a user can learn something
from the *Messages* log.
 
In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2012-12-07 on MS-W7-DANI
Bzr revision: 111150 eggert@cs.ucla.edu-20121207175317-wxhrqxpp0173whq0
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -Ic:/emacs/libs/libXpm-3.5.10/include -Ic:/emacs/libs/libXpm-3.5.10/src
 -Ic:/emacs/libs/libpng-1.2.37-lib/include -Ic:/emacs/libs/zlib-1.2.5
 -Ic:/emacs/libs/giflib-4.1.4-1-lib/include
 -Ic:/emacs/libs/jpeg-6b-4-lib/include
 -Ic:/emacs/libs/tiff-3.8.2-1-lib/include
 -Ic:/emacs/libs/libxml2-2.7.8-w32-bin/include/libxml2
 -Ic:/emacs/libs/gnutls-3.0.9-w32-bin/include
 -Ic:/emacs/libs/libiconv-1.9.2-1-lib/include'
 






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13159: 24.3.50; `find-file-noselect' should not display or log messages
  2012-12-12 18:46 bug#13159: 24.3.50; `find-file-noselect' should not display or log messages Drew Adams
@ 2012-12-12 23:16 ` Juri Linkov
  2012-12-12 23:31   ` Drew Adams
  2012-12-13 17:27 ` Eli Zaretskii
  1 sibling, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2012-12-12 23:16 UTC (permalink / raw)
  To: Drew Adams; +Cc: 13159

> And there are umpteen additional such messages issued from this function.

There are umpteen messages issued from umpteen functions,
all without a buffer's file name or other additional information.
For example:

Auto-saving...done
Mark set
Follow the link [2 times]
Type "q" to restore previous buffer.
mouse-2, RET: find function's definition
Mark saved where search started
Entering debugger...
Back to top level.
Commands: d, x; RET; q to quit; ? for help.
Making completion list...
Quit
Note: file is write protected
Using vacuous schema

Do you want to fix all of them too?





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13159: 24.3.50; `find-file-noselect' should not display or log messages
  2012-12-12 23:16 ` Juri Linkov
@ 2012-12-12 23:31   ` Drew Adams
  0 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2012-12-12 23:31 UTC (permalink / raw)
  To: 'Juri Linkov'; +Cc: 13159

> > And there are umpteen additional such messages issued from 
> > this function.
> 
> There are umpteen messages issued from umpteen functions,
> all without a buffer's file name or other additional information.
> For example:
> 
> Auto-saving...done
> Mark set
> Follow the link [2 times]
> Type "q" to restore previous buffer.
> mouse-2, RET: find function's definition
> Mark saved where search started
> Entering debugger...
> Back to top level.
> Commands: d, x; RET; q to quit; ? for help.
> Making completion list...
> Quit
> Note: file is write protected
> Using vacuous schema
> 
> Do you want to fix all of them too?

Without looking at the details, it sounds like all of them should be fixed.

But this report is only about fixing messages wrt `find-file-noselect'.

Do you disagree that it makes little sense to display messages when
`find-file-noselect' is called from a non-interactive function?  And that it is
not too helpful to find a message in *Messages* telling you only that some
(unnamed) file (perhaps in a dolist that handles 12358 files) was
write-protected?

The priority of fixing bugs is for Emacs Dev to decide.  And this one has been
around a very long time, so it is probably not the most important.  But in any
case, it is a bug, no?






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13159: 24.3.50; `find-file-noselect' should not display or log messages
  2012-12-12 18:46 bug#13159: 24.3.50; `find-file-noselect' should not display or log messages Drew Adams
  2012-12-12 23:16 ` Juri Linkov
@ 2012-12-13 17:27 ` Eli Zaretskii
  2012-12-13 17:46   ` Drew Adams
  1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2012-12-13 17:27 UTC (permalink / raw)
  To: Drew Adams; +Cc: 13159

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Wed, 12 Dec 2012 10:46:07 -0800
> 
> I'm using `find-file-noselect', and I see this in *Messages*:
>  
>  Note: file is write protected
>  
> First, that is not helpful at all, without saying WHICH file is
> write-protected.
>  
> More importantly, why does it make sense to display or record
> such a message when the file is not visited interactively?

If you invoke this function non-interactively, pass it a non-nil value
as the 2nd argument.  That should shut up any messages from this
function or the subroutines it calls.  E.g.:

  (find-file-noselect "/foo/bar/nonexistent-file" t)

    => #<buffer nonexistent-file>

and no messages.

Does this solve your problem?





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13159: 24.3.50; `find-file-noselect' should not display or log messages
  2012-12-13 17:27 ` Eli Zaretskii
@ 2012-12-13 17:46   ` Drew Adams
  2012-12-13 18:08     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2012-12-13 17:46 UTC (permalink / raw)
  To: 'Eli Zaretskii'; +Cc: 13159

> If you invoke this function non-interactively, pass it a non-nil value
> as the 2nd argument.  That should shut up any messages from this
> function or the subroutines it calls....
> Does this solve your problem?

Good point, Eli.  And I do use that arg in many places.

I guess the problem here is that I do want actual warnings to be printed (to
*Messages*), but:

1. "Note: File is write-protected" is NOT a warning - it's just some extra
information - note the "Note:".

2. Such information about a particular file is anyway useless in a messages log
if it does not include the file name.

IOW, in this case, I would want warnings to be logged, and I would want them to
indicate the files that had problems.  I don't need to log extra informational
notices, and I don't need to log even warnings that do not help users because
they don't mention the problematic file.

So thanks for pointing that out, but I think the proper fix here is to:

a. not have parameter NOWARN treat non-warning messages the same as warnings
and,

b. especially, add the file name to all file-specific messages, including
warnings.

Does that make sense?






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#13159: 24.3.50; `find-file-noselect' should not display or log messages
  2012-12-13 17:46   ` Drew Adams
@ 2012-12-13 18:08     ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2012-12-13 18:08 UTC (permalink / raw)
  To: Drew Adams; +Cc: 13159

> From: "Drew Adams" <drew.adams@oracle.com>
> Cc: <13159@debbugs.gnu.org>
> Date: Thu, 13 Dec 2012 09:46:18 -0800
> 
> a. not have parameter NOWARN treat non-warning messages the same as warnings
> and,
> 
> b. especially, add the file name to all file-specific messages, including
> warnings.
> 
> Does that make sense?

Could be some additional value of NOWARN, perhaps.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-12-13 18:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-12 18:46 bug#13159: 24.3.50; `find-file-noselect' should not display or log messages Drew Adams
2012-12-12 23:16 ` Juri Linkov
2012-12-12 23:31   ` Drew Adams
2012-12-13 17:27 ` Eli Zaretskii
2012-12-13 17:46   ` Drew Adams
2012-12-13 18:08     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).