unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Message mode and emacsclient
@ 2015-07-07 21:30 Ian Zimmerman
  2015-07-12  5:50 ` Ian Zimmerman
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Zimmerman @ 2015-07-07 21:30 UTC (permalink / raw)
  To: help-gnu-emacs

To read my mail these days I use mutt over a ssh connection to the mail
server.  On the mail server I always have an emacs --daemon running, and
I tell mutt to call emacsclient as the external editor when I need to
compose a message.  I use the predictable temporary filename pattern in
auto-mode-alist to put the client buffer into message-mode (more
precisely, gnus-article-edit-mode which inherits almost everything from
message-mode).

All this works almost perfectly, with one annoying nit.  Immediately
after I land in emacs with the temporary file loaded, if I try one of
the message keybindings to move to a header field (for instance, C-c C-f
C-s to move to the Subject: field), after the C-c C-f emacs barfs with
"C-c C-f is undefined".  But when I try the same key combination again,
it works!  And it also works if I do anything else in the buffer first,
such as C-g.  It is as if emacs was in some kind of temporary mode like
those modes used in the minibuffer and had to quit the temporary mode
first to allow normal editing.

Does this sound in the least bit familiar?  My hunch is that it may not
be specific to message-mode but may be a more generic buglet with
emacsclient and multilevel keymaps.

Oh and btw, GNU Emacs 23.4 .. I know, I know ..

-- 
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.




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

* Re: Message mode and emacsclient
  2015-07-07 21:30 Message mode and emacsclient Ian Zimmerman
@ 2015-07-12  5:50 ` Ian Zimmerman
  2015-07-19  1:52   ` Ian Zimmerman
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Zimmerman @ 2015-07-12  5:50 UTC (permalink / raw)
  To: help-gnu-emacs

On 2015-07-07 14:30 -0700, Ian Zimmerman wrote:

> To read my mail these days I use mutt over a ssh connection to the mail
> server.  On the mail server I always have an emacs --daemon running, and
> I tell mutt to call emacsclient as the external editor when I need to
> compose a message.  I use the predictable temporary filename pattern in
> auto-mode-alist to put the client buffer into message-mode (more
> precisely, gnus-article-edit-mode which inherits almost everything from
> message-mode).
> 
> All this works almost perfectly, with one annoying nit.  Immediately
> after I land in emacs with the temporary file loaded, if I try one of
> the message keybindings to move to a header field (for instance, C-c C-f
> C-s to move to the Subject: field), after the C-c C-f emacs barfs with
> "C-c C-f is undefined".  But when I try the same key combination again,
> it works!  And it also works if I do anything else in the buffer first,
> such as C-g.  It is as if emacs was in some kind of temporary mode like
> those modes used in the minibuffer and had to quit the temporary mode
> first to allow normal editing.
> 
> Does this sound in the least bit familiar?  My hunch is that it may not
> be specific to message-mode but may be a more generic buglet with
> emacsclient and multilevel keymaps.

I have now tried to do this with pure message-mode, just to be sure the
few additional goodies gnus-article-edit-mode strings on aren't to
blame.  The problem stays the same.

There seems to be some kind of timeout.  What I mean is, after this
happens, I force it to behave, I compose my message and send it off, if
I go compose another message within a minute or so, it works fine from
the start.  But if I wait longer, it happens again.

I am stumped.  Anyone?

-- 
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.




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

* Re: Message mode and emacsclient
  2015-07-12  5:50 ` Ian Zimmerman
@ 2015-07-19  1:52   ` Ian Zimmerman
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Zimmerman @ 2015-07-19  1:52 UTC (permalink / raw)
  To: help-gnu-emacs

On 2015-07-11 22:50 -0700, Ian Zimmerman wrote:

> On 2015-07-07 14:30 -0700, Ian Zimmerman wrote:
> 
> > To read my mail these days I use mutt over a ssh connection to the mail
> > server.  On the mail server I always have an emacs --daemon running, and
> > I tell mutt to call emacsclient as the external editor when I need to
> > compose a message.  I use the predictable temporary filename pattern in
> > auto-mode-alist to put the client buffer into message-mode (more
> > precisely, gnus-article-edit-mode which inherits almost everything from
> > message-mode).
> > 
> > All this works almost perfectly, with one annoying nit.  Immediately
> > after I land in emacs with the temporary file loaded, if I try one of
> > the message keybindings to move to a header field (for instance, C-c C-f
> > C-s to move to the Subject: field), after the C-c C-f emacs barfs with
> > "C-c C-f is undefined".  But when I try the same key combination again,
> > it works!  And it also works if I do anything else in the buffer first,
> > such as C-g.  It is as if emacs was in some kind of temporary mode like
> > those modes used in the minibuffer and had to quit the temporary mode
> > first to allow normal editing.
> > 
> > Does this sound in the least bit familiar?  My hunch is that it may not
> > be specific to message-mode but may be a more generic buglet with
> > emacsclient and multilevel keymaps.
> 
> I have now tried to do this with pure message-mode, just to be sure the
> few additional goodies gnus-article-edit-mode strings on aren't to
> blame.  The problem stays the same.
> 
> There seems to be some kind of timeout.  What I mean is, after this
> happens, I force it to behave, I compose my message and send it off, if
> I go compose another message within a minute or so, it works fine from
> the start.  But if I wait longer, it happens again.
> 
> I am stumped.  Anyone?

For what it is worth, this is the workaround I have settled on, ugly as
sin (tested and "works"):

(add-hook 'message-mode-hook
  (lambda ()
    (setq unread-command-events
        (append (listify-key-sequence "\C-g") unread-command-events)))
  'append)

-- 
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.




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

end of thread, other threads:[~2015-07-19  1:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-07 21:30 Message mode and emacsclient Ian Zimmerman
2015-07-12  5:50 ` Ian Zimmerman
2015-07-19  1:52   ` Ian Zimmerman

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