Commit 9e7ac792 authored by Pontus Freyhult's avatar Pontus Freyhult

Applied patch from calle@lysator.liu.se, fixes bug 1487:

* english-strings.el (lyskom-message): Added reformat-rot13,
review-rot13-q and lyskom-button-review-rot13-action.
(lyskom-command): Added kom-review-rot13.

* swedish-strings.el (lyskom-message): Added reformat-rot13,
review-rot13-q and lyskom-button-review-rot13-action.
(lyskom-command): Added kom-review-rot13.

* view-text.el (lyskom-rot13-string): New function.
(lyskom-filter-rot13): Dito.

* lyskom-buttons.el (lyskom-button-review-rot13): New button
action.

* menus.el (lyskom-menu-template): Added kom-review-rot13.

* review.el (kom-review-rot13): New function.

* vars.el.in (lyskom-button-actions): Added rot13 review action.
(lyskom-commands): Added kom-review-rot13.
parent cef311bf
2005-01-11 Pontus Freyhult <pont@soua.net>
Applied patch from calle@lysator.liu.se, fixes bug 1487:
* english-strings.el (lyskom-message): Added reformat-rot13,
review-rot13-q and lyskom-button-review-rot13-action.
(lyskom-command): Added kom-review-rot13.
* swedish-strings.el (lyskom-message): Added reformat-rot13,
review-rot13-q and lyskom-button-review-rot13-action.
(lyskom-command): Added kom-review-rot13.
* view-text.el (lyskom-rot13-string): New function.
(lyskom-filter-rot13): Dito.
* lyskom-buttons.el (lyskom-button-review-rot13): New button
action.
* menus.el (lyskom-menu-template): Added kom-review-rot13.
* review.el (kom-review-rot13): New function.
* vars.el.in (lyskom-button-actions): Added rot13 review action.
(lyskom-commands): Added kom-review-rot13.
Fix for bug 1491:
* english-strings.el, swedish-strings.el:
(lyskom-custom-strings): Added kom-relogin-inhibit-commands-tag
and kom-relogin-inhibit-commands-doc.
......
......@@ -1486,6 +1486,8 @@ On since %#8s%#9s")
(reformat-deswascii . "was swascii")
(reformat-rot13 . "rot13")
(need-library . "The \"%#1s\" package is required for this command.\n")
(calc-expression . "Expression: ")
......@@ -1717,6 +1719,7 @@ You must become an active member of the conference to enter it.\n")
(review-converted-q . "Review which text converted?")
(review-noconversion-q . "Review which text unconverted?")
(review-rot13-q . "Review which text in rot13?")
(unread-commented-q . "Mark the commented for which text as unread?")
(review-commented-q . "Review the commented for which text?")
......@@ -1776,6 +1779,7 @@ You must become an active member of the conference to enter it.\n")
(lyskom-button-copy-text-no-action . "Copy text number")
(lyskom-button-review-converted-action . "Review converted")
(lyskom-button-review-noconversion-action . "Review unconverted")
(lyskom-button-review-rot13-action . "Review rot13")
(lyskom-button-find-root-review-action . "Review tree")
(lyskom-button-find-root-action . "Review root text")
(lyskom-button-comment-text-action . "Write comment")
......@@ -2192,6 +2196,7 @@ Change privileges for %#1P (%#1p)...")
. "Review all cross references")
(kom-review-converted . "Review converted")
(kom-review-noconversion . "Review unconverted")
(kom-review-rot13 . "Review rot13")
(kom-review-next . "Review next")
(kom-find-root . "Review original (text)")
(kom-review-by-to . "Review last")
......@@ -2791,6 +2796,7 @@ Change privileges for %#1P (%#1p)...")
(define-key lyskom-en-review-prefix (kbd "n") 'kom-review-next)
(define-key lyskom-en-review-prefix (kbd "u") 'kom-review-noconversion)
(define-key lyskom-en-review-prefix (kbd "v") 'kom-review-converted)
(define-key lyskom-en-review-prefix (kbd "3") 'kom-review-rot13)
(define-key lyskom-en-review-prefix (kbd "o") 'kom-find-root)
(define-key lyskom-en-review-prefix (kbd "l") 'kom-review-by-to)
(define-key lyskom-en-review-prefix (kbd "f") 'kom-review-first)
......
......@@ -710,6 +710,14 @@ Last argument TEXT is ignored. This is a LysKOM button action."
(goto-char (point-max))
(kom-review-converted arg))))
(defun lyskom-button-review-rot13 (buf arg text)
"In the LysKOM buffer BUF, view the text ARG rot13:ed.
Last argument TEXT is ignored. This is a LysKOM button action."
(cond ((not (integerp arg)) nil)
(t (pop-to-buffer buf)
(goto-char (point-max))
(kom-review-rot13 arg))))
(defun lyskom-button-find-root-review (buf arg text)
"In the LysKOM buffer BUF, view the text ARG. Last argument TEXT is ignored.
This is a LysKOM button action."
......
......@@ -58,6 +58,7 @@
(item kom-review-last-normally-read)
(item kom-review-noconversion)
(item kom-review-converted)
(item kom-review-rot13)
(item kom-review-mail-headers)
(hline)
(item kom-find-root)
......
......@@ -1773,9 +1773,22 @@ This command accepts text number prefix arguments \(see
(lyskom-view-text text-no))
(lyskom-insert 'confusion-what-to-view)))
;;; ============================================================
;;; terse rot13 - Review a text rot13:ed
(def-kom-command kom-review-rot13 (text-no)
"Displays the selected text rot13:ed.
This command accepts text number prefix arguments \(see
`lyskom-read-text-no-prefix-arg')."
(interactive (list (lyskom-read-text-no-prefix-arg 'review-rot13-q)))
(if text-no
(let ((kom-view-text-hook kom-view-text-hook))
(unless kom-review-uses-cache (cache-del-text-stat text-no))
(add-hook 'kom-view-text-hook 'lyskom-filter-rot13 nil t)
(lyskom-view-text text-no)
)
(lyskom-insert 'confusion-what-to-view)))
(defun lyskom-review-get-priority ()
"Get the priority to use for reviewing texts."
......
......@@ -1528,6 +1528,8 @@ Uppkopplad sedan %#8s%#9s")
(reformat-deswascii . "var swascii")
(reformat-rot13 . "rot13")
(need-library . "Paketet \"%#1s\" behvs fr att utfra detta kommando.\n")
(calc-expression . "Uttryck: ")
......@@ -1760,6 +1762,7 @@ Du m
(review-converted-q . "terse vilket inlgg konverterat?")
(review-noconversion-q . "terse vilket inlgg omodifierat?")
(review-rot13-q . "terse vilket inlgg i rot13?")
(unread-commented-q . "Olsmarkera vilket inlggs kommenterade?")
(review-commented-q . "terse vilket inlgg kommenterade?")
(unread-tree-q . "Olsmarkera alla kommentarer rekursivt fr vilket inlgg?")
......@@ -1819,6 +1822,7 @@ Du m
(lyskom-button-copy-text-no-action . "Kopiera inlggsnumret")
(lyskom-button-review-converted-action . "terse konverterat")
(lyskom-button-review-noconversion-action . "terse omodifierat")
(lyskom-button-review-rot13-action . "terse rot13")
(lyskom-button-find-root-review-action . "terse trd")
(lyskom-button-find-root-action . "terse urinlgget")
(lyskom-button-comment-text-action . "Kommentera texten")
......@@ -2227,6 +2231,7 @@ Nuvarande r
. "terse alla korsreferenser")
(kom-review-converted . "terse konverterat")
(kom-review-noconversion . "terse omodifierat")
(kom-review-rot13 . "terse rot13")
(kom-review-next . "terse nsta")
(kom-find-root . "terse urinlgget")
(kom-review-by-to . "terse senaste")
......@@ -2894,6 +2899,7 @@ Nuvarande r
(define-key lyskom-sv-review-prefix (kbd "n") 'kom-review-next)
(define-key lyskom-sv-review-prefix (kbd "o") 'kom-review-noconversion)
(define-key lyskom-sv-review-prefix (kbd "v") 'kom-review-converted)
(define-key lyskom-sv-review-prefix (kbd "3") 'kom-review-rot13)
(define-key lyskom-sv-review-prefix (kbd "r") 'kom-find-root)
(define-key lyskom-sv-review-prefix (kbd "u") 'kom-find-root)
(define-key lyskom-sv-review-prefix (kbd "s") 'kom-review-by-to)
......
......@@ -3088,6 +3088,7 @@ Values other than `nil' and strings are reserved for future use."
(lyskom-button-copy-text-no-action . lyskom-button-copy-text-no)
(lyskom-button-review-noconversion-action . lyskom-button-review-noconversion)
(lyskom-button-review-converted-action . lyskom-button-review-converted)
(lyskom-button-review-rot13-action . lyskom-button-review-rot13)
(lyskom-button-find-root-review-action . lyskom-button-find-root-review)
(lyskom-button-find-root-action . lyskom-button-find-root)
(lyskom-button-review-comments-action . lyskom-button-review-comments)
......@@ -3457,6 +3458,7 @@ Users are encouraged to use their best sense of humor."
kom-review-last-normally-read
kom-review-noconversion
kom-review-converted
kom-review-rot13
kom-review-next
kom-find-root
kom-review-by-to
......
......@@ -419,8 +419,28 @@ when put in your `kom-view-text-hook'."
(set-text->text-mass lyskom-view-text-text (substring body 0 sign))
(lyskom-signal-reformatted-text 'reformat-signature))))))
;(add-hook 'kom-view-text-hook 'lyskom-filter-signature-hook)
; review-rot13
(defun lyskom-rot13-string (s)
(mapconcat
(lambda (c)
(cond
((and (>= c ?a) (<= c ?z)) (string (+ ?a (% (+ 13 (- c ?a)) 26))))
((and (>= c ?A) (<= c ?Z)) (string (+ ?A (% (+ 13 (- c ?A)) 26))))
(t (string c))))
s ""))
(defun lyskom-filter-rot13 ()
"Encrypts everything with rot-13. Least useless when put in your `kom-view-text-hook'."
(set-text->text-mass lyskom-view-text-text
(lyskom-rot13-string
(text->text-mass lyskom-view-text-text)))
(lyskom-signal-reformatted-text 'reformat-rot13))
(defun lyskom-view-text-convert-ISO-646-SE-to-ISO-8859-1 ()
"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
......
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