Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
15589977
Commit
15589977
authored
Apr 07, 1994
by
Karl Heuer
Browse files
(rmail-sort-by-keywords): New function.
parent
ebdf372b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
lisp/mail/rmailsort.el
lisp/mail/rmailsort.el
+28
-1
No files found.
lisp/mail/rmailsort.el
View file @
15589977
...
...
@@ -3,7 +3,7 @@
;; Copyright (C) 1990, 1993 Free Software Foundation, Inc.
;; Author: Masanobu UMEDA <umerin@mse.kyutech.ac.jp>
;; Version: $Header: /gd/gnu/emacs/19.0/lisp/RCS/rmailsort.el,v 1.
19
1994/03/30 02:2
1:48
kwzh Exp kwzh $
;; Version: $Header: /gd/gnu/emacs/19.0/lisp/RCS/rmailsort.el,v 1.
20
1994/03/30 02:2
4:05
kwzh Exp kwzh $
;; Keywords: mail
;; This file is part of GNU Emacs.
...
...
@@ -109,6 +109,33 @@ If prefix argument REVERSE is non-nil, sort them in reverse order."
(
lambda
(
msg
)
(
count-lines
(
rmail-msgbeg
msg
)
(
rmail-msgend
msg
))))))
(
defun
rmail-sort-by-keywords
(
reverse
labels
)
"Sort messages of current Rmail file by labels.
If prefix argument REVERSE is non-nil, sort them in reverse order.
KEYWORDS is a comma-separated list of labels."
(
interactive
"P\nsSort by labels: "
)
(
or
(
string-match
"[^ \t]"
labels
)
(
error
"No labels specified"
))
(
setq
labels
(
concat
(
substring
labels
(
match-beginning
0
))
","
))
(
let
(
labelvec
)
(
while
(
string-match
"[ \t]*,[ \t]*"
labels
)
(
setq
labelvec
(
cons
(
concat
", ?\\("
(
substring
labels
0
(
match-beginning
0
))
"\\),"
)
labelvec
))
(
setq
labels
(
substring
labels
(
match-end
0
))))
(
setq
labelvec
(
apply
'vector
(
nreverse
labelvec
)))
(
rmail-sort-messages
reverse
(
function
(
lambda
(
msg
)
(
let
((
n
0
))
(
while
(
and
(
<
n
(
length
labelvec
))
(
not
(
rmail-message-labels-p
msg
(
aref
labelvec
n
))))
(
setq
n
(
1+
n
)))
n
))))))
;; Basic functions
...
...
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