Commit 523c4b2f authored by David Byers's avatar David Byers
Browse files

Fixed bugs 1086, 281

parent 3b2b455e
2007-07-11 <David Byers@GULAG>
Fix bug 281:
* vars.el.in (lyskom-format-special): Cover all IANA mime type
allocations, and include fallback for anything unknown.
* lyskom-rest.el (lyskom-text-stat-content-type): New function.
(lyskom-format-audio): New function.
(lyskom-format-video): New function.
(lyskom-format-multipart): New function.
(lyskom-format-message): New function.
(lyskom-format-model): New function.
(lyskom-format-application): New function.
(lyskom-format-image): Show content type when failing to show image.
(lyskom-format-unknown): New function.
* view-text.el (lyskom-format-text-footer): Allow strings as format flags.
* vars.el.in (kom-respect-ancient-content-types): New variable.
* lyskom-rest.el (lyskom-format-text-body): Don't get content type
from text body unless kom-respect-ancient-content-types is
non-nil.
Fix bug 818:
* startup.el (lyskom-read-server-name): Use programmed completion.
(lyskom-complete-server-name): Programmed completion function for
......
......@@ -3512,6 +3512,7 @@ See `kom-confirm-add-recipients'.
This command accepts text number prefix arguments (see
`lyskom-read-text-no-prefix-arg')."
(interactive (list (lyskom-read-text-no-prefix-arg 'text-to-add-recipient)))
(setq text-no (lyskom-add-sub-adjust-text-no text-no 'add-roots-q))
(lyskom-add-helper text-no
'who-to-add-q
'adding-name-as-recipient
......@@ -3527,6 +3528,7 @@ See `kom-confirm-add-recipients'.
This command accepts text number prefix arguments (see
`lyskom-read-text-no-prefix-arg')."
(interactive (list (lyskom-read-text-no-prefix-arg 'text-to-add-copy)))
(setq text-no (lyskom-add-sub-adjust-text-no text-no 'add-roots-q))
(lyskom-add-helper text-no
'who-to-add-copy-q
'adding-name-as-copy
......@@ -3542,34 +3544,46 @@ See `kom-confirm-add-recipients'.
This command accepts text number prefix arguments (see
`lyskom-read-text-no-prefix-arg')."
(interactive (list (lyskom-read-text-no-prefix-arg 'text-to-add-bcc)))
(setq text-no (lyskom-add-sub-adjust-text-no text-no 'add-roots-q))
(lyskom-add-helper text-no
'who-to-add-bcc-q
'adding-name-as-copy
'BCC-RECPT))
(defun lyskom-add-helper (text-no who-prompt doing-prompt type)
(let* ((text-stat (blocking-do 'get-text-stat text-no))
(attachments (lyskom-attachments-for-sub text-no))
(footnotes (lyskom-footnotes-for-sub text-no))
(move-footnotes nil)
(move-attachments nil)
(target (lyskom-read-conf-stat who-prompt '(all) nil nil t)))
(when (and target text-no)
(when (and (eq type 'RECPT)
kom-confirm-add-recipients
(not (lyskom-j-or-n-p
(lyskom-format 'really-add-as-recpt-q target))))
(setq type 'CC-RECPT doing-prompt 'adding-name-as-copy))
(setq move-footnotes (and footnotes (lyskom-j-or-n-p 'add-footnotes-too-q)))
(setq move-attachments (and attachments (lyskom-j-or-n-p 'add-attachments-too-q)))
(lyskom-traverse text (append (list (cons text-no text-stat))
(and move-footnotes footnotes)
(and move-attachments attachments))
(lyskom-format-insert doing-prompt target (car text))
(lyskom-move-recipient (car text) nil target type)))))
(defun lyskom-add-sub-adjust-text-no (text-no prompt)
"If TEXT-NO is a footnote or attachment, ask if user wants to operate on root instead."
(let ((roots (lyskom-get-root-text-belongs-to (blocking-do 'get-text-stat text-no) t)))
(cond ((null roots) (list text-no))
((and (null (cdr roots))
(eq text-no (car roots))) roots)
((j-or-n-p (lyskom-format prompt text-no (car roots) (cdr roots))) roots)
(t (list text-no)))))
(defun lyskom-add-helper (text-nos who-prompt doing-prompt type)
(let ((initial-dest nil))
(lyskom-traverse text-no text-nos
(let* ((text-stat (blocking-do 'get-text-stat text-no))
(attachments (lyskom-attachments-for-sub text-no))
(footnotes (lyskom-footnotes-for-sub text-no))
(move-footnotes nil)
(move-attachments nil)
(target (lyskom-read-conf-stat (lyskom-format who-prompt text-no) '(all) nil initial-dest t)))
(when (and target text-no)
(setq initial-dest (conf-stat->name target))
(when (and (eq type 'RECPT)
kom-confirm-add-recipients
(not (lyskom-j-or-n-p
(lyskom-format 'really-add-as-recpt-q target))))
(setq type 'CC-RECPT doing-prompt 'adding-name-as-copy))
(setq move-footnotes (and footnotes (lyskom-j-or-n-p 'add-footnotes-too-q)))
(setq move-attachments (and attachments (lyskom-j-or-n-p 'add-attachments-too-q)))
(lyskom-traverse text (append (list (cons text-no text-stat))
(and move-footnotes footnotes)
(and move-attachments attachments))
(lyskom-format-insert doing-prompt target (car text))
(lyskom-move-recipient (car text) nil target type)))))))
(defun lyskom-footnotes-for-sub (text-no)
"Return the list of footnotes to remove recipient from."
......@@ -3611,37 +3625,40 @@ the last recipient, since this will make the text unreadable.
This command accepts text number prefix arguments (see
`lyskom-read-text-no-prefix-arg')."
(interactive (list (lyskom-read-text-no-prefix-arg 'text-to-delete-recipient)))
(let* ((text-stat (blocking-do 'get-text-stat text-no))
(attachments (lyskom-attachments-for-sub text-no))
(footnotes (lyskom-footnotes-for-sub text-no))
(move-footnotes nil)
(move-attachments nil))
(if text-stat
(let ((recipients
(sort (lyskom-text-recipients text-stat t)
(lambda (a b)
(> (length (memq (cdr a) lyskom-recpt-types-list))
(length (memq (cdr b) lyskom-recpt-types-list)))))))
(if recipients
(let* ((source (lyskom-read-conf-stat
'who-to-sub-q
(list (cons 'restrict (mapcar 'car recipients)))
nil
nil
t)))
(when source
(setq move-footnotes (and footnotes (lyskom-j-or-n-p 'sub-footnotes-too-q)))
(setq move-attachments (and attachments (lyskom-j-or-n-p 'sub-attachments-too-q)))
(lyskom-traverse text (append (list (cons text-no text-stat))
(and move-footnotes footnotes)
(and move-attachments attachments))
(lyskom-format-insert 'remove-name-as-recipient source (cdr text))
(if (memq (conf-stat->conf-no source) (lyskom-text-recipients (cdr text)))
(lyskom-move-recipient (car text) source nil nil)
(lyskom-insert 'move-text-not-recipient)))))
(lyskom-format-insert 'text-has-no-recipients-r text-no)))
(lyskom-format-insert 'no-such-text-no text-no))))
(let ((initial-source nil))
(lyskom-traverse text-no (lyskom-add-sub-adjust-text-no text-no 'sub-roots-q)
(let* ((text-stat (blocking-do 'get-text-stat text-no))
(attachments (lyskom-attachments-for-sub text-no))
(footnotes (lyskom-footnotes-for-sub text-no))
(move-footnotes nil)
(move-attachments nil))
(if text-stat
(let ((recipients
(sort (lyskom-text-recipients text-stat t)
(lambda (a b)
(> (length (memq (cdr a) lyskom-recpt-types-list))
(length (memq (cdr b) lyskom-recpt-types-list)))))))
(if recipients
(let* ((source (lyskom-read-conf-stat
(lyskom-format 'who-to-sub-q text-no)
(list (cons 'restrict (mapcar 'car recipients)))
nil
initial-source
t)))
(when source
(setq initial-source (conf-stat->name source))
(setq move-footnotes (and footnotes (lyskom-j-or-n-p 'sub-footnotes-too-q)))
(setq move-attachments (and attachments (lyskom-j-or-n-p 'sub-attachments-too-q)))
(lyskom-traverse text (append (list (cons text-no text-stat))
(and move-footnotes footnotes)
(and move-attachments attachments))
(lyskom-format-insert 'remove-name-as-recipient source (cdr text))
(if (memq (conf-stat->conf-no source) (lyskom-text-recipients (cdr text)))
(lyskom-move-recipient (car text) source nil nil)
(lyskom-insert 'move-text-not-recipient)))))
(lyskom-format-insert 'text-has-no-recipients-r text-no)))
(lyskom-format-insert 'no-such-text-no text-no))))))
(def-kom-command kom-move-text (text-no)
......@@ -3657,42 +3674,56 @@ CONTINUATION is the function that does the actual moving. It is called
with three arguments: source, target and text-stat, where source is the
recipient to remove and target the recipient to add to text-stat."
(interactive (list (lyskom-read-text-no-prefix-arg 'text-to-move)))
(let* ((text-stat (blocking-do 'get-text-stat text-no))
(attachments (lyskom-attachments-for-sub text-no))
(footnotes (lyskom-footnotes-for-sub text-no))
(move-footnotes nil)
(move-attachments nil))
(if (null text-stat)
(lyskom-format-insert 'no-such-text-no text-no)
(let* ((recipients (sort (lyskom-text-recipients text-stat t)
(lambda (a b)
(> (length (memq (cdr a) lyskom-recpt-types-list))
(length (memq (cdr b) lyskom-recpt-types-list)))))))
(if (null recipients)
(lyskom-format-insert 'text-has-no-recipients-r text-no)
(let ((source (lyskom-read-conf-stat
'who-to-move-from-q
(list (cons 'restrict (mapcar 'car recipients)))
nil nil t))
(target (lyskom-read-conf-stat 'who-to-move-to-q '(all)
nil nil t)))
(when (and source target)
(if (eq (conf-stat->conf-no source)
(conf-stat->conf-no target))
(lyskom-insert-before-prompt 'cant-move-from-to-same)
(setq move-footnotes (and footnotes (lyskom-j-or-n-p 'move-footnotes-too-q)))
(setq move-attachments (and attachments (lyskom-j-or-n-p 'move-attachments-too-q)))
(lyskom-traverse text (append (list (cons text-no text-stat))
(and move-footnotes footnotes)
(and move-attachments attachments))
(if (null (cdr text))
(lyskom-format-insert 'moving-cant-read (car text))
(lyskom-format-insert 'moving-name source target (cdr text))
(if (memq (conf-stat->conf-no source) (lyskom-text-recipients (cdr text)))
(lyskom-move-recipient (car text) source target 'RECPT)
(lyskom-insert 'move-text-not-recipient))
))))))))))
(let (initial-from initial-to)
(lyskom-traverse text-no (lyskom-add-sub-adjust-text-no text-no 'move-roots-q)
(let* ((text-stat (blocking-do 'get-text-stat text-no))
(attachments (lyskom-attachments-for-sub text-no))
(footnotes (lyskom-footnotes-for-sub text-no))
(move-footnotes nil)
(move-attachments nil))
(if (null text-stat)
(lyskom-format-insert 'no-such-text-no text-no)
(let* ((recipients (sort (lyskom-text-recipients text-stat t)
(lambda (a b)
(> (length (memq (cdr a) lyskom-recpt-types-list))
(length (memq (cdr b) lyskom-recpt-types-list)))))))
(if (null recipients)
(lyskom-format-insert 'text-has-no-recipients-r text-no)
(let ((source (lyskom-read-conf-stat
(lyskom-format 'who-to-move-from-q text-no)
(list (cons 'restrict (mapcar 'car recipients)))
nil
(uconf-stat->name
(cond ((and (cdr recipients)
(assq initial-from recipients))
(blocking-do 'get-uconf-stat initial-from))
((cdr recipients) nil)
(t (blocking-do 'get-uconf-stat (car (car recipients))))))
t))
(target (lyskom-read-conf-stat (lyskom-format 'who-to-move-to-q text-no)
'(all)
nil
initial-to
t)))
(when (and source target)
(setq initial-from (conf-stat->conf-no source)
initial-to (conf-stat->name target))
(if (eq (conf-stat->conf-no source)
(conf-stat->conf-no target))
(lyskom-insert-before-prompt 'cant-move-from-to-same)
(setq move-footnotes (and footnotes (lyskom-j-or-n-p 'move-footnotes-too-q)))
(setq move-attachments (and attachments (lyskom-j-or-n-p 'move-attachments-too-q)))
(lyskom-traverse text (append (list (cons text-no text-stat))
(and move-footnotes footnotes)
(and move-attachments attachments))
(if (null (cdr text))
(lyskom-format-insert 'moving-cant-read (car text))
(lyskom-format-insert 'moving-name source target (cdr text))
(if (memq (conf-stat->conf-no source) (lyskom-text-recipients (cdr text)))
(lyskom-move-recipient (car text) source target 'RECPT)
(lyskom-insert 'move-text-not-recipient))
))))))))))))
(def-kom-command kom-move-text-tree (text-no)
......
......@@ -440,6 +440,9 @@ and you have finished reading. Please come back later.
(active-last . "Active last")
(active . "Active")
(lyskom-client . "Client")
(move-roots-q . "Text %#1n is a footnote/attachment. Move %#2n%#3?b%[ et al.%]%[%] instead? ")
(add-roots-q . "Text %#1n is a footnote/attachment. Add to %#2n%#3?b%[ et al.%]%[%] instead? ")
(sub-roots-q . "Text %#1n is a footnote/attachment. Remove from %#2n%#3?b%[ et al.%]%[%] instead? ")
(text-to-add-recipient . "Add recipient to which text:")
(text-to-add-copy . "Add recipient of carbon copy to which text:")
(text-to-add-bcc . "Add recipient of blind carbon copy to which text:")
......@@ -562,19 +565,19 @@ Read all about it at http://www.lysator.liu.se/history/")
. " A total of %#1d visible%#1?d%[%]%[%] active user%#1?d%[%]%[s%] (%#2s).\n")
(client-statistics . " Distribution of clients:\n")
(client-statistics-line . " %4#2d %#1s%#3?d%[%]%[ [%#3d variants]%]")
(who-to-add-q . "Add whom/what as a recipient? ")
(who-to-add-copy-q . "Add which conference/user as carbon copy recipient? ")
(who-to-add-bcc-q . "Add which conference/user as blind carbon copy recipient? ")
(who-to-add-q . "Add whom/what as a recipient of text %#1n? ")
(who-to-add-copy-q . "Add which conference/user as carbon copy recipient of text %#1n? ")
(who-to-add-bcc-q . "Add which conference/user as blind carbon copy recipient of text %#1n? ")
(add-footnotes-too-q . "Try to add recipient to footnotes? ")
(add-attachments-too-q . "Try to add recipient to attachments? ")
(really-add-as-recpt-q . "Send future comments to the text to %#1M too? ")
(who-to-sub-q . "Remove whom/what as a recipient? ")
(who-to-sub-q . "Remove whom/what as a recipient of %#1n? ")
(sub-footnotes-too-q . "Try to remove recipient from footnotes? ")
(sub-attachments-too-q . "Try to remove recipient from attachments? ")
(who-to-move-from-q . "Move from where? ")
(who-to-move-to-q . "Move to where? ")
(who-to-move-from-q . "Move text %#1n from where? ")
(who-to-move-to-q . "Move text %#1n to where? ")
(who-to-move-to-or-sub-q . "Move to where (empty to just remove recipient)? ")
(move-footnotes-too-q . "Try to move footnotes? ")
(move-attachments-too-q . "Try to move attachments? ")
......@@ -1518,7 +1521,21 @@ On since %#8s%#9s")
(reformat-enriched . "enriched")
(reformat-filled . "filled")
(reformat-image . "image")
(image-no-show . "< The image cannot be shown. >")
(image-no-show . "< The image (%#1s) cannot be shown. >")
(reformat-video . "video")
(video-no-show . "< Video (%#1s) not supported. >")
(reformat-audio . "audio")
(audio-no-show . "< Audio (%#1s) not supported. >")
(reformat-multipart . "multipart")
(multipart-no-show . "< Multipart (%#1s) texts not supported. >")
(reformat-message . "message")
(message-no-show . "< Message type (%#1s) not supported. >")
(reformat-model . "model")
(model-no-show . "< Models (%#1s) not supported. >")
(reformat-application . "application data")
(application-no-show . "< Application data (%#1s) not supported. >")
(reformat-unknown . "unknown type")
(unknown-no-show . "< Unknown type (%#1s) not supported. >")
(reformat-truncated . "truncated")
......
......@@ -2260,19 +2260,23 @@ reappears."
;;; ================================================================
;;; Text body formatting
(defun lyskom-text-stat-content-type (text text-stat)
"Return the content type of a text."
(let* ((ct-item (and text-stat (car (text-stat-find-aux text-stat 1)))))
(or (cond (ct-item (aux-item->data ct-item))
((and kom-respect-ancient-content-types
(string-match "\\`\\(\\S-+\\):\\s-*$" text)
(match-beginning 1))
(match-string 1 text))
(t nil))
"text/x-kom-basic")))
(lyskom-try-require 'latin-unity)
(lyskom-with-external-functions (smiley-region latin-unity-remap-region)
(defun lyskom-format-text-body (text &optional text-stat)
"Format a text for insertion. Does parsing of special markers in the text."
(let* ((ct-item (and text-stat (car (text-stat-find-aux text-stat 1))))
(content-type (or (cond (ct-item (aux-item->data ct-item))
((and (string-match "\\`\\(\\S-+\\):\\s-*$" text)
(match-beginning 1))
(match-string 1 text))
(t nil))
"text/x-kom-basic"))
(let* ((content-type (lyskom-text-stat-content-type text text-stat))
(fn (and content-type
(cdr (let ((case-fold-search t))
(lyskom-traverse el lyskom-format-special
......@@ -2373,7 +2377,7 @@ reappears."
(defun lyskom-signal-reformatted-text (how)
"Signal that the last text was reformatted HOW, which should be a string
in lyskom-messages."
(or (memq how lyskom-last-text-format-flags)
(or (member how lyskom-last-text-format-flags)
(setq lyskom-last-text-format-flags (cons how lyskom-last-text-format-flags))))
......@@ -2429,6 +2433,34 @@ in lyskom-messages."
(defun lyskom-format-html-w3m (text text-stat)
(lyskom-format-html text text-stat 'w3m 'lyskom-w3m-region))
(defun lyskom-format-audio (text text-stat)
(lyskom-signal-reformatted-text 'reformat-audio)
(lyskom-format 'audio-no-show (lyskom-text-stat-content-type text text-stat)))
(defun lyskom-format-video (text text-stat)
(lyskom-signal-reformatted-text 'reformat-video)
(lyskom-format 'video-no-show (lyskom-text-stat-content-type text text-stat)))
(defun lyskom-format-multipart (text text-stat)
(lyskom-signal-reformatted-text 'reformat-multipart)
(lyskom-format 'multipart-no-show (lyskom-text-stat-content-type text text-stat)))
(defun lyskom-format-message (text text-stat)
(lyskom-signal-reformatted-text 'reformat-message)
(lyskom-format 'message-no-show (lyskom-text-stat-content-type text text-stat)))
(defun lyskom-format-model (text text-stat)
(lyskom-signal-reformatted-text 'reformat-model)
(lyskom-format 'model-no-show (lyskom-text-stat-content-type text text-stat)))
(defun lyskom-format-application (text text-stat)
(lyskom-signal-reformatted-text 'reformat-application)
(lyskom-format 'application-no-show (lyskom-text-stat-content-type text text-stat)))
(defun lyskom-format-unknown (text text-stat)
(lyskom-signal-reformatted-text 'reformat-unknown)
(lyskom-format 'unknown-no-show (lyskom-text-stat-content-type text text-stat)))
(defun lyskom-format-image (text text-stat)
(if kom-format-show-images
(let* ((cti (lyskom-get-aux-item (text-stat->aux-items text-stat) 1))
......@@ -2450,9 +2482,11 @@ in lyskom-messages."
(lyskom-put-image
(lyskom-create-image imagedata imagetype t)
(point-max)))
(setq msg (lyskom-get-string 'image-no-show))))
(setq msg (lyskom-format 'image-no-show
(lyskom-text-stat-content-type text text-stat)))))
; Errors just marks it as a no show
(error (setq msg (lyskom-get-string 'image-no-show))))
(error (setq msg (lyskom-format 'image-no-show
(lyskom-text-stat-content-type text text-stat)))))
(lyskom-signal-reformatted-text 'reformat-image)
msg)))
......
......@@ -580,6 +580,9 @@ All key bindings:
lyskom-last-known-pers-no
kom-presence-messages
kom-dont-complain-about-missing-presentation
kom-respect-ancient-content-types
kom-read-last-text-hook-conf-list
kom-list-summary-hook-conf-list
lyskom-settings-version)
"List of user variables not in lyskom-custom-variables.")
......
......@@ -446,6 +446,9 @@ du har l
(active-last . "Aktiv senast")
(active . "Aktiv")
(lyskom-client . "Klient")
(move-roots-q . "Inlgg %#1n r en fotnot/bilaga. Flytta %#2n%#3?b%[ mfl.%]%[%] istllet? ")
(add-roots-q . "Inlgg %#1n r en fotnot/bilaga. Addera till %#2n%#3?b%[ mfl.%]%[%] istllet? ")
(sub-roots-q . "Inlgg %#1n r en fotnot/bilaga. Subtrahera frn %#2n%#3?b%[ mfl.%]%[%] istllet? ")
(text-to-add-recipient . "Vilket inlgg vill du addera mottagare till:")
(text-to-add-copy . "Vilket inlgg vill du addera en extra kopia till:")
(text-to-add-bcc . "Vilket inlgg vill du skicka som dold kopia:")
......@@ -591,19 +594,19 @@ i svensk datorhistoria. L
. " Sammanlagt %#1d synlig%#1?d%[%]%[a%] aktiv%#1?d%[%]%[a%] anvndare (%#2s).\n")
(client-statistics . " Klienternas frdelning:\n")
(client-statistics-line . " %4#2d %#1s%#3?d%[%]%[ [%#3d varianter]%]")
(who-to-add-q . "Vilket mte/person vill du addera som mottagare? ")
(who-to-add-copy-q . "Vilket mte/person vill du addera som kopiemottagare? ")
(who-to-add-bcc-q . "Vilket mte/person vill du addera som mottagare av en dold kopia? ")
(who-to-add-q . "Vilket mte/person vill du addera som mottagare till text %#1n? ")
(who-to-add-copy-q . "Vilket mte/person vill du addera som kopiemottagare till text %#1n? ")
(who-to-add-bcc-q . "Vilket mte/person vill du addera som mottagare av en dold kopia till text %#1n? ")
(add-footnotes-too-q . "Frsk addera mottagare till fotnoter ocks? ")
(add-attachments-too-q . "Frsk addera mottagare till bilagor ocks? ")
(really-add-as-recpt-q . "Skall framtida kommentarer till inlgget ocks skickas till %#1M? ")
(who-to-sub-q . "Vilket mte/person vill du subtrahera som mottagare? ")
(who-to-sub-q . "Vilket mte/person vill du subtrahera som mottagare till text %#1n? ")
(sub-footnotes-too-q . "Frsk subtrahera mottagare frn fotnoter ocks? ")
(sub-attachments-too-q . "Frsk subtrahera mottagare frn bilagor ocks? ")
(who-to-move-from-q . "Frn vilket mte vill du flytta texten? ")
(who-to-move-to-q . "Vart vill du flytta texten? ")
(who-to-move-from-q . "Frn vilket mte vill du flytta text %#1n? ")
(who-to-move-to-q . "Vart vill du flytta text %#1n? ")
(who-to-move-to-or-sub-q . "Vart vill du flytta texten (tomt fr att bara subtrahera)? ")
(move-footnotes-too-q . "Frsk flytta fotnoter ocks? ")
(move-attachments-too-q . "Frsk flytta bilagor ocks? ")
......@@ -1567,7 +1570,21 @@ Uppkopplad sedan %#8s%#9s")
(reformat-enriched . "enriched")
(reformat-filled . "ombruten")
(reformat-image . "bild")
(image-no-show . "< Bilden kan inte visas. >")
(image-no-show . "< Bilden (%#1s) kan inte visas. >")
(reformat-video . "video")
(video-no-show . "< Video (%#1s) stds inte. >")
(reformat-audio . "ljud")
(audio-no-show . "< Ljud (%#1s) stds inte. >")
(reformat-multipart . "flerdelat")
(multipart-no-show . "< Flerdelade inlgg (%#1s) stds inte. >")
(reformat-message . "meddelande")
(message-no-show . "< Meddelandetyp (%#1s) stds inte. >")
(reformat-model . "modell")
(model-no-show . "< Modeller (%#1s) stds inte. >")
(reformat-application . "tillmpningsdata")
(application-no-show . "< Tillmpningsdata (%#1s) stds inte. >")
(reformat-unknown . "oknd typ")
(unknown-no-show . "< Oknd typ (%#1s) stds inte. >")
(reformat-truncated . "nedkortad")
......
......@@ -4634,21 +4634,39 @@ Values other than those listed are reserved for future use."
copy-transition lyskom-copy-indirect-assq)
(def-kom-var lyskom-format-special
'(("html" . (lyskom-format-html-w3m lyskom-format-html-w3 lyskom-format-html-plaintext))
("enriched" . lyskom-format-enriched)
("^image/" . lyskom-format-image)
'(("html" . (lyskom-format-html-w3m lyskom-format-html-w3 lyskom-format-html-plaintext))
("enriched" . lyskom-format-enriched)
("^image/" . lyskom-format-image)
("^text/html" . (lyskom-format-html-w3m lyskom-format-html-w3 lyskom-format-html-plaintext))
("^text/enriched" . lyskom-format-enriched)
("^text/" . lyskom-format-plaintext)
("^text/" . lyskom-format-plaintext)
("^x-kom/text" . lyskom-format-plaintext) ;Archaic alias for text/x-kom-basic.
("^x-kom/basic" . lyskom-format-plaintext) ;Archaic alias for text/x-kom-basic.
("^x-kom/user-area" . lyskom-format-x-kom/user-area)
("^x-kom/ö\\." . lyskom-format-ö))
("^x-kom/ö\\." . lyskom-format-ö)
("^audio/" . lyskom-format-audio)
("^video/" . lyskom-format-video)
("^multipart/" . lyskom-format-multipart)
("^message/rfc822" . lyskom-format-plaintext)
("^message/delivery-status" . lyskom-format-plaintext)
("^message/disposition-notification" . lyskom-format-plaintext)
("^message/news" . lyskom-format-plaintext)
("^message/" . lyskom-format-message)
("^model/" . lyskom-format-model)
("^application/" . lyskom-format-application)
("" . lyskom-format-unknown)
)
"AList of (FORMAT . FUNCTION) specifying functions that format texts
of that type. FORMAT is a symbol and FUNCTION is a function taking one
argument and returning a formatted string.")
(def-kom-var kom-respect-ancient-content-types nil
"**When set to non-nil, LysKOM respects an ancient method for specifying
the content type of texts (in the first line of the text body). Should be
set to nil for most users."
server)
(def-kom-var lyskom-send-text-transform-hook nil
"Functions to call to transform text before sending it to the server.
......
......@@ -769,18 +769,14 @@ blocking-do."
(lambda (str)
(let ((face nil))
;; If it's a cons, the cdr is property list
(when (consp str)
(setq face (cdr str)
str (car str)))
;; Get the string
(setq str (lyskom-get-string str))
;; Upcase the first in the list
(when first-flag
(setq first-flag nil str (upcase-initials str)))
;; If we have a plist, apply it
(when face
(add-text-properties 0 (length str) face str))
;; Return the string
(when (consp str) (setq face (cdr str) str (car str)))
(if (stringp str)
str
(setq str (lyskom-get-string str))
(when first-flag
(setq str (capitalize str))))
(setq first-flag nil)
(when face (add-text-properties 0 (length str) face str))
str))
format-flags ", ")
")"))
......
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