]> code.delx.au - gnu-emacs/blobdiff - lisp/ibuf-ext.el
(escape-glyph, minibuffer-prompt, button): Add commentary for
[gnu-emacs] / lisp / ibuf-ext.el
index b7e6741e9d4fe6610f618d6f7dbde160df2ea0b1..bed4330d0c267857b277e6e93e1ae80e0563c162 100644 (file)
@@ -645,16 +645,16 @@ The group will be added to `ibuffer-filter-group-kill-ring'."
   (ibuffer-update nil t))
 
 ;;;###autoload
-(defun ibuffer-kill-line (&optional arg)
+(defun ibuffer-kill-line (&optional arg interactive-p)
   "Kill the filter group at point.
 See also `ibuffer-kill-filter-group'."
-  (interactive "P")
+  (interactive "P\np")
   (ibuffer-aif (save-excursion
                 (ibuffer-forward-line 0)
                 (get-text-property (point) 'ibuffer-filter-group-name))
       (progn
        (ibuffer-kill-filter-group it))
-      (funcall (if (interactive-p) #'call-interactively #'funcall)
+      (funcall (if interactive-p #'call-interactively #'funcall)
               #'kill-line arg)))
 
 (defun ibuffer-insert-filter-group-before (newgroup group)
@@ -1018,7 +1018,8 @@ currently used by buffers."
   (ibuffer-awhen (with-current-buffer buf
                   (or buffer-file-name
                       (and (boundp 'dired-directory)
-                           dired-directory)))
+                           dired-directory
+                           (expand-file-name dired-directory))))
     (string-match qualifier it)))
 
 ;;;###autoload (autoload 'ibuffer-filter-by-size-gt  "ibuf-ext.el")
@@ -1236,53 +1237,51 @@ hidden group filter, open it.
 If `ibuffer-jump-offer-only-visible-buffers' is non-nil, only offer
 visible buffers in the completion list.  Calling the command with
 a prefix argument reverses the meaning of that variable."
-  (interactive (list nil))
-  (let ((only-visible ibuffer-jump-offer-only-visible-buffers))
-    (when current-prefix-arg
-      (setq only-visible (not only-visible)))
-    (if only-visible
-       (let ((table (mapcar #'(lambda (x)
-                                (buffer-name (car x)))
-                            (ibuffer-current-state-list))))
-         (when (null table)
-           (error "No buffers!"))
-         (when (interactive-p)
-           (setq name (completing-read "Jump to buffer: "
-                                       table nil t))))
-      (when (interactive-p)
-       (setq name (read-buffer "Jump to buffer: " nil t))))
-    (when (not (string= "" name))
-      (let (buf-point)
-       ;; Blindly search for our buffer: it is very likely that it is
-       ;; not in a hidden filter group.
-       (ibuffer-map-lines #'(lambda (buf marks)
-                              (when (string= (buffer-name buf) name)
-                                (setq buf-point (point))
-                                nil))
-                          t nil)
-       (when (and
-              (null buf-point)
-              (not (null ibuffer-hidden-filter-groups)))
-         ;; We did not find our buffer.  It must be in a hidden filter
-         ;; group, so go through all hidden filter groups to find it.
-         (catch 'found
-           (dolist (group ibuffer-hidden-filter-groups)
-             (ibuffer-jump-to-filter-group group)
-             (ibuffer-toggle-filter-group)
-             (ibuffer-map-lines #'(lambda (buf marks)
-                                    (when (string= (buffer-name buf) name)
-                                      (setq buf-point (point))
-                                      nil))
-                                t group)
-             (if buf-point
-                 (throw 'found nil)
-               (ibuffer-toggle-filter-group)))))
-       (if (null buf-point)
-           ;; Still not found even though we expanded all hidden filter
-           ;; groups: that must be because it's hidden by predicate:
-           ;; we won't bother trying to display it.
-           (error "No buffer with name %s" name)
-         (goto-char buf-point))))))
+  (interactive (list
+               (let ((only-visible ibuffer-jump-offer-only-visible-buffers))
+                 (when current-prefix-arg
+                   (setq only-visible (not only-visible)))
+                 (if only-visible
+                     (let ((table (mapcar #'(lambda (x)
+                                              (buffer-name (car x)))
+                                          (ibuffer-current-state-list))))
+                       (when (null table)
+                         (error "No buffers!"))
+                       (completing-read "Jump to buffer: "
+                                        table nil t))
+                   (read-buffer "Jump to buffer: " nil t)))))
+  (when (not (string= "" name))
+    (let (buf-point)
+      ;; Blindly search for our buffer: it is very likely that it is
+      ;; not in a hidden filter group.
+      (ibuffer-map-lines #'(lambda (buf marks)
+                            (when (string= (buffer-name buf) name)
+                              (setq buf-point (point))
+                              nil))
+                        t nil)
+      (when (and
+            (null buf-point)
+            (not (null ibuffer-hidden-filter-groups)))
+       ;; We did not find our buffer.  It must be in a hidden filter
+       ;; group, so go through all hidden filter groups to find it.
+       (catch 'found
+         (dolist (group ibuffer-hidden-filter-groups)
+           (ibuffer-jump-to-filter-group group)
+           (ibuffer-toggle-filter-group)
+           (ibuffer-map-lines #'(lambda (buf marks)
+                                  (when (string= (buffer-name buf) name)
+                                    (setq buf-point (point))
+                                    nil))
+                              t group)
+           (if buf-point
+               (throw 'found nil)
+             (ibuffer-toggle-filter-group)))))
+      (if (null buf-point)
+         ;; Still not found even though we expanded all hidden filter
+         ;; groups: that must be because it's hidden by predicate:
+         ;; we won't bother trying to display it.
+         (error "No buffer with name %s" name)
+       (goto-char buf-point)))))
 
 ;;;###autoload
 (defun ibuffer-diff-with-file ()