summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ibuffer.el33
1 files changed, 16 insertions, 17 deletions
diff --git a/ibuffer.el b/ibuffer.el
index 7f172ac..8d77296 100644
--- a/ibuffer.el
+++ b/ibuffer.el
@@ -39,19 +39,20 @@ If the optional ARG is non-nil, then produce an IBUFFER buffer
(interactive "P")
(cond
((null arg)
- (let ((def (buffer-name
- (car
- (delete nil
- (mapcar
- (lambda (buf)
- (and
- (provided-mode-derived-p
- (buffer-local-value 'major-mode buf)
- (buffer-local-value 'major-mode (current-buffer)))
- (not (= (aref (buffer-name buf) 0) 32))
- (not (eq buf (current-buffer)))
- buf))
- (buffer-list)))))))
+ (let* ((mode (buffer-local-value 'major-mode (current-buffer)))
+ (def (buffer-name
+ (car
+ (delete nil
+ (mapcar
+ (lambda (buf)
+ (and
+ (provided-mode-derived-p
+ (buffer-local-value 'major-mode buf)
+ mode)
+ (not (= (aref (buffer-name buf) 0) 32))
+ (not (eq buf (current-buffer)))
+ buf))
+ (buffer-list)))))))
(switch-to-buffer
(read-buffer (format
"Switch to buffer with major mode %S:"
@@ -62,11 +63,9 @@ If the optional ARG is non-nil, then produce an IBUFFER buffer
(buffer-local-value
'major-mode
(cond ((consp name-or-cons)
- (car name-or-cons))
+ (cdr name-or-cons))
((get-buffer name-or-cons))))
- (buffer-local-value
- 'major-mode
- (current-buffer))))))))
+ mode))))))
((ibuffer
nil
(format "*Buffers for %S*"