Skip to content
GitLab
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
434eeae3
Commit
434eeae3
authored
Feb 04, 2002
by
Johan Sundström
Browse files
Texts imported to kom are rarely, if ever, in swascii; do not treat them as such.
parent
5ff963c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ChangeLog
View file @
434eeae3
2002-02-04 Johan Sundström <jhs@lysator.liu.se>
* view-text.el
(lyskom-view-text-convert-ISO-646-SE-to-ISO-8859-1):
Also, don't convert texts created by a mail importer. (The theory
here is that all ol'e farts writing swedish in swascii pursue this
practice only in kom, and that few people writing on mailing lists
imported to kom do.)
2002-01-30 Johan Sundström <jhs@lysator.liu.se>
* view-text.el
...
...
src/view-text.el
View file @
434eeae3
...
...
@@ -425,34 +425,36 @@ when put in your `lyskom-view-text-hook'."
;(add-hook 'lyskom-view-text-hook 'lyskom-filter-signature-hook)
(
defun
lyskom-view-text-convert-ISO-646-SE-to-ISO-8859-1
()
"Display r{ksm|rg}s as räksmörgås (unless \"å o\"; converting
][\\}{| but not ^~@`. Yet another useful function to put in your
`lyskom-view-text-hook'."
;; First the hard part - should we patch the text
;; in the text object?
(
if
(
not
(
equal
lyskom-current-command
'kom-review-noconversion
))
;; Yes, modify the text from the text-object (stored in mod)
(
let*
((
mod
(
aref
(
cdr
lyskom-view-text-text
)
1
))
(
brk
(
string-match
"\n"
mod
))
(
sbj
(
if
brk
(
substring
mod
0
brk
)
mod
))
(
txt
(
if
brk
(
substring
mod
(
1+
brk
))
""
))
(
tbl
'
((
?\]
.
?\305
)
; Å
(
?\[
.
?\304
)
; Ä
(
?\\
.
?\326
)
; Ö
(
?\}
.
?\345
)
; å
(
?\{
.
?\344
)
; ä
(
?\|
.
?\366
))))
; ö
(
when
(
and
(
not
(
string-match
"[\200-\377]"
txt
))
(
or
(
string-match
"[A-Za-z][][\\}{|]"
txt
)
(
string-match
"[][\\}{|][A-Za-z]"
txt
)
(
string-match
"[A-Za-z] +[][\\}{|]"
txt
)))
(
lyskom-signal-reformatted-text
'reformat-deswascii
)
(
while
(
string-match
"\\([][\\}{|]\\)"
txt
)
(
let
((
old-char
(
aref
(
match-string
1
txt
)
0
)))
(
aset
txt
(
match-beginning
1
)
(
cdr
(
assoc
old-char
tbl
)))))
(
aset
(
cdr
lyskom-view-text-text
)
1
(
if
brk
(
concat
sbj
"\n"
txt
)
sbj
))))))
"Display r{ksm|rg}s as räksmörgås unless the text is an imported mail
or we are reviewing without conversion. In other words, the characters
][\\}{| are converted, however ^~@` are not. Yet another useful function
to put in your `lyskom-view-text-hook'."
;; First the hard part - should we patch the text
;; in the text object?
(
unless
(
or
(
equal
lyskom-current-command
'kom-review-noconversion
)
(
lyskom-text-is-mail-p
lyskom-view-text-text-stat
))
;; Yes, modify the text from the text-object (stored in mod)
(
let*
((
mod
(
aref
(
cdr
lyskom-view-text-text
)
1
))
(
brk
(
string-match
"\n"
mod
))
(
sbj
(
if
brk
(
substring
mod
0
brk
)
mod
))
(
txt
(
if
brk
(
substring
mod
(
1+
brk
))
""
))
(
tbl
'
((
?\]
.
?\305
)
; Å
(
?\[
.
?\304
)
; Ä
(
?\\
.
?\326
)
; Ö
(
?\}
.
?\345
)
; å
(
?\{
.
?\344
)
; ä
(
?\|
.
?\366
))))
; ö
(
when
(
and
(
not
(
string-match
"[\200-\377]"
txt
))
(
or
(
string-match
"[A-Za-z][][\\}{|]"
txt
)
(
string-match
"[][\\}{|][A-Za-z]"
txt
)
(
string-match
"[A-Za-z] +[][\\}{|]"
txt
)))
(
lyskom-signal-reformatted-text
'reformat-deswascii
)
(
while
(
string-match
"\\([][\\}{|]\\)"
txt
)
(
let
((
old-char
(
aref
(
match-string
1
txt
)
0
)))
(
aset
txt
(
match-beginning
1
)
(
cdr
(
assoc
old-char
tbl
)))))
(
aset
(
cdr
lyskom-view-text-text
)
1
(
if
brk
(
concat
sbj
"\n"
txt
)
sbj
))))))
;(add-hook 'lyskom-view-text-hook 'lyskom-view-text-convert-ISO-646-SE-to-ISO-8859-1)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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