unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* defun with find-file does not run from Gnus buffers
@ 2004-06-24 13:51 Albert Reiner
  2004-06-24 14:22 ` Johan Bockgård
  0 siblings, 1 reply; 3+ messages in thread
From: Albert Reiner @ 2004-06-24 13:51 UTC (permalink / raw)


Hi,

I wanted to have a shortcut for opening a specific file, so I wrote
the following function:

    (defun willehalm-note ()
       (interactive "*")
       (find-file "~/.once-to-willehalm/note"))

This works well from most buffers I use; however, when I do M-x
willehalm-note in a Gnus (*Group*, *Summary ...*, *Article*) buffer, I
get a message about the buffer being read-only:

,----
| Buffer is read-only: #<buffer *Summary nntp+news.gnus.org:gnu.emacs.help*>
`----

While this is true, I don't quite see why that should matter as
willehalm-note shouldn't write anything to any buffer.

I hope someone will point me to the reason underlying this behavior,
and to a cure for my defun.  (I suppose a keyboard macro would not
have that problem, but I'll probably learn more about elisp that way.)

TIA,

Albert.

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

* Re: defun with find-file does not run from Gnus buffers
  2004-06-24 13:51 defun with find-file does not run from Gnus buffers Albert Reiner
@ 2004-06-24 14:22 ` Johan Bockgård
  2004-06-24 14:37   ` Albert Reiner
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Bockgård @ 2004-06-24 14:22 UTC (permalink / raw)


Albert Reiner <areiner@tph.tuwien.ac.at> writes:

> I wanted to have a shortcut for opening a specific file, so I wrote
> the following function:
>
>     (defun willehalm-note ()
>        (interactive "*")
                       ^
C-h f interactive RET

   [...]
   In addition, if the string begins with `*' then an error is
   signaled if the buffer is read-only. This happens before reading
   any arguments.

-- 
Johan Bockgård

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

* Re: defun with find-file does not run from Gnus buffers
  2004-06-24 14:22 ` Johan Bockgård
@ 2004-06-24 14:37   ` Albert Reiner
  0 siblings, 0 replies; 3+ messages in thread
From: Albert Reiner @ 2004-06-24 14:37 UTC (permalink / raw)


bojohan+news@dd.chalmers.se (Johan Bockgård) writes:
> >     (defun willehalm-note ()
> >        (interactive "*")
>                        ^
> C-h f interactive RET
> 
>    [...]
>    In addition, if the string begins with `*' then an error is
>    signaled if the buffer is read-only. This happens before reading
>    any arguments.

Thanks a lot!  Now I only wonder why I put that "*" in there in the
first place - I had read the elisp manual.

Albert.

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

end of thread, other threads:[~2004-06-24 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-24 13:51 defun with find-file does not run from Gnus buffers Albert Reiner
2004-06-24 14:22 ` Johan Bockgård
2004-06-24 14:37   ` Albert Reiner

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).