From xemacs-m  Sat Apr  5 12:50:10 1997
Received: from mecca.spd.louisville.edu (mecca.spd.louisville.edu [136.165.40.148])
	by xemacs.org (8.8.5/8.8.5) with SMTP id MAA20889
	for <xemacs-beta@xemacs.org>; Sat, 5 Apr 1997 12:50:09 -0600 (CST)
Received: (from tjchol01@localhost) by mecca.spd.louisville.edu (950413.SGI.8.6.12/8.6.12) id SAA27979; Sat, 5 Apr 1997 18:49:55 GMT
Date: Sat, 5 Apr 1997 18:49:55 GMT
Message-Id: <199704051849.SAA27979@mecca.spd.louisville.edu>
From: "Tomasz J. Cholewo" <tjchol01@mecca.spd.louisville.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: XEmacs-Beta Mailing List <xemacs-beta@xemacs.org>
Subject: [patch] 20.1b10: caps-disable-folding in Info-search; etags bug
X-Mailer: VM 6.22 under 20.1 XEmacs Lucid (beta10)

The following patch:

1.  Adds support for making searches case-sensitive in Info buffers when
    the search string contains capital letters.  It uses the
    with-caps-disable-folding macro which I moved from etags.el to
    isearch-mode.el.

2.  Fixes a bug in tags-query-replace which was failing when supplied
    with an optional argument.

Tom
===============
Sat Apr  5 13:18:05 1997  Tomasz J. Cholewo  <t.cholewo@ieee.org>

	* packages/etags.el (tags-query-replace): Fixed DELIMITED argument 
	bug.  `with-caps-disable-folding' moved to isearch-mode.el.

	* packages/info.el (Info-search): Use `with-caps-disable-folding'.


