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: Sun, 12 May 2002 23:46:56 -0400

Index: emacs/lisp/replace.el
diff -c emacs/lisp/replace.el:1.141 emacs/lisp/replace.el:1.142
*** emacs/lisp/replace.el:1.141 Sun May 12 13:28:42 2002
--- emacs/lisp/replace.el       Sun May 12 23:46:56 2002
***************
*** 476,482 ****
  
  (defun occur-revert-function (ignore1 ignore2)
    "Handle `revert-buffer' for Occur mode buffers."
!   (apply 'occur-1 occur-revert-arguments))
  
  (defun occur-mode-mouse-goto (event)
    "In Occur mode, go to the occurrence whose line you click on."
--- 476,482 ----
  
  (defun occur-revert-function (ignore1 ignore2)
    "Handle `revert-buffer' for Occur mode buffers."
!   (apply 'occur-1 (append occur-revert-arguments (list (buffer-name)))))
  
  (defun occur-mode-mouse-goto (event)
    "In Occur mode, go to the occurrence whose line you click on."
***************
*** 678,685 ****
                               buf))
                           (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))
--- 678,687 ----
                               buf))
                           (buffer-list))))))
  
! (defun occur-1 (regexp nlines bufs &optional buf-name)
!   (unless buf-name
!     (setq buf-name "*Occur*"))
!   (let ((occur-buf (get-buffer-create buf-name))
        (made-temp-buf nil)
        (active-bufs (delq nil (mapcar #'(lambda (buf)
                                           (when (buffer-live-p buf) buf))
***************
*** 701,713 ****
                         (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)
                           ""
--- 703,719 ----
                         (isearch-no-upper-case-p regexp t))
                    nil nil nil nil)))
        (let* ((diff (- (length bufs) (length active-bufs)))
+              (bufcount (- (length bufs) diff))
               (msg (concat
!                    (format "Searched %d buffer%s" bufcount (if (= bufcount 1) 
"" "s"))
                     "%s; "
!                    (format "%s match%s for `%s'"
                             (if (zerop count)
                                 "no"
                               (format "%d" count))
+                            (if (= count 1)
+                                ""
+                              "es")
                             regexp))))
          (message msg (if (zerop diff)
                           ""
***************
*** 715,723 ****
        ;; 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)
--- 721,729 ----
        ;; If we had to make a temporary buffer, make it the *Occur*
        ;; buffer now.
        (when made-temp-buf
!         (with-current-buffer (get-buffer buf-name)
!           (kill-buffer (current-buffer)))
!         (rename-buffer buf-name))
        (setq occur-revert-arguments (list regexp nlines bufs)
              buffer-read-only t)
        (if (> count 0)
***************
*** 817,825 ****
                                          mouse-face highlight help-echo
                                          "mouse-2: go to this occurrence")))))
                    (goto-char endpt))
!                 (setq lines (1+ lines))
!                 ;; On to the next match...
!                 (forward-line 1))))
            (when (not (zerop matches)) ;; is the count zero?
              (with-current-buffer out-buf
                (goto-char headerpt)
--- 823,834 ----
                                          mouse-face highlight help-echo
                                          "mouse-2: go to this occurrence")))))
                    (goto-char endpt))
!                 (if endpt
!                     (progn
!                       (setq lines (1+ lines))
!                       ;; On to the next match...
!                       (forward-line 1))
!                   (goto-char (point-max))))))
            (when (not (zerop matches)) ;; is the count zero?
              (with-current-buffer out-buf
                (goto-char headerpt)



reply via email to

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