From: Juanma Barranquero Date: Thu, 7 Jul 2005 10:04:01 +0000 (+0000) Subject: (occur-rename-buffer): Use `generate-new-buffer' also when called X-Git-Tag: emacs-pretest-22.0.90~8318 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a653724b13498c0e355cc056823b6a272337d59f;p=emacs.git (occur-rename-buffer): Use `generate-new-buffer' also when called non-interactively. Doc fix. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4bbfae3d993..f5dbc71ff97 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2005-07-07 Juanma Barranquero + + * replace.el (occur-rename-buffer): Use `generate-new-buffer' also + when called non-interactively. Doc fix. + 2005-07-07 Lute Kamstra * elide-head.el (elide-head-headers-to-hide): Recognize the FSF's @@ -11,13 +16,13 @@ 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 diff --git a/lisp/replace.el b/lisp/replace.el index 4b745d54433..a8ef61e828d 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -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.