unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>,
	bugs@gnus.org
Subject: Re: Suspicious code in gnus-read-descriptions-file
Date: Tue, 22 Mar 2005 23:28:23 +0100	[thread overview]
Message-ID: <x5k6nzpb7c.fsf@lola.goethe.zz> (raw)
In-Reply-To: <iluoedbjqj6.fsf@latte.josefsson.org> (Simon Josefsson's message of "Tue, 22 Mar 2005 22:53:49 +0100")

Simon Josefsson <jas@extundo.com> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> The code below looks very odd:
>>
>>         (save-excursion
>>           (save-restriction
>>             (set-buffer nntp-server-buffer)
>>             (goto-char (point-min))
>>             (when (or (search-forward "\n.\n" nil t)
>>                       (goto-char (point-max)))
>>               (beginning-of-line)
>>               (narrow-to-region (point-min) (point)))
>>
>> doing a set-buffer between the save-restriction and the narrow-to-region
>> seems like a bug.  How 'bout the patch below?  Which turns the set-buffer
>> into a with-current-buffer and moves it to before the save-excursion.
>> Maybe the save-excursion could be dropped altogether?

You mean, the save-restriction?

> FWIW, looks good to me.

Not to me.  Seems to restore the restriction in another boffer, not
nntp-server-buffer.

Even if this is for some weird reason what was intended, it should be
rearranged or well documented to stop people worrying about it.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2005-03-22 22:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-22 18:51 Suspicious code in gnus-read-descriptions-file Stefan Monnier
2005-03-22 21:53 ` Simon Josefsson
2005-03-22 22:28   ` David Kastrup [this message]
2005-03-22 23:17 ` Jesper Harder
2005-03-23 12:53   ` Stefan
2005-03-24 14:07     ` Jesper Harder

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=x5k6nzpb7c.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=bugs@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).