X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fbuffer.el;h=e7920c0590d732b65180d832d88124e40206534e;hb=43027e1315036a9a2a3ca7e09aa0d51ef93e520a;hp=44f922185373ed17fe8537c8f7c2eb2c109c1a3e;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910;p=chise%2Fxemacs-chise.git diff --git a/lisp/buffer.el b/lisp/buffer.el index 44f9221..e7920c0 100644 --- a/lisp/buffer.el +++ b/lisp/buffer.el @@ -32,11 +32,14 @@ ;;; Code: +(defvar switch-to-buffer-hooks nil + "Hooks to run after a recorded buffer switch.") + (defun switch-to-buffer (bufname &optional norecord) "Select buffer BUFNAME in the current window. -BUFNAME may be a buffer or a buffer name and is created if did not exist. -Optional second arg NORECORD non-nil means -do not put this buffer at the front of the list of recently selected ones. +BUFNAME may be a buffer or a buffer name and is created if it did not exist. +Optional second arg NORECORD non-nil means do not put this buffer at the +front of the list of recently selected ones. WARNING: This is NOT the way to work on another buffer temporarily within a Lisp program! Use `set-buffer' instead. That avoids messing with @@ -65,6 +68,8 @@ the window-buffer correspondences." (next-window (minibuffer-window)) (selected-window)) buf) + ;; XEmacs change + (or norecord (run-hook-with-args 'switch-to-buffer-hooks buf)) buf)) (defun pop-to-buffer (bufname &optional not-this-window-p on-frame)