• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/

Lines Matching +defs:visit +defs:buffer

9 ;; Keywords: buffer, convenience
30 ;; ibuffer.el is an advanced replacement for the `buffer-menu' which
59 "An advanced replacement for `buffer-menu'.
71 "A list of ways to display buffer lines.
74 attributes of a buffer such as size, name, and mode in a particular
76 control the appearance of an Ibuffer buffer. See also
90 The first argument is the buffer object, and the second is the mark
91 on that buffer.
112 the buffer, separated by a space.
115 read-only status, as well as the name of the buffer and its size. In
118 the name is also aligned to the left. The size of the buffer will
144 `((10 buffer-read-only font-lock-constant-face)
145 (15 (and buffer-file-name
147 buffer-file-name))
149 (20 (string-match "^*" (buffer-name)) font-lock-keyword-face)
150 (25 (and (string-match "^ " (buffer-name))
151 (null buffer-file-name))
153 (30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face)
158 buffer, and FACE is the face to use for fontification. If the FORM
159 evaluates to non-nil, then FACE will be put on the buffer name. The
162 If you change this variable, you must kill the Ibuffer buffer and
199 Note that this variable is local to each Ibuffer buffer. Thus, you
229 (and (string-match "^ " (buffer-name buf))
230 (null buffer-file-name))))
234 If a regexp, then it will be matched against the buffer's name.
235 If a function, it will be called with the buffer as an argument, and
236 should return non-nil if this buffer should be shown.
285 "If non-nil, display the current Ibuffer buffer itself.
287 buffer will most likely be inaccurate. This includes modification
292 (defcustom ibuffer-always-show-last-buffer nil
293 "If non-nil, always display the previous buffer.
302 "If non-nil, only offer buffers visible in the Ibuffer buffer
303 in completion lists of the `ibuffer-jump-to-buffer' command."
313 "The default directory to use for a new Ibuffer buffer.
314 If nil, inherit the directory of the buffer in which `ibuffer' was
321 (defcustom ibuffer-help-buffer-modes
403 (define-key map (kbd "j") 'ibuffer-jump-to-buffer)
404 (define-key map (kbd "M-g") 'ibuffer-jump-to-buffer)
437 (define-key map "b" 'ibuffer-bury-buffer)
488 (define-key map (kbd "C-t") 'ibuffer-visit-tags-table)
516 (define-key map (kbd "RET") 'ibuffer-visit-buffer)
517 (define-key map (kbd "e") 'ibuffer-visit-buffer)
518 (define-key map (kbd "f") 'ibuffer-visit-buffer)
520 (define-key map (kbd "o") 'ibuffer-visit-buffer-other-window)
521 (define-key map (kbd "C-o") 'ibuffer-visit-buffer-other-window-noselect)
522 (define-key map (kbd "M-o") 'ibuffer-visit-buffer-1-window)
526 (define-key map (kbd "C-x 4 RET") 'ibuffer-visit-buffer-other-window)
527 (define-key map (kbd "C-x 5 RET") 'ibuffer-visit-buffer-other-frame)
532 (define-key-after map [menu-bar view visit-buffer]
533 '(menu-item "View this buffer" ibuffer-visit-buffer))
534 (define-key-after map [menu-bar view visit-buffer-other-window]
535 '(menu-item "View (other window)" ibuffer-visit-buffer-other-window))
536 (define-key-after map [menu-bar view visit-buffer-other-frame]
537 '(menu-item "View (other frame)" ibuffer-visit-buffer-other-frame))
554 '(menu-item "Sort by buffer size" ibuffer-do-sort-by-size))
557 :help "Sort by the alphabetic order of buffer name"))
560 :help "Sort by the last time the buffer was displayed"))
580 '(menu-item "Add filter by buffer name..." ibuffer-filter-by-name))
688 :help "View the differences between this buffer and its file"))
691 :help "Attempt to automatically update the Ibuffer buffer"))
704 :help "Mark the buffer at point"))
707 :help "Unmark the buffer at point"))
745 '(menu-item "Mark by buffer name (regexp)..." ibuffer-mark-by-name-regexp
788 :help "For each marked buffer, send its contents to a shell command"))
791 :help "For each marked buffer, replace its contents with output of shell command"))
793 '(menu-item "Shell command on buffer's file..." ibuffer-do-shell-command-file
794 :help "For each marked buffer, run a shell command with its file as argument"))
797 :help "Evaluate a Lisp form in each marked buffer"))
799 '(menu-item "Eval (viewing buffer)..." ibuffer-do-view-and-eval
800 :help "Evaluate a Lisp form in each marked buffer while viewing it"))
820 (define-key map [(mouse-2)] 'ibuffer-mouse-visit-buffer)
880 "Insert LIST into the current buffer in as many columns as possible.
905 "Toggle the marked status of the buffer chosen with the mouse."
915 (setq buffer-read-only nil)
919 (setq buffer-read-only t)))
922 "Like `find-file', but default to the directory of the buffer at point."
924 (let ((default-directory (let ((buf (ibuffer-current-buffer)))
925 (if (buffer-live-p buf)
926 (with-current-buffer buf
933 (defun ibuffer-mouse-visit-buffer (event)
934 "Visit the buffer chosen with the mouse."
936 (switch-to-buffer
939 (ibuffer-current-buffer t))))
960 (setq buffer-read-only t)
1034 (defun ibuffer-visit-buffer (&optional single)
1035 "Visit the buffer on this line.
1039 (let ((buf (ibuffer-current-buffer t)))
1040 (bury-buffer (current-buffer))
1041 (switch-to-buffer buf)
1045 (defun ibuffer-visit-buffer-other-window (&optional noselect)
1046 "Visit the buffer on this line in another window."
1048 (let ((buf (ibuffer-current-buffer t)))
1049 (bury-buffer (current-buffer))
1052 (pop-to-buffer buf)
1054 (switch-to-buffer-other-window buf))))
1056 (defun ibuffer-visit-buffer-other-window-noselect ()
1057 "Visit the buffer on this line in another window, but don't select it."
1059 (ibuffer-visit-buffer-other-window t))
1061 (defun ibuffer-visit-buffer-other-frame ()
1062 "Visit the buffer on this line in another frame."
1064 (let ((buf (ibuffer-current-buffer t)))
1065 (bury-buffer (current-buffer))
1066 (switch-to-buffer-other-frame buf)))
1068 (defun ibuffer-visit-buffer-1-window ()
1069 "Visit the buffer on this line, and delete other windows."
1071 (ibuffer-visit-buffer t))
1073 (defun ibuffer-bury-buffer ()
1074 "Bury the buffer on this line."
1076 (let ((buf (ibuffer-current-buffer t))
1078 (bury-buffer buf)
1082 (defun ibuffer-visit-tags-table ()
1083 "Visit the tags table in the buffer on this line. See `visit-tags-table'."
1085 (let ((file (buffer-file-name (ibuffer-current-buffer t))))
1087 (visit-tags-table file)
1088 (error "Specified buffer has no file"))))
1091 "View marked buffers, or the buffer on the current line.
1093 marked buffer in a new frame. Otherwise, display each buffer as
1106 (setq marked-bufs (list (ibuffer-current-buffer t))))
1112 (set-buffer-modified-p nil)
1114 (switch-to-buffer (pop marked-bufs))
1122 (switch-to-buffer buf)
1127 (switch-to-buffer buf)))
1140 (fit-window-to-buffer nil (when owin (/ (frame-height)
1144 "Display a buffer asking whether to perform OPERATION on NAMES."
1147 (y-or-n-p (format "Really %s buffer %s? " operation (car names)))
1148 (let ((buf (get-buffer-create "*Ibuffer confirmation*")))
1149 (with-current-buffer buf
1150 (setq buffer-read-only nil)
1151 (erase-buffer)
1154 (setq buffer-read-only t))
1156 ;; Now attempt to display the buffer...
1178 (switch-to-buffer buf)
1181 (fit-window-to-buffer)
1184 (kill-buffer buf))))))))
1190 (defun ibuffer-buffer-names-with-mark (mark)
1191 (let ((ibuffer-buffer-names-with-mark-result nil))
1195 (push (buffer-name buf)
1196 ibuffer-buffer-names-with-mark-result))))
1197 ibuffer-buffer-names-with-mark-result))
1199 (defsubst ibuffer-marked-buffer-names ()
1200 (ibuffer-buffer-names-with-mark ibuffer-marked-char))
1202 (defsubst ibuffer-deletion-marked-buffer-names ()
1203 (ibuffer-buffer-names-with-mark ibuffer-deletion-char))
1223 "Save marked buffers as with `save-buffer'."
1227 (when (buffer-modified-p buf)
1228 (if (not (with-current-buffer buf
1229 buffer-file-name))
1233 (switch-to-buffer buf)
1234 (save-buffer))
1235 (with-current-buffer buf
1236 (save-buffer))))
1243 (set-buffer-modified-p (not (buffer-modified-p))))
1252 "Kill marked buffers as with `kill-this-buffer'."
1258 (if (kill-buffer buf)
1263 "Kill buffers marked for deletion as with `kill-this-buffer'."
1270 (if (kill-buffer buf)
1278 (message "No buffers marked; use 'm' to mark a buffer")
1323 "Mark the buffer on this line, and move forward ARG lines.
1329 "Unmark the buffer on this line, and move forward ARG lines.
1335 "Unmark the buffer on this line, and move backward ARG lines.
1347 (ibuffer-mark-on-buffer #'identity mark it))
1367 (list (ibuffer-current-buffer)
1382 (defun ibuffer-current-buffer (&optional must-be-live)
1387 (unless (buffer-live-p buf)
1389 (error "No buffer on this line")))
1544 `(,sym buffer mark)))
1608 (nconc (list 'lambda '(buffer mark))
1671 (if buffer-read-only
1676 (if (buffer-modified-p)
1687 "mouse-1: mark this buffer\nmouse-2: select this buffer\nmouse-3: operate on this buffer"
1688 "mouse-1: mark buffer mouse-2: select buffer mouse-3: operate"))
1693 ((= 1 bufs) "1 buffer")
1695 (propertize (buffer-name) 'font-lock-face (ibuffer-buffer-name-face buffer mark)))
1709 (format "%s" (buffer-size)))
1727 (ibuffer-aif (get-buffer-process buffer)
1740 (or buffer-file-name
1767 (let ((proc (get-buffer-process buffer))
1768 (filename (ibuffer-make-column-filename buffer mark)))
1785 (defun ibuffer-buffer-name-face (buf mark)
1795 (with-current-buffer buf
1800 (defun ibuffer-insert-buffer-line (buffer mark format)
1804 (funcall format buffer mark)
1805 (put-text-property beg (point) 'ibuffer-properties (list buffer mark)))
1818 (let ((buf (ibuffer-current-buffer)))
1823 (ibuffer-insert-buffer-line
1837 "Call FUNCTION for each buffer.
1844 the buffer object itself and the current mark symbol."
1857 (setq buffer-read-only nil)
1867 (if (buffer-live-p (ibuffer-current-buffer))
1873 (ibuffer-current-buffer)
1875 ;; Kill the line if the buffer is dead
1878 ;; `nil' if it chose not to affect the buffer
1879 ;; `kill' means the remove line from the buffer list
1896 (setq buffer-read-only t)
1898 (set-buffer-modified-p nil))
1904 "Return a list of buffer objects currently marked."
1914 the value of point at the beginning of the line for that buffer."
1921 (when (buffer-live-p buf)
1925 (when (buffer-live-p buf)
1940 (name (buffer-name buf)))
1957 (or (and ibuffer-always-show-last-buffer
2046 (buffer-substring (point) (line-end-position)))))
2125 (message "Redisplaying current buffer list..."))
2135 (message "Redisplaying current buffer list...done"))
2150 (let* ((bufs (buffer-list))
2152 (current-buffer)
2155 (eq ibuffer-always-show-last-buffer
2168 (message "Updating buffer list..."))
2172 (message "Updating buffer list...done")))
2188 ;; perhaps reverse the sorted buffer list
2218 (ibuffer-insert-buffer-line (car entry) (cdr entry) format))
2231 ;; entire buffer at once
2240 (setq buffer-read-only nil)
2241 (erase-buffer)
2263 (setq buffer-read-only t)
2264 (set-buffer-modified-p ibuffer-did-modification)
2275 (bury-buffer)
2278 (bury-buffer)))
2306 NAME specifies the name of the buffer (defaults to \"*Ibuffer*\").
2309 NOSELECT means don't select the Ibuffer buffer.
2310 SHRINK means shrink the buffer to minimal size. The special
2316 that value locally in this buffer."
2321 (let ((buf (get-buffer-create (or name "*Ibuffer*"))))
2323 (funcall (if noselect #'(lambda (buf) (display-buffer buf t)) #'pop-to-buffer) buf)
2324 (funcall (if noselect #'display-buffer #'switch-to-buffer) buf))
2325 (with-current-buffer buf
2327 ;; We switch to the buffer's window in order to be able
2329 (select-window (get-buffer-window buf 0))
2348 (setq buffer-read-only nil)
2350 (setq buffer-read-only t))
2381 buffer's file as an argument.
2386 '\\[ibuffer-do-view-and-eval]' - As above, but view each buffer while the form
2388 '\\[ibuffer-do-kill-lines]' - Remove the marked lines from the *Ibuffer* buffer,
2389 but don't kill the associated buffer.
2394 '\\[ibuffer-mark-forward]' - Mark the buffer at point.
2397 '\\[ibuffer-unmark-forward]' - Unmark the buffer at point.
2398 '\\[ibuffer-unmark-backward]' - Unmark the buffer at point, and move to the
2403 This means that the buffer is modified, and has an associated file.
2414 '\\[ibuffer-mark-for-delete]' - Mark the buffer at point for deletion.
2423 '\\[ibuffer-filter-by-name]' - Add a filter by buffer name.
2424 '\\[ibuffer-filter-by-content]' - Add a filter by buffer content.
2426 '\\[ibuffer-filter-by-size-gt]' - Add a filter by buffer size.
2427 '\\[ibuffer-filter-by-size-lt]' - Add a filter by buffer size.
2467 '\\[ibuffer-quit]' - Bury the Ibuffer buffer.
2469 '\\[ibuffer-diff-with-file]' - View the differences between this buffer
2471 '\\[ibuffer-visit-buffer]' - View the buffer on this line.
2472 '\\[ibuffer-visit-buffer-other-window]' - As above, but in another window.
2473 '\\[ibuffer-visit-buffer-other-window-noselect]' - As both above, but don't select
2475 '\\[ibuffer-bury-buffer]' - Bury (not kill!) the buffer on this line.
2480 buffer has its own stack of active filters. For example, suppose you
2482 buffer displays buffers in just `emacs-lisp' modes via
2511 match a filter, which are displayed together in an Ibuffer buffer. To
2536 (setq buffer-read-only t)
2537 (buffer-disable-undo)
2542 ;; disable `show-paren-mode' buffer-locally
2545 (set (make-local-variable 'revert-buffer-function)