]> code.delx.au - gnu-emacs/blobdiff - lisp/iswitchb.el
(quoted-insert-character-offset): Initialize more cleanly.
[gnu-emacs] / lisp / iswitchb.el
index 159aff8ed51e395e78d4e841ed2e273be3a01bfb..ddd14e0188d5d448a918e5557ae4078c810f60a0 100644 (file)
@@ -201,6 +201,7 @@ example functions that filter buffernames.")
 Possible values:
 `samewindow'   Show new buffer in same window
 `otherwindow'  Show new buffer in another window (same frame)
+`display'      Display buffer in another window without switching to it
 `otherframe'   Show new buffer in another frame
 `maybe-frame'  If a buffer is visible in another frame, prompt to ask if you
                you want to see the buffer in the same window of the current
@@ -233,7 +234,7 @@ See also `iswitchb-newbuffer'.")
 
 (defvar iswitchb-method nil
   "*Stores the method for viewing the selected buffer.  
-Its value is one of `samewindow', `otherwindow', `otherframe',
+Its value is one of `samewindow', `otherwindow', `display', `otherframe',
 `maybe-frame' or `always-frame'.  See `iswitchb-default-method' for
 details of values.")
 
@@ -637,7 +638,7 @@ current frame, rather than all frames, regardless of value of
 
 (defun iswitchb-get-matched-buffers (regexp &optional string-format buffer-list)
   "Return matched buffers.
-If STRING-FORMAT is non-nil, consider EGEXP as string.
+If STRING-FORMAT is non-nil, consider REGEXP as string.
 BUFFER-LIST can be list of buffers or list of strings."
   (let* ((case-fold-search  iswitchb-case)
         ;; need reverse since we are building up list backwards
@@ -815,6 +816,9 @@ Return the modified list with the last element prepended to it."
      ((eq iswitchb-method 'otherwindow)
       (switch-to-buffer-other-window buffer))
 
+     ((eq iswitchb-method 'display)
+      (display-buffer buffer))
+
      ((eq iswitchb-method 'otherframe)
       (progn
        (switch-to-buffer-other-frame buffer)
@@ -865,6 +869,7 @@ Call this function to override the normal bindings."
   (interactive)
   (global-set-key "\18b" 'iswitchb-buffer)
   (global-set-key "\184b" 'iswitchb-buffer-other-window)
+  (global-set-key "\184\ f" 'iswitchb-display-buffer)
   (global-set-key "\185b" 'iswitchb-buffer-other-frame))
 
 
@@ -894,6 +899,17 @@ For details of keybindings, do `\\[describe-function] iswitchb'."
 
 
 
+;;;###autoload
+(defun iswitchb-display-buffer ()
+  "Display a buffer in another window but don't select it.
+The buffer name is selected interactively by typing a substring.
+For details of keybindings, do `\\[describe-function] iswitchb'."
+  (interactive)
+  (setq iswitchb-method 'display)
+  (iswitchb-entry))
+
+
+
 ;;;###autoload
 (defun iswitchb-buffer-other-frame ()
   "Switch to another buffer and show it in another frame.
@@ -1146,10 +1162,11 @@ Copied from `icomplete-tidy'."
 (defun iswitchb-entryfn-p ()
   "Return non-nil if `this-command' shows we are using `iswitchb-buffer'."
   (and (symbolp this-command)          ; ignore lambda functions
-       (member (symbol-name this-command)
-              '("iswitchb-buffer"
-                "iswitchb-buffer-other-frame"
-                "iswitchb-buffer-other-window"))))
+       (memq this-command
+            '(iswitchb-buffer
+              iswitchb-buffer-other-frame
+              iswitchb-display-buffer
+              iswitchb-buffer-other-window))))
 
 (defun iswitchb-summaries-to-end ()
   "Move the summaries to the end of the list.