changeset 69415:bbbd0ad05f29

(Info-dir-remove-duplicates): Move point to the beginning of the current line after deleting the entries from redundant heading. Use marker for `limit' and compare it with point before calling `re-search-forward'.
author Juri Linkov <juri@jurta.org>
date Sat, 11 Mar 2006 22:35:18 +0000
parents a159957988d5
children 38c03f756ca9
files lisp/info.el
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/info.el	Sat Mar 11 22:34:46 2006 +0000
+++ b/lisp/info.el	Sat Mar 11 22:35:18 2006 +0000
@@ -1196,7 +1196,9 @@
 		  (point)
 		  (if (re-search-forward "^[^* \n\t]" nil t)
 		      (match-beginning 0)
-		    (or limit (point-max)))) entries))))
+		    (or limit (point-max))))
+		 entries)
+		(forward-line 0))))
 	  ;; Insert the entries just found.
 	  (while (= (line-beginning-position 0) (1- (point)))
 	    (backward-char))
@@ -1207,10 +1209,11 @@
 
 	  ;; Now remove duplicate entries under the same heading.
 	  (let ((seen nil)
-		(limit (point)))
+		(limit (point-marker)))
 	    (goto-char start)
-	    (while (re-search-forward "^* \\([^:\n]+:\\(:\\|[^.\n]+\\).\\)"
-				      limit 'move)
+	    (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)