From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.devel Subject: Re: Suspicious code in gnus-read-descriptions-file Date: Tue, 22 Mar 2005 22:53:49 +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 1111528806 16674 80.91.229.2 (22 Mar 2005 22:00:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Mar 2005 22:00:06 +0000 (UTC) Cc: bugs@gnus.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 22 23:00:05 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DDrK4-00042n-Ku for ged-emacs-devel@m.gmane.org; Tue, 22 Mar 2005 22:54:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DDrbR-0003Jt-HN for ged-emacs-devel@m.gmane.org; Tue, 22 Mar 2005 17:11:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DDrZw-00022d-Po for emacs-devel@gnu.org; Tue, 22 Mar 2005 17:10:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DDrZp-0001wv-Rl for emacs-devel@gnu.org; Tue, 22 Mar 2005 17:10:22 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DDrZn-0001tL-6d for emacs-devel@gnu.org; Tue, 22 Mar 2005 17:10:15 -0500 Original-Received: from [217.13.230.178] (helo=yxa.extundo.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1DDrJy-0003sP-3O for emacs-devel@gnu.org; Tue, 22 Mar 2005 16:53:54 -0500 Original-Received: from latte.josefsson.org (c494102a.s-bi.bostream.se [217.215.27.65]) (authenticated bits=0) by yxa.extundo.com (8.13.3/8.13.3/Debian-6) with ESMTP id j2MLrkPm012504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Mar 2005 22:53:47 +0100 Original-To: Stefan Monnier OpenPGP: id=B565716F; url=http://josefsson.org/key.txt Blog: http://www.livejournal.com/users/jas4711/ X-Hashcash: 1:21:050322:bugs@gnus.org::RxmWxK86zkfcoMQv:0jXX X-Hashcash: 1:21:050322:emacs-devel@gnu.org::TAk8makmTbRRvzkZ:8Vsa X-Hashcash: 1:21:050322:monnier@iro.umontreal.ca::jlQFi/WqFRxGK7O2:5d8N In-Reply-To: (Stefan Monnier's message of "Tue, 22 Mar 2005 13:51:59 -0500") User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on yxa.extundo.com X-Virus-Status: Clean 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:34999 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34999 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? FWIW, looks good to me.