]> git.eshelyaron.com Git - emacs.git/commitdiff
(ibuffer-jump-to-buffer): Read buffer name in interactive spec rather
authorJohn Paul Wallington <jpw@pobox.com>
Sat, 23 Oct 2004 10:11:17 +0000 (10:11 +0000)
committerJohn Paul Wallington <jpw@pobox.com>
Sat, 23 Oct 2004 10:11:17 +0000 (10:11 +0000)
than use `interactive-p' in body of function.

lisp/ChangeLog
lisp/ibuf-ext.el

index a57b30a6eeabb1f668f380a98f76fad7cb9cf123..ee96dcb151635a13ec6dea8218dac79d6ea4f01d 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-23  John Paul Wallington  <jpw@gnu.org>
+
+       * ibuf-ext.el (ibuffer-jump-to-buffer): Read buffer name in
+       interactive spec rather than use `interactive-p' in body of
+       function.
+
 2004-10-22  Kenichi Handa  <handa@m17n.org>
 
        * international/mule.el (translate-region): Implement it in Lisp
index 5d24964362a7bcdc851f7d3a4ea31e93f200ab81..1c77e409ae4e4f5fa67869b40553d6faa70db5ec 100644 (file)
@@ -1237,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 ()