GNU bug report logs -
#17281
24.4.50; emacs hangs in next-line
Previous Next
Reported by: "Stefan-W. Hahn" <stefan.hahn <at> s-hahn.de>
Date: Thu, 17 Apr 2014 06:12:02 UTC
Severity: normal
Found in version 24.4.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #29 received at 17281 <at> debbugs.gnu.org (full text, mbox):
> Date: Thu, 17 Apr 2014 13:00:47 +0200
> From: "Stefan-W. Hahn" <stefan.hahn <at> s-hahn.de>
> Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 17281 <at> debbugs.gnu.org
>
> Mail von Eli Zaretskii, Thu, 17 Apr 2014 at 13:16:52 +0300:
> > Btw, just FYI, this code:
> >
> > (defun test ()
> > (interactive)
> > (goto-char (point-min))
> > (save-match-data (re-search-forward "^$" nil t))
> > (next-line 1))
> >
> > doesn't do what you think. next-line does TRT for the selected
> > window, but in this case the mode function 'test' runs when the buffer
> > that visits the file is not yet displayed in any window, certainly not
> > in the selected one. You want to call forward-line instead.
>
> Thx.
>
> It's just an excerpt from
>
> ; $Id: post.el,v 1.10 2008/02/24 23:49:23 rreid Exp $
> ;; post.el --- Use (X?)Emacs(client) as an external editor for mail and news.
>
> #+BEGIN_SRC elisp
> (defun post-goto-body ()
> "Go to the beginning of the message body."
> (interactive)
> (goto-char (point-min))
> ;; If the message has header, slide downward.
> (and header-mode (save-match-data (re-search-forward "^$" nil t))
> (next-line 1))
> )
> #+END_SRC
If this function can be invoked when the message is not displayed in
the currently selected window, next-line will not work correctly,
because it assumes it's invoked in the selected window. (It will
still do a perfect job in many cases, though, as long as the selected
window doesn't use any fonts or faces that significantly change the
size of the current line.)
> Is there a better mode for writing emails (I use mutt calling emacs for
> that).
There are many ways of using Emacs for email, but that's tangential to
the issue at point.
Is the original problem solved by the patch I showed?
This bug report was last modified 11 years and 94 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.