unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to move point to the end of the message body?
@ 2015-12-19 17:49 Marcin Borkowski
  2015-12-20  8:50 ` Emanuel Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Borkowski @ 2015-12-19 17:49 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi list,

I'd like to get to the end of the message body (in message-mode).  This
seems to work, but I'm looking for making it better (both in terms of
style and robustness: does my check for attachments work in all
circumstances?  Should I check for anything more?).

Note: you should insert a hash before "part" below (funnily, I could
send this email with that hash - Emacs thought it's an incomplete
attachment!).

--8<---------------cut here---------------start------------->8---
(defun mbork/message-goto-end-body ()
  "Go to end of message body (before signature and attachments)."
  (let (before-attachments)
    (setq before-attachments (goto-char (point-max)))
    (while (and (search-backward "<part " nil t)
		(eq (get-text-property (point) 'face)
		    'message-mml))
      (setq before-attachments (point)))
    (goto-char before-attachments)
    (re-search-backward message-signature-separator nil t)))
--8<---------------cut here---------------end--------------->8---

TIA,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



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

* Re: How to move point to the end of the message body?
  2015-12-19 17:49 How to move point to the end of the message body? Marcin Borkowski
@ 2015-12-20  8:50 ` Emanuel Berg
  2015-12-20 10:50   ` Marcin Borkowski
  0 siblings, 1 reply; 3+ messages in thread
From: Emanuel Berg @ 2015-12-20  8:50 UTC (permalink / raw)
  To: help-gnu-emacs

Marcin Borkowski <mbork@mbork.pl> writes:

> Hi list,

Hello Marcin. How nice to see you in the 5,000 block.

> I'd like to get to the end of the message body (in
> message-mode). This seems to work, but I'm looking
> for making it better (both in terms of style and
> robustness: does my check for attachments work in
> all circumstances? Should I check for anything
> more?).

I don't know, but I do have a package for moving
ultra-fast between the parts of a message mode buffer.

The cool thing is it works with the .mailrc abbrev
file as well!

It is called moggle and I wrote it, including the
documentation, way back (?) in 2014. I revised the
documentation just a bit today. When you are happy
with your code, post it here and I'll include it in
the package!

    http://user.it.uu.se/~embe8573/conf/emacs-init/gnus/moggle.el

-- 
underground experts united
http://user.it.uu.se/~embe8573




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

* Re: How to move point to the end of the message body?
  2015-12-20  8:50 ` Emanuel Berg
@ 2015-12-20 10:50   ` Marcin Borkowski
  0 siblings, 0 replies; 3+ messages in thread
From: Marcin Borkowski @ 2015-12-20 10:50 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs



On 2015-12-20, at 09:50, Emanuel Berg <embe8573@student.uu.se> wrote:

> Marcin Borkowski <mbork@mbork.pl> writes:
>
>> Hi list,
>
> Hello Marcin. How nice to see you in the 5,000 block.

And what is that...?

>> I'd like to get to the end of the message body (in
>> message-mode). This seems to work, but I'm looking
>> for making it better (both in terms of style and
>> robustness: does my check for attachments work in
>> all circumstances? Should I check for anything
>> more?).
>
> I don't know, but I do have a package for moving
> ultra-fast between the parts of a message mode buffer.
>
> The cool thing is it works with the .mailrc abbrev
> file as well!
>
> It is called moggle and I wrote it, including the
> documentation, way back (?) in 2014. I revised the
> documentation just a bit today. When you are happy
> with your code, post it here and I'll include it in
> the package!
>
>     http://user.it.uu.se/~embe8573/conf/emacs-init/gnus/moggle.el

Interesting, I'll take a look.  Of course, I will also share my code
(which, incidentally, does *a lot* more than moving across the message -
even though it's unfinished yet).  Maybe I'll put it on GitHub, but
probably not today.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



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

end of thread, other threads:[~2015-12-20 10:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-19 17:49 How to move point to the end of the message body? Marcin Borkowski
2015-12-20  8:50 ` Emanuel Berg
2015-12-20 10:50   ` Marcin Borkowski

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