Commit 5ff963c6 authored by Johan Sundström's avatar Johan Sundström
Browse files

Added Zeuges deswascii hook.

parent 7b1345c9
2002-01-30 Johan Sundström <jhs@lysator.liu.se>
* view-text.el
(lyskom-view-text-convert-ISO-646-SE-to-ISO-8859-1): New function
that, when put in `lyskom-view-text-hook', rewrites }{| as åäö in
read texts. Mostly written by Klaus Zeuge.
* swedish-strings.el, english-strings.el (lyskom-message): Added
the string `reformat-deswascii'.
2002-01-21 Ulrik Haugen <qha@lysator.liu.se>
* vars.el.in (lyskom-text-buttons): Changed the regexps for conf-,
......
......@@ -1332,6 +1332,8 @@ On since %#8s%#9s")
(reformat-signature . "designed")
(reformat-deswascii . "was swascii")
(need-library . "The \"%#1s\" package is required for this command.\n")
(calc-expression . "Expression: ")
......
......@@ -1330,6 +1330,8 @@ Uppkopplad sedan %#8s%#9s")
(reformat-signature . "avsignerad")
(reformat-deswascii . "var swascii")
(need-library . "Paketet \"%#1s\" behvs fr att utfra detta kommando.\n")
(calc-expression . "Uttryck: ")
......
......@@ -424,10 +424,42 @@ when put in your `lyskom-view-text-hook'."
;(add-hook 'lyskom-view-text-hook 'lyskom-filter-signature-hook)
(defun lyskom-follow-comments (text-stat conf-stat
(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))))))
;(add-hook 'lyskom-view-text-hook 'lyskom-view-text-convert-ISO-646-SE-to-ISO-8859-1)
(defun lyskom-follow-comments (text-stat conf-stat
mark-as-read priority review-tree)
"Arrange so that all comments and footnotes to this text will be read.
This will essentially fix the reading list and issue calls for the cache to be
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment