645 |
(ibuffer-update nil t)) |
(ibuffer-update nil t)) |
646 |
|
|
647 |
;;;###autoload |
;;;###autoload |
648 |
(defun ibuffer-kill-line (&optional arg) |
(defun ibuffer-kill-line (&optional arg interactive-p) |
649 |
"Kill the filter group at point. |
"Kill the filter group at point. |
650 |
See also `ibuffer-kill-filter-group'." |
See also `ibuffer-kill-filter-group'." |
651 |
(interactive "P") |
(interactive "P\np") |
652 |
(ibuffer-aif (save-excursion |
(ibuffer-aif (save-excursion |
653 |
(ibuffer-forward-line 0) |
(ibuffer-forward-line 0) |
654 |
(get-text-property (point) 'ibuffer-filter-group-name)) |
(get-text-property (point) 'ibuffer-filter-group-name)) |
655 |
(progn |
(progn |
656 |
(ibuffer-kill-filter-group it)) |
(ibuffer-kill-filter-group it)) |
657 |
(funcall (if (interactive-p) #'call-interactively #'funcall) |
(funcall (if interactive-p #'call-interactively #'funcall) |
658 |
#'kill-line arg))) |
#'kill-line arg))) |
659 |
|
|
660 |
(defun ibuffer-insert-filter-group-before (newgroup group) |
(defun ibuffer-insert-filter-group-before (newgroup group) |
1237 |
If `ibuffer-jump-offer-only-visible-buffers' is non-nil, only offer |
If `ibuffer-jump-offer-only-visible-buffers' is non-nil, only offer |
1238 |
visible buffers in the completion list. Calling the command with |
visible buffers in the completion list. Calling the command with |
1239 |
a prefix argument reverses the meaning of that variable." |
a prefix argument reverses the meaning of that variable." |
1240 |
(interactive (list nil)) |
(interactive (list |
1241 |
(let ((only-visible ibuffer-jump-offer-only-visible-buffers)) |
(let ((only-visible ibuffer-jump-offer-only-visible-buffers)) |
1242 |
(when current-prefix-arg |
(when current-prefix-arg |
1243 |
(setq only-visible (not only-visible))) |
(setq only-visible (not only-visible))) |
1244 |
(if only-visible |
(if only-visible |
1245 |
(let ((table (mapcar #'(lambda (x) |
(let ((table (mapcar #'(lambda (x) |
1246 |
(buffer-name (car x))) |
(buffer-name (car x))) |
1247 |
(ibuffer-current-state-list)))) |
(ibuffer-current-state-list)))) |
1248 |
(when (null table) |
(when (null table) |
1249 |
(error "No buffers!")) |
(error "No buffers!")) |
1250 |
(when (interactive-p) |
(completing-read "Jump to buffer: " |
1251 |
(setq name (completing-read "Jump to buffer: " |
table nil t)) |
1252 |
table nil t)))) |
(read-buffer "Jump to buffer: " nil t))))) |
1253 |
(when (interactive-p) |
(when (not (string= "" name)) |
1254 |
(setq name (read-buffer "Jump to buffer: " nil t)))) |
(let (buf-point) |
1255 |
(when (not (string= "" name)) |
;; Blindly search for our buffer: it is very likely that it is |
1256 |
(let (buf-point) |
;; not in a hidden filter group. |
1257 |
;; Blindly search for our buffer: it is very likely that it is |
(ibuffer-map-lines #'(lambda (buf marks) |
1258 |
;; not in a hidden filter group. |
(when (string= (buffer-name buf) name) |
1259 |
(ibuffer-map-lines #'(lambda (buf marks) |
(setq buf-point (point)) |
1260 |
(when (string= (buffer-name buf) name) |
nil)) |
1261 |
(setq buf-point (point)) |
t nil) |
1262 |
nil)) |
(when (and |
1263 |
t nil) |
(null buf-point) |
1264 |
(when (and |
(not (null ibuffer-hidden-filter-groups))) |
1265 |
(null buf-point) |
;; We did not find our buffer. It must be in a hidden filter |
1266 |
(not (null ibuffer-hidden-filter-groups))) |
;; group, so go through all hidden filter groups to find it. |
1267 |
;; We did not find our buffer. It must be in a hidden filter |
(catch 'found |
1268 |
;; group, so go through all hidden filter groups to find it. |
(dolist (group ibuffer-hidden-filter-groups) |
1269 |
(catch 'found |
(ibuffer-jump-to-filter-group group) |
1270 |
(dolist (group ibuffer-hidden-filter-groups) |
(ibuffer-toggle-filter-group) |
1271 |
(ibuffer-jump-to-filter-group group) |
(ibuffer-map-lines #'(lambda (buf marks) |
1272 |
(ibuffer-toggle-filter-group) |
(when (string= (buffer-name buf) name) |
1273 |
(ibuffer-map-lines #'(lambda (buf marks) |
(setq buf-point (point)) |
1274 |
(when (string= (buffer-name buf) name) |
nil)) |
1275 |
(setq buf-point (point)) |
t group) |
1276 |
nil)) |
(if buf-point |
1277 |
t group) |
(throw 'found nil) |
1278 |
(if buf-point |
(ibuffer-toggle-filter-group))))) |
1279 |
(throw 'found nil) |
(if (null buf-point) |
1280 |
(ibuffer-toggle-filter-group))))) |
;; Still not found even though we expanded all hidden filter |
1281 |
(if (null buf-point) |
;; groups: that must be because it's hidden by predicate: |
1282 |
;; Still not found even though we expanded all hidden filter |
;; we won't bother trying to display it. |
1283 |
;; groups: that must be because it's hidden by predicate: |
(error "No buffer with name %s" name) |
1284 |
;; we won't bother trying to display it. |
(goto-char buf-point))))) |
|
(error "No buffer with name %s" name) |
|
|
(goto-char buf-point)))))) |
|
1285 |
|
|
1286 |
;;;###autoload |
;;;###autoload |
1287 |
(defun ibuffer-diff-with-file () |
(defun ibuffer-diff-with-file () |