unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: New mail-related routines
Date: Mon, 18 Oct 2004 18:12:51 -0400	[thread overview]
Message-ID: <jwv1xfvk7cm.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <200410182157.i9ILvjln000739@oak.pohoyda.family> (Alexander Pohoyda's message of "Mon, 18 Oct 2004 23:57:45 +0200 (CEST)")

> +  (let ((from (or from (point-min)))
> +	(to (or to (point-max))))

I'd recommend

  (unless from (setq from (point-min)))
  (unless to (setq to (point-max)))

it saves a bit of indentation and is marginally more efficient.

> +	(if (or (search-forward (concat "\n" mail-header-separator "\n") to t)
> +		(search-forward "\n\n" to t))

This is less robust than what rfc822-goto-eoh uses, in the case where the
mail-header-separator is modified.

> +	    (point)
> +	  ;; TODO: Shouldn't we return nil instead?
> +	  (message "This entity has no body")
> +	  to)))))

I'd argue we should return `to' because the whole thing is the header.


        Stefan

  reply	other threads:[~2004-10-18 22:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-18 21:57 New mail-related routines Alexander Pohoyda
2004-10-18 22:12 ` Stefan Monnier [this message]
2004-10-19  7:06   ` Alexander Pohoyda
2004-10-19 12:51     ` Stefan Monnier
2004-10-19 18:37     ` Alexander Pohoyda
2004-10-19 19:29       ` Stefan Monnier
2004-10-19 23:56         ` Alexander Pohoyda
2004-10-19 12:32 ` Reiner Steib
2004-10-19 17:47   ` Alexander Pohoyda
2004-10-19 20:02     ` Reiner Steib
2004-10-20  0:03       ` Alexander Pohoyda
2004-10-24 12:03 ` Simon Josefsson
2004-10-25 22:15   ` Alexander Pohoyda
2004-10-25 22:43   ` Alexander Pohoyda
2004-10-26 23:16     ` Kevin Rodgers
2004-10-27 16:04       ` Alexander Pohoyda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv1xfvk7cm.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).