[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 92b3528: ibuffer-exchange-filters: Simplify code
From: |
Tino Calancha |
Subject: |
[Emacs-diffs] master 92b3528: ibuffer-exchange-filters: Simplify code |
Date: |
Sat, 19 Nov 2016 11:50:07 +0000 (UTC) |
branch: master
commit 92b3528cf3e6d366086e89b9a909f0c81614a064
Author: Tino Calancha <address@hidden>
Commit: Tino Calancha <address@hidden>
ibuffer-exchange-filters: Simplify code
* lisp/ibuf-ext.el (ibuffer-exchange-filters): Use cl-rotatef.
---
lisp/ibuf-ext.el | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index b3d1452..5ef0746 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -869,14 +869,11 @@ turned into two separate filters [name: foo] and [mode:
bar-mode]."
(defun ibuffer-exchange-filters ()
"Exchange the top two filters on the stack in this buffer."
(interactive)
- (when (< (length ibuffer-filtering-qualifiers)
- 2)
- (error "Need two filters to exchange"))
- (let ((first (pop ibuffer-filtering-qualifiers))
- (second (pop ibuffer-filtering-qualifiers)))
- (push first ibuffer-filtering-qualifiers)
- (push second ibuffer-filtering-qualifiers))
- (ibuffer-update nil t))
+ (let ((filters ibuffer-filtering-qualifiers))
+ (when (< (length filters) 2)
+ (error "Need two filters to exchange"))
+ (cl-rotatef (car filters) (cadr filters))
+ (ibuffer-update nil t)))
;;;###autoload
(defun ibuffer-negate-filter ()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 92b3528: ibuffer-exchange-filters: Simplify code,
Tino Calancha <=