From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Suspicious code in gnus-read-descriptions-file Date: Tue, 22 Mar 2005 23:28:23 +0100 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1111531310 24565 80.91.229.2 (22 Mar 2005 22:41:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Mar 2005 22:41:50 +0000 (UTC) Cc: emacs-devel@gnu.org, Stefan Monnier , bugs@gnus.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 22 23:41:48 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DDs32-00026S-SD for ged-emacs-devel@m.gmane.org; Tue, 22 Mar 2005 23:40:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DDsKQ-0004uk-8t for ged-emacs-devel@m.gmane.org; Tue, 22 Mar 2005 17:58:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DDsCJ-0001Xf-KV for emacs-devel@gnu.org; Tue, 22 Mar 2005 17:50:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DDsCA-0001Tj-Fh for emacs-devel@gnu.org; Tue, 22 Mar 2005 17:49:55 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DDsC9-0001Kq-NM for emacs-devel@gnu.org; Tue, 22 Mar 2005 17:49:53 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DDrrN-0006Sr-5S for emacs-devel@gnu.org; Tue, 22 Mar 2005 17:28:25 -0500 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1DDrrM-0003ND-L6; Tue, 22 Mar 2005 17:28:24 -0500 Original-To: Simon Josefsson In-Reply-To: (Simon Josefsson's message of "Tue, 22 Mar 2005 22:53:49 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:35001 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35001 Simon Josefsson writes: > Stefan Monnier 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