From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#864: 23.0.60; Info-dir-remove-duplicates fails to remove duplicates Date: Wed, 03 Sep 2008 08:43:34 +0200 Message-ID: <48BE3216.6020304@gmx.at> References: <48BD5B1B.3020409@george24.com> Reply-To: martin rudalics , 864@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080504060803020008000501" X-Trace: ger.gmane.org 1220425692 2694 80.91.229.12 (3 Sep 2008 07:08:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Sep 2008 07:08:12 +0000 (UTC) To: "Joshua S." , 864@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 03 09:09:06 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KamUA-0001nK-9B for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Sep 2008 09:09:02 +0200 Original-Received: from localhost ([127.0.0.1]:32858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KamTB-0000Gh-4a for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Sep 2008 03:08:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KamSm-0008S1-O8 for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2008 03:07:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KamSk-0008Q4-Rj for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2008 03:07:35 -0400 Original-Received: from [199.232.76.173] (port=55395 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KamSk-0008Pl-AG for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2008 03:07:34 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:56649) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KamSj-0004G7-KE for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2008 03:07:33 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KamSi-0001bb-Ms for bug-gnu-emacs@gnu.org; Wed, 03 Sep 2008 03:07:33 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8377U6W011785; Wed, 3 Sep 2008 00:07:31 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m836t4QV006229; Tue, 2 Sep 2008 23:55:04 -0700 X-Loop: don@donarmstrong.com Resent-From: martin rudalics Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 03 Sep 2008 06:55:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 864 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 864-submit@emacsbugs.donarmstrong.com id=B864.12204245034166 (code B ref 864); Wed, 03 Sep 2008 06:55:04 +0000 Original-Received: (at 864) by emacsbugs.donarmstrong.com; 3 Sep 2008 06:48:23 +0000 Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m836mIH1004082 for <864@emacsbugs.donarmstrong.com>; Tue, 2 Sep 2008 23:48:20 -0700 Original-Received: (qmail invoked by alias); 03 Sep 2008 06:48:12 -0000 Original-Received: from 62-47-60-155.adsl.highway.telekom.at (EHLO [62.47.60.155]) [62.47.60.155] by mail.gmx.net (mp067) with SMTP; 03 Sep 2008 08:48:12 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+O/7lJ+6WOvyflzXx4M0j7dsEydbN71Io5UXb5Jr 8Hf2CjVUOE2Vw8 User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: <48BD5B1B.3020409@george24.com> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.63,0.61 X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 3) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Resent-Date: Wed, 03 Sep 2008 03:07:35 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:20079 Archived-At: This is a multi-part message in MIME format. --------------080504060803020008000501 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > I did bellow patch to fix this. (You know, I am not a good Lisp > programmer.) > > Index: lisp/info.el > =================================================================== > RCS file: /sources/emacs/emacs/lisp/info.el,v > retrieving revision 1.541 > diff -u -d -w -r1.541 info.el > --- lisp/info.el 30 Aug 2008 20:16:36 -0000 1.541 > +++ lisp/info.el 2 Sep 2008 15:05:54 -0000 > @@ -1222,9 +1222,10 @@ > ;; Fold case straight away; `member-ignore-case' here wasteful. > (let ((x (downcase (match-string 1)))) > (if (member x seen) > - (delete-region (match-beginning 0) > + (progn (delete-region (match-beginning 0) > (progn (re-search-forward "^[^ \t]" nil t) > (match-beginning 0))) > + (forward-line 0)) > (push x seen)))))))))) > > ;; Note that on entry to this function the current-buffer must be the Looks good to me. However, could you try the attached patch instead which also does away with the quite obscure "limit" thing. martin --------------080504060803020008000501 Content-Type: text/plain; name="864.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="864.diff" *** info.el.~1.541.~ 2008-08-31 09:48:43.390625000 +0200 --- info.el 2008-09-03 08:33:07.734375000 +0200 *************** *** 1213,1231 **** (delete-region (1- (point)) (point)))) ;; Now remove duplicate entries under the same heading. ! (let ((seen nil) ! (limit (point-marker))) ! (goto-char start) ! (while (and (> limit (point)) ! (re-search-forward "^* \\([^:\n]+:\\(:\\|[^.\n]+\\).\\)" ! limit 'move)) ! ;; Fold case straight away; `member-ignore-case' here wasteful. ! (let ((x (downcase (match-string 1)))) ! (if (member x seen) ! (delete-region (match-beginning 0) ! (progn (re-search-forward "^[^ \t]" nil t) ! (match-beginning 0))) ! (push x seen)))))))))) ;; Note that on entry to this function the current-buffer must be the ;; *info* buffer; not the info tags buffer. --- 1213,1232 ---- (delete-region (1- (point)) (point)))) ;; Now remove duplicate entries under the same heading. ! (let (seen) ! (save-restriction ! (narrow-to-region start (point)) ! (goto-char (point-min)) ! (while (re-search-forward "^* \\([^:\n]+:\\(:\\|[^.\n]+\\).\\)" nil 'move) ! ;; Fold case straight away; `member-ignore-case' here wasteful. ! (let ((x (downcase (match-string 1)))) ! (if (member x seen) ! (delete-region ! (match-beginning 0) ! (if (re-search-forward "^[^ \t]" nil 'move) ! (goto-char (match-beginning 0)) ! (point-max))) ! (push x seen))))))))))) ;; Note that on entry to this function the current-buffer must be the ;; *info* buffer; not the info tags buffer. --------------080504060803020008000501--