(occur-rename-buffer): Use `generate-new-buffer' also when called
authorJuanma Barranquero <lekktu@gmail.com>
Thu, 7 Jul 2005 10:04:01 +0000 (10:04 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Thu, 7 Jul 2005 10:04:01 +0000 (10:04 +0000)
non-interactively.  Doc fix.

lisp/ChangeLog
lisp/replace.el

index 4bbfae3..f5dbc71 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-07  Juanma Barranquero  <lekktu@gmail.com>
+
+       * replace.el (occur-rename-buffer): Use `generate-new-buffer' also
+       when called non-interactively.  Doc fix.
+
 2005-07-07  Lute Kamstra  <lute@gnu.org>
 
        * elide-head.el (elide-head-headers-to-hide): Recognize the FSF's
        ascii-incompatible.
        (set-keyboard-coding-system): Likewise.
 
-       * international/mule-cmds.el (set-default-coding-systems): Don't
-       set default-file-name-coding-system and
+       * international/mule-cmds.el (set-default-coding-systems):
+       Don't set default-file-name-coding-system and
        default-keyboard-coding-system if coding-system is
        ASCII-incompatible.
 
        * international/utf-16.el: Declare that all UTF-16-based coding
-       systems ASCII-incompatible.
+       systems are ASCII-incompatible.
 
 2005-07-07  Nick Roberts  <nickrob@snap.net.nz>
 
index 4b745d5..a8ef61e 100644 (file)
@@ -921,21 +921,22 @@ If the value is nil, don't highlight the buffer names specially."
        (when current-prefix-arg
          (prefix-numeric-value current-prefix-arg))))
 
-(defun occur-rename-buffer (&optional unique-p)
+(defun occur-rename-buffer (&optional unique-p interactive-p)
   "Rename the current *Occur* buffer to *Occur: original-buffer-name*.
-Here `original-buffer-name' is the buffer name were occur was originally run.
-When given the prefix argument, the renaming will not clobber the existing
-buffer(s) of that name, but use `generate-new-buffer-name' instead.
-You can add this to `occur-mode-hook' if you always want a separate *Occur*
-buffer for each buffer where you invoke `occur'."
-  (interactive "P")
+Here `original-buffer-name' is the buffer name were Occur was originally run.
+When given the prefix argument, or called non-interactively, the renaming
+will not clobber the existing buffer(s) of that name, but use
+`generate-new-buffer-name' instead.  You can add this to `occur-hook'
+if you always want a separate *Occur* buffer for each buffer where you
+invoke `occur'."
+  (interactive "P\np")
   (with-current-buffer
       (if (eq major-mode 'occur-mode) (current-buffer) (get-buffer "*Occur*"))
     (rename-buffer (concat "*Occur: "
                            (mapconcat #'buffer-name
                                       (car (cddr occur-revert-arguments)) "/")
                            "*")
-                   unique-p)))
+                   (or unique-p (not interactive-p)))))
 
 (defun occur (regexp &optional nlines)
   "Show all lines in the current buffer containing a match for REGEXP.