emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/replace.el


From: Colin Walters
Subject: [Emacs-diffs] Changes to emacs/lisp/replace.el
Date: Thu, 02 May 2002 17:22:48 -0400

Index: emacs/lisp/replace.el
diff -c emacs/lisp/replace.el:1.138 emacs/lisp/replace.el:1.139
*** emacs/lisp/replace.el:1.138 Thu May  2 01:34:16 2002
--- emacs/lisp/replace.el       Thu May  2 17:22:47 2002
***************
*** 445,450 ****
--- 445,451 ----
      (define-key map "\M-n" 'occur-next)
      (define-key map "\M-p" 'occur-prev)
      (define-key map "g" 'revert-buffer)
+     (define-key map "q" 'delete-window)
      map)
    "Keymap for `occur-mode'.")
  
***************
*** 679,705 ****
                           (buffer-list))))))
  
  (defun occur-1 (regexp nlines bufs)
!   (let ((occur-buf (get-buffer-create "*Occur*")))
      (with-current-buffer occur-buf
        (setq buffer-read-only nil)
        (occur-mode)
        (erase-buffer)
        (let ((count (occur-engine
!                   regexp bufs occur-buf
                    (or nlines list-matching-lines-default-context-lines)
                    (and case-fold-search
                         (isearch-no-upper-case-p regexp t))
                    nil nil nil nil)))
!       (message "Searched %d buffers; %s matches for `%s'" (length bufs)
!                (if (zerop count)
!                    "no"
!                  (format "%d" count))
!                regexp)
        (if (> count 0)
            (display-buffer occur-buf)
!         (kill-buffer occur-buf)))
!       (setq occur-revert-arguments (list regexp nlines bufs)
!           buffer-read-only t))))
  
  (defun occur-engine-add-prefix (lines)
    (mapcar
--- 680,729 ----
                           (buffer-list))))))
  
  (defun occur-1 (regexp nlines bufs)
!   (let ((occur-buf (get-buffer-create "*Occur*"))
!       (made-temp-buf nil)
!       (active-bufs (delq nil (mapcar #'(lambda (buf)
!                                          (when (buffer-live-p buf) buf))
!                                      bufs))))
!     ;; Handle the case where one of the buffers we're searching is the
!     ;; *Occur* buffer itself.
!     (when (memq occur-buf bufs)
!       (setq occur-buf (with-current-buffer occur-buf
!                       (clone-buffer "*Occur-temp*"))
!           made-temp-buf t))
      (with-current-buffer occur-buf
        (setq buffer-read-only nil)
        (occur-mode)
        (erase-buffer)
        (let ((count (occur-engine
!                   regexp active-bufs occur-buf
                    (or nlines list-matching-lines-default-context-lines)
                    (and case-fold-search
                         (isearch-no-upper-case-p regexp t))
                    nil nil nil nil)))
!       (let* ((diff (- (length bufs) (length active-bufs)))
!              (msg (concat
!                    (format "Searched %d buffers" (- (length bufs) diff))
!                    "%s; "
!                    (format "%s matches for `%s'"
!                            (if (zerop count)
!                                "no"
!                              (format "%d" count))
!                            regexp))))
!         (message msg (if (zerop diff)
!                          ""
!                        (format " (%d killed)" diff))))
!       ;; If we had to make a temporary buffer, make it the *Occur*
!       ;; buffer now.
!       (when made-temp-buf
!         (with-current-buffer (get-buffer "*Occur*")
!           (kill-this-buffer))
!         (rename-buffer "*Occur*"))
!       (setq occur-revert-arguments (list regexp nlines bufs)
!             buffer-read-only t)
        (if (> count 0)
            (display-buffer occur-buf)
!         (kill-buffer occur-buf))))))
  
  (defun occur-engine-add-prefix (lines)
    (mapcar



reply via email to

[Prev in Thread] Current Thread [Next in Thread]