Commit 8a0d2723 authored by David Byers's avatar David Byers
Browse files

Limit length of menu titles.

kom-super-jump can deal with empty subject
parent bade4804
2000-08-10 David Byers <davby@ida.liu.se>
* filter.el (kom-super-jump): Protect empty subject with ^$.
2000-08-01 David Byers <davby@ida.liu.se>
* lyskom-buttons.el (lyskom-make-button-menu): Truncate menu title
to 43 characters.
2000-07-30 Johan Sundstrm <jhs@lysator.liu.se>
* lyskom-rest.el (lyskom-trim-buffer): Point no longer flickers
......
......@@ -549,16 +549,16 @@ the current text"
(not (zerop lyskom-current-conf)))
(blocking-do 'get-conf-stat lyskom-current-conf))))
(lyskom-traverse misc
(text-stat->misc-info-list text-stat)
(cond ((eq (misc-info->type misc) 'RECPT)
(setq recipients (cons (misc-info->recipient-no misc)
recipients)))
((eq (misc-info->type misc) 'CC-RECPT)
(setq cc-recipients (cons (misc-info->recipient-no misc)
cc-recipients)))
((eq (misc-info->type misc) 'BCC-RECPT)
(setq bcc-recipients (cons (misc-info->recipient-no misc)
bcc-recipients)))))
(text-stat->misc-info-list text-stat)
(cond ((eq (misc-info->type misc) 'RECPT)
(setq recipients (cons (misc-info->recipient-no misc)
recipients)))
((eq (misc-info->type misc) 'CC-RECPT)
(setq cc-recipients (cons (misc-info->recipient-no misc)
cc-recipients)))
((eq (misc-info->type misc) 'BCC-RECPT)
(setq bcc-recipients (cons (misc-info->recipient-no misc)
bcc-recipients)))))
(setq filter-recipient (or
(and conf-stat
......@@ -573,19 +573,24 @@ the current text"
(if (null filter-recipient)
(lyskom-insert-string 'no-recipient)
(lyskom-add-filter
(make-filter (list
(cons 'subject-re
(concat "\\([rR][eE]: *\\|[Ff][Ww][Dd]: *\\)*"
(replace-in-string
(regexp-quote lyskom-current-subject)
"[ \t]+" "[ \t]+")))
(cons 'recipient-no filter-recipient))
(list (cons 'action 'skip-tree)
(cons 'expire t))))
(lyskom-format-insert 'super-jump
(copy-sequence lyskom-current-subject)
filter-recipient)))))
(let ((text lyskom-current-subject))
(when (string-match lyskom-current-subject "^\\s-*$") (setq text ""))
(lyskom-add-filter
(make-filter (list
(cons 'subject-re
(concat (if (string-equal text "") "^" "")
"\\([rR][eE]: *\\|[Ff][Ww][Dd]: *\\)*"
(replace-in-string
(regexp-quote text)
"[ \t]+" "[ \t]+")
(if (string-equal text "") "$" "")))
(cons 'recipient-no filter-recipient))
(list (cons 'action 'skip-tree)
(cons 'expire t))))
(lyskom-format-insert 'super-jump
(copy-sequence lyskom-current-subject)
filter-recipient))))))
......
......@@ -161,32 +161,35 @@ If there is no active area, then do something else."
;; Use the command as the event for simplicity. Note that the menu
;; function alters the menu, so we copy the entries to prevent it
;; from fiddling with lyskom-button-actions.
(cond ((string-match "XEmacs" (emacs-version))
(cons (encode-coding-string title 'iso-8859-1)
(mapcar (function
(lambda (entry)
(vector (encode-coding-string
(lyskom-get-string (car entry)) 'iso-8859-1)
(list (cdr entry)
buf
(if (listp arg)
(list 'quote arg)
arg)
text)
':active t)))
entries)))
(t (append (list 'keymap title)
(mapcar (function (lambda (entry)
(let ((tmp (copy-tree entry)))
(setcar tmp (encode-coding-string
(lyskom-get-string (car tmp))
'iso-8859-1))
(cons (` ((, (cdr entry))
(, buf)
(, arg)
(, text)))
tmp))))
entries)))))
(let ((title (encode-coding-string title 'iso-8859-1)))
(when (> (length title) 44) (setq title (concat (substring title 0 40)
" ...")))
(cond ((string-match "XEmacs" (emacs-version))
(cons (encode-coding-string title 'iso-8859-1)
(mapcar (function
(lambda (entry)
(vector (encode-coding-string
(lyskom-get-string (car entry)) 'iso-8859-1)
(list (cdr entry)
buf
(if (listp arg)
(list 'quote arg)
arg)
text)
':active t)))
entries)))
(t (append (list 'keymap title)
(mapcar (function (lambda (entry)
(let ((tmp (copy-tree entry)))
(setcar tmp (encode-coding-string
(lyskom-get-string (car tmp))
'iso-8859-1))
(cons (` ((, (cdr entry))
(, buf)
(, arg)
(, text)))
tmp))))
entries))))))
......
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