diff -urd xemacs-20.1-b10-orig/lisp/packages/etags.el xemacs-20.1-b10/lisp/packages/etags.el
--- xemacs-20.1-b10-orig/lisp/packages/etags.el	Thu Mar 27 21:28:52 1997
+++ xemacs-20.1-b10/lisp/packages/etags.el	Sat Apr  5 13:20:33 1997
@@ -817,17 +817,6 @@
 
 (require 'backquote)
 
-(defmacro with-caps-disable-folding (string &rest body) "\
-Eval BODY with `case-fold-search' let to nil if STRING contains
-uppercase letters and `search-caps-disable-folding' is t."
-  `(let ((case-fold-search
-          (if (and case-fold-search search-caps-disable-folding)
-              (isearch-no-upper-case-p ,string)
-            case-fold-search)))
-     ,@body))
-(put 'with-caps-disable-folding 'lisp-indent-function 1)
-(put 'with-caps-disable-folding 'edebug-form-spec '(form body))
-
 (defun find-tag-internal (tagname)
   (let ((next (null tagname))
 	(exact (or tags-always-exact (consp tagname)))
@@ -1225,7 +1214,8 @@
                               ;; to the beginning of it so perform-replace
                               ;; will see it.
                               (progn (goto-char (match-beginning 0)) t)))
-        tags-loop-operate (list 'perform-replace from to t t delimited))
+        tags-loop-operate (list 'perform-replace from to t t 
+                                (not (null delimited))))
    (tags-loop-continue (or file-list-form t)))
 
 ;; Miscellaneous
diff -urd xemacs-20.1-b10-orig/lisp/packages/info.el xemacs-20.1-b10/lisp/packages/info.el
--- xemacs-20.1-b10-orig/lisp/packages/info.el	Thu Mar 27 21:28:54 1997
+++ xemacs-20.1-b10/lisp/packages/info.el	Sat Apr  5 13:11:51 1997
@@ -288,6 +288,10 @@
 ;; Removed any pretense of ever referencing Info-directory since it
 ;; wasn't working anyhow.
 
+;; Modified 4/5/97 by Tomasz J. Cholewo:
+;;
+;; Modified Info-search to use with-caps-disable-folding
+
 ;; Code:
 
 (defvar Info-inhibit-toolbar nil
@@ -975,62 +979,63 @@
   (if (equal regexp "")
       (setq regexp Info-last-search)
     (setq Info-last-search regexp))
-  (let ((found ())
-	(onode Info-current-node)
-	(ofile Info-current-file)
-	(opoint (point))
-	(osubfile Info-current-subfile))
-    (save-excursion
-      (save-restriction
-	(widen)
-	(if (null Info-current-subfile)
-	    (progn (re-search-forward regexp) (setq found (point)))
-	  (condition-case nil
-	      (progn (re-search-forward regexp) (setq found (point)))
-	    (search-failed nil)))))
-    (if (not found) ;can only happen in subfile case -- else would have erred
-	(unwind-protect
-	    (let ((list ()))
-	      (set-buffer (marker-buffer Info-tag-table-marker))
-	      (goto-char (point-min))
-	      (search-forward "\n\^_\nIndirect:")
-	      (save-restriction
-		(narrow-to-region (point)
-				  (progn (search-forward "\n\^_")
-					 (1- (point))))
-		(goto-char (point-min))
-		(search-forward (concat "\n" osubfile ": "))
-		(beginning-of-line)
-		(while (not (eobp))
-		  (re-search-forward "\\(^.*\\): [0-9]+$")
-		  (goto-char (+ (match-end 1) 2))
-		  (setq list (cons (cons (read (current-buffer))
-					 (buffer-substring (match-beginning 1)
-							   (match-end 1)))
-				   list))
-		  (goto-char (1+ (match-end 0))))
-		(setq list (nreverse list)
-		      list (cdr list)))
-	      (while list
-		(message "Searching subfile %s..." (cdr (car list)))
-		(Info-read-subfile (car (car list)))
-		(setq list (cdr list))
-		(goto-char (point-min))
-		(if (re-search-forward regexp nil t)
-		    (setq found (point) list ())))
-	      (if found
-		  (message "")
-		(signal 'search-failed (list regexp))))
-	  (if (not found)
-	      (progn (Info-read-subfile opoint)
-		     (goto-char opoint)
-		     (Info-select-node)))))
-    (widen)
-    (goto-char found)
-    (Info-select-node)
-    (or (and (equal onode Info-current-node)
-	     (equal ofile Info-current-file))
-	(Info-history-add ofile onode opoint))))
+  (with-caps-disable-folding regexp
+    (let ((found ())
+          (onode Info-current-node)
+          (ofile Info-current-file)
+          (opoint (point))
+          (osubfile Info-current-subfile))
+      (save-excursion
+        (save-restriction
+          (widen)
+          (if (null Info-current-subfile)
+              (progn (re-search-forward regexp) (setq found (point)))
+            (condition-case nil
+                (progn (re-search-forward regexp) (setq found (point)))
+              (search-failed nil)))))
+      (if (not found)                   ;can only happen in subfile case -- else would have erred
+          (unwind-protect
+              (let ((list ()))
+                (set-buffer (marker-buffer Info-tag-table-marker))
+                (goto-char (point-min))
+                (search-forward "\n\^_\nIndirect:")
+                (save-restriction
+                  (narrow-to-region (point)
+                                    (progn (search-forward "\n\^_")
+                                           (1- (point))))
+                  (goto-char (point-min))
+                  (search-forward (concat "\n" osubfile ": "))
+                  (beginning-of-line)
+                  (while (not (eobp))
+                    (re-search-forward "\\(^.*\\): [0-9]+$")
+                    (goto-char (+ (match-end 1) 2))
+                    (setq list (cons (cons (read (current-buffer))
+                                           (buffer-substring (match-beginning 1)
+                                                             (match-end 1)))
+                                     list))
+                    (goto-char (1+ (match-end 0))))
+                  (setq list (nreverse list)
+                        list (cdr list)))
+                (while list
+                  (message "Searching subfile %s..." (cdr (car list)))
+                  (Info-read-subfile (car (car list)))
+                  (setq list (cdr list))
+                  (goto-char (point-min))
+                  (if (re-search-forward regexp nil t)
+                      (setq found (point) list ())))
+                (if found
+                    (message "")
+                  (signal 'search-failed (list regexp))))
+            (if (not found)
+                (progn (Info-read-subfile opoint)
+                       (goto-char opoint)
+                       (Info-select-node)))))
+      (widen)
+      (goto-char found)
+      (Info-select-node)
+      (or (and (equal onode Info-current-node)
+               (equal ofile Info-current-file))
+          (Info-history-add ofile onode opoint)))))
 
 ;; Extract the value of the node-pointer named NAME.
 ;; If there is none, use ERRORNAME in the error message; 
diff -urd xemacs-20.1-b10-orig/lisp/prim/isearch-mode.el xemacs-20.1-b10/lisp/prim/isearch-mode.el
--- xemacs-20.1-b10-orig/lisp/prim/isearch-mode.el	Thu Mar 27 21:29:01 1997
+++ xemacs-20.1-b10/lisp/prim/isearch-mode.el	Sat Apr  5 13:06:00 1997
@@ -1559,3 +1559,16 @@
   ;; this incorrectly returns t for "\\\\A"
   (let ((case-fold-search nil))
     (not (string-match "\\(^\\|[^\\]\\)[A-Z]" string))))
+
+;; Used by etags.el and info.el
+(defmacro with-caps-disable-folding (string &rest body) "\
+Eval BODY with `case-fold-search' let to nil if STRING contains
+uppercase letters and `search-caps-disable-folding' is t."
+  `(let ((case-fold-search
+          (if (and case-fold-search search-caps-disable-folding)
+              (isearch-no-upper-case-p ,string)
+            case-fold-search)))
+     ,@body))
+(put 'with-caps-disable-folding 'lisp-indent-function 1)
+(put 'with-caps-disable-folding 'edebug-form-spec '(form body))
+

