Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
92b3528c
Commit
92b3528c
authored
Nov 19, 2016
by
Tino Calancha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ibuffer-exchange-filters: Simplify code
* lisp/ibuf-ext.el (ibuffer-exchange-filters): Use cl-rotatef.
parent
4cdd14ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
lisp/ibuf-ext.el
lisp/ibuf-ext.el
+5
-8
No files found.
lisp/ibuf-ext.el
View file @
92b3528c
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment