]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/re-builder.el
Fixes: debbugs:6594
[gnu-emacs] / lisp / emacs-lisp / re-builder.el
index 31f7d8da49ede4e16f4c41df0ba8f1c11b6f0d61..fd47c57640404991387ab7336255a78332407775 100644 (file)
@@ -1,7 +1,7 @@
 ;;; re-builder.el --- building Regexps with visual feedback
 
 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
 ;; Author: Detlev Zundel <dzu@gnu.org>
 ;; Keywords: matching, lisp, tools
@@ -247,7 +247,9 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
                  :help "Quit the RE Builder mode"))
     (define-key menu-map [rt]
       '(menu-item "Case sensitive" reb-toggle-case
-                 :button (:toggle . case-fold-search)
+                 :button (:toggle . (with-current-buffer
+                                        reb-target-buffer
+                                      (null case-fold-search)))
                  :help "Toggle case sensitivity of searches for RE Builder target buffer"))
     (define-key menu-map [rb]
       '(menu-item "Change target buffer..." reb-change-target-buffer
@@ -658,8 +660,7 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions."
         (matches 0)
         (submatches 0)
         firstmatch)
-    (save-excursion
-      (set-buffer reb-target-buffer)
+    (with-current-buffer reb-target-buffer
       (reb-delete-overlays)
       (goto-char (point-min))
       (while (and (not (eobp))