diff options
| author | John Paul Wallington | 2008-05-15 00:05:40 +0000 |
|---|---|---|
| committer | John Paul Wallington | 2008-05-15 00:05:40 +0000 |
| commit | 87a6a53ae2f403824dcbf8ae6447356d7fa686aa (patch) | |
| tree | 33b9440b4857940b502c74fe1f46fde6290c8456 | |
| parent | 674da0287d0d10ff0eade18bf5bec2ffb8ce3dfa (diff) | |
| download | emacs-87a6a53ae2f403824dcbf8ae6447356d7fa686aa.tar.gz emacs-87a6a53ae2f403824dcbf8ae6447356d7fa686aa.zip | |
(ibuffer-assert-ibuffer-mode): New defsubst.
(ibuffer-mark-interactive, ibuffer-set-mark)
(ibuffer-insert-buffer-line, ibuffer-redisplay-current)
(ibuffer-map-lines, ibuffer-switch-format)
(ibuffer-update-title-and-summary)
(ibuffer-redisplay-engine): Use it.
| -rw-r--r-- | lisp/ibuffer.el | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 085a95a65f9..6843602bd52 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -1233,6 +1233,9 @@ a new window in the current frame, splitting vertically." | |||
| 1233 | (defsubst ibuffer-map-deletion-lines (func) | 1233 | (defsubst ibuffer-map-deletion-lines (func) |
| 1234 | (ibuffer-map-on-mark ibuffer-deletion-char func)) | 1234 | (ibuffer-map-on-mark ibuffer-deletion-char func)) |
| 1235 | 1235 | ||
| 1236 | (defsubst ibuffer-assert-ibuffer-mode () | ||
| 1237 | (assert (derived-mode-p 'ibuffer-mode))) | ||
| 1238 | |||
| 1236 | (defun ibuffer-buffer-file-name () | 1239 | (defun ibuffer-buffer-file-name () |
| 1237 | (or buffer-file-name | 1240 | (or buffer-file-name |
| 1238 | (let ((dirname (or (and (boundp 'dired-directory) | 1241 | (let ((dirname (or (and (boundp 'dired-directory) |
| @@ -1365,7 +1368,7 @@ If point is on a group name, this function operates on that group." | |||
| 1365 | (ibuffer-mark-interactive arg ?\s -1)) | 1368 | (ibuffer-mark-interactive arg ?\s -1)) |
| 1366 | 1369 | ||
| 1367 | (defun ibuffer-mark-interactive (arg mark movement) | 1370 | (defun ibuffer-mark-interactive (arg mark movement) |
| 1368 | (assert (eq major-mode 'ibuffer-mode)) | 1371 | (ibuffer-assert-ibuffer-mode) |
| 1369 | (or arg (setq arg 1)) | 1372 | (or arg (setq arg 1)) |
| 1370 | (ibuffer-forward-line 0) | 1373 | (ibuffer-forward-line 0) |
| 1371 | (ibuffer-aif (get-text-property (point) 'ibuffer-filter-group-name) | 1374 | (ibuffer-aif (get-text-property (point) 'ibuffer-filter-group-name) |
| @@ -1380,7 +1383,7 @@ If point is on a group name, this function operates on that group." | |||
| 1380 | (setq arg (1- arg)))))) | 1383 | (setq arg (1- arg)))))) |
| 1381 | 1384 | ||
| 1382 | (defun ibuffer-set-mark (mark) | 1385 | (defun ibuffer-set-mark (mark) |
| 1383 | (assert (eq major-mode 'ibuffer-mode)) | 1386 | (ibuffer-assert-ibuffer-mode) |
| 1384 | (let ((inhibit-read-only t)) | 1387 | (let ((inhibit-read-only t)) |
| 1385 | (ibuffer-set-mark-1 mark) | 1388 | (ibuffer-set-mark-1 mark) |
| 1386 | (setq ibuffer-did-modification t) | 1389 | (setq ibuffer-did-modification t) |
| @@ -1822,7 +1825,7 @@ If point is on a group name, this function operates on that group." | |||
| 1822 | 1825 | ||
| 1823 | (defun ibuffer-insert-buffer-line (buffer mark format) | 1826 | (defun ibuffer-insert-buffer-line (buffer mark format) |
| 1824 | "Insert a line describing BUFFER and MARK using FORMAT." | 1827 | "Insert a line describing BUFFER and MARK using FORMAT." |
| 1825 | (assert (eq major-mode 'ibuffer-mode)) | 1828 | (ibuffer-assert-ibuffer-mode) |
| 1826 | (let ((beg (point))) | 1829 | (let ((beg (point))) |
| 1827 | (funcall format buffer mark) | 1830 | (funcall format buffer mark) |
| 1828 | (put-text-property beg (point) 'ibuffer-properties (list buffer mark))) | 1831 | (put-text-property beg (point) 'ibuffer-properties (list buffer mark))) |
| @@ -1831,7 +1834,7 @@ If point is on a group name, this function operates on that group." | |||
| 1831 | ;; This function knows a bit too much of the internals. It would be | 1834 | ;; This function knows a bit too much of the internals. It would be |
| 1832 | ;; nice if it was all abstracted away. | 1835 | ;; nice if it was all abstracted away. |
| 1833 | (defun ibuffer-redisplay-current () | 1836 | (defun ibuffer-redisplay-current () |
| 1834 | (assert (eq major-mode 'ibuffer-mode)) | 1837 | (ibuffer-assert-ibuffer-mode) |
| 1835 | (when (eobp) | 1838 | (when (eobp) |
| 1836 | (forward-line -1)) | 1839 | (forward-line -1)) |
| 1837 | (beginning-of-line) | 1840 | (beginning-of-line) |
| @@ -1865,7 +1868,7 @@ buffers in filtering group GROUP. | |||
| 1865 | 1868 | ||
| 1866 | FUNCTION is called with two arguments: | 1869 | FUNCTION is called with two arguments: |
| 1867 | the buffer object itself and the current mark symbol." | 1870 | the buffer object itself and the current mark symbol." |
| 1868 | (assert (eq major-mode 'ibuffer-mode)) | 1871 | (ibuffer-assert-ibuffer-mode) |
| 1869 | (ibuffer-forward-line 0) | 1872 | (ibuffer-forward-line 0) |
| 1870 | (let* ((orig-target-line (1+ (count-lines (save-excursion | 1873 | (let* ((orig-target-line (1+ (count-lines (save-excursion |
| 1871 | (goto-char (point-min)) | 1874 | (goto-char (point-min)) |
| @@ -2014,7 +2017,7 @@ the value of point at the beginning of the line for that buffer." | |||
| 2014 | (defun ibuffer-switch-format () | 2017 | (defun ibuffer-switch-format () |
| 2015 | "Switch the current display format." | 2018 | "Switch the current display format." |
| 2016 | (interactive) | 2019 | (interactive) |
| 2017 | (assert (eq major-mode 'ibuffer-mode)) | 2020 | (ibuffer-assert-ibuffer-mode) |
| 2018 | (unless (consp ibuffer-formats) | 2021 | (unless (consp ibuffer-formats) |
| 2019 | (error "Ibuffer error: No formats!")) | 2022 | (error "Ibuffer error: No formats!")) |
| 2020 | (setq ibuffer-current-format | 2023 | (setq ibuffer-current-format |
| @@ -2025,7 +2028,7 @@ the value of point at the beginning of the line for that buffer." | |||
| 2025 | (ibuffer-redisplay t)) | 2028 | (ibuffer-redisplay t)) |
| 2026 | 2029 | ||
| 2027 | (defun ibuffer-update-title-and-summary (format) | 2030 | (defun ibuffer-update-title-and-summary (format) |
| 2028 | (assert (eq major-mode 'ibuffer-mode)) | 2031 | (ibuffer-assert-ibuffer-mode) |
| 2029 | ;; Don't do funky font-lock stuff here | 2032 | ;; Don't do funky font-lock stuff here |
| 2030 | (let ((after-change-functions nil)) | 2033 | (let ((after-change-functions nil)) |
| 2031 | (if (get-text-property (point-min) 'ibuffer-title) | 2034 | (if (get-text-property (point-min) 'ibuffer-title) |
| @@ -2229,7 +2232,7 @@ If optional arg SILENT is non-nil, do not display progress messages." | |||
| 2229 | name))) | 2232 | name))) |
| 2230 | 2233 | ||
| 2231 | (defun ibuffer-redisplay-engine (bmarklist &optional ignore) | 2234 | (defun ibuffer-redisplay-engine (bmarklist &optional ignore) |
| 2232 | (assert (eq major-mode 'ibuffer-mode)) | 2235 | (ibuffer-assert-ibuffer-mode) |
| 2233 | (let* ((--ibuffer-insert-buffers-and-marks-format | 2236 | (let* ((--ibuffer-insert-buffers-and-marks-format |
| 2234 | (ibuffer-current-format)) | 2237 | (ibuffer-current-format)) |
| 2235 | (--ibuffer-expanded-format (mapcar #'ibuffer-expand-format-entry | 2238 | (--ibuffer-expanded-format (mapcar #'ibuffer-expand-format-entry |