Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
lyskom-elisp-client
lyskom-elisp-client
Commits
450a0d96
Commit
450a0d96
authored
May 30, 2000
by
Johan Sundström
Browse files
Filtering out ugly mail signatures made easy.
parent
40835f51
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/ChangeLog
View file @
450a0d96
2000-05-30 Johan Sundström <jhs@lysator.liu.se>
* view-text.el (lyskom-filter-signature-hook): New function. Would
probably be nice to add as a configuration option too, instead of
being just hookable. :-]
(lyskom-text-is-mail-p): New ad-hoc support function.
* swedish-strings.el, english-strings.el (lyskom-message): Added
the string reformat-signature.
2000-05-29 David Byers <davby@ida.liu.se>
* lyskom-rest.el (lyskom-is-loaded): Don't bind
...
...
src/english-strings.el
View file @
450a0d96
...
...
@@ -1237,6 +1237,8 @@ On since %#8s%#9s")
(reformat-truncated . "
truncated
")
(reformat-signature . "
designed
")
(need-library . "
The
\"%#1s\"
package
is
required
for
this
command.\n
")
(calc-expression . "
Expression:
")
...
...
src/swedish-strings.el
View file @
450a0d96
...
...
@@ -1241,7 +1241,9 @@ Uppkopplad sedan %#8s%#9s")
(reformat-filled . "
ombruten
")
(reformat-truncated . "
nedkortad
")
(reformat-signature . "
avsignerad
")
(need-library . "
Paketet
\"%#1s\"
behvs
fr
att
utfra
detta
kommando.\n
")
(calc-expression . "
Uttryck:
")
...
...
src/view-text.el
View file @
450a0d96
...
...
@@ -334,6 +334,30 @@ Note that this function must not be called asynchronously."
todo
))
(
defun
lyskom-text-is-mail-p
(
text-stat
)
"Ad-hoc test to determine whether a text is a mail by peeking at aux-items."
(
lyskom-match-aux-items
(
text-stat->aux-items
text-stat
)
(
lambda
(
aux-item
)
(
let
((
tag
(
aux-item->tag
aux-item
)))
(
or
(
and
(
>
tag
15
)
; 16:mx-author, 17:mx-from, 18:mx-reply-to,
(
<
tag
22
))
; 19:mx-to, 20:mx-cc, 21:mx-date,
(
=
24
tag
))))))
; 24:mx-headers
(
defun
lyskom-filter-signature-hook
()
"Filter out the signature of imported mail messages. Most useful
when put in your `lyskom-view-text-hook'."
(
unless
(
eq
'kom-review-noconversion
lyskom-current-command
)
(
when
(
lyskom-text-is-mail-p
text-stat
)
(
let*
((
body
(
text->text-mass
text
))
(
sign
(
string-match
"^-- $"
body
)))
(
when
sign
(
set-text->text-mass
text
(
substring
body
0
sign
))
(
lyskom-signal-reformatted-text
'reformat-signature
))))))
;(add-hook 'lyskom-view-text-hook 'lyskom-filter-signature-hook)
(
defun
lyskom-follow-comments
(
text-stat
conf-stat
...
...
Write
Preview
Supports
Markdown
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