Commit 54a094b2 authored by David Byers's avatar David Byers
Browse files

Fixed bugs 817, 879; added kom-text-links to customization buffer.

Detailed changes:
> 	Fix bug 879:
> 	* utilities.el (lyskom-read-text-no-prefix-arg): When new-default
> 	is computed successfully, set default to new-default. I *think*
> 	that's the right thing to do...
>
> 	Fix bug 817:
> 	* vars.el.in (kom-send-text-hook): Updated docstring.
>
> 	* edit-text.el (lyskom-edit-send): Run kom-send-text-hook before
> 	doing anything else so it can manipulate headers.
>
> 	More work on text links:
> 	* option-edit.el (lyskom-custom-variables): Added kom-text-links.
> 	(lyskom-customize-buffer-format): Ditto.
> 	(lyskom-widget-functions): Added `list' widget type.
> 	(lyskom-list-widget): New function.
parent 0e77be1d
2002-12-31 David Byers <david.byers@swipnet.se>
Fix bug 879:
* utilities.el (lyskom-read-text-no-prefix-arg): When new-default
is computed successfully, set default to new-default. I *think*
that's the right thing to do...
Fix bug 817:
* vars.el.in (kom-send-text-hook): Updated docstring.
* edit-text.el (lyskom-edit-send): Run kom-send-text-hook before
doing anything else so it can manipulate headers.
More work on text links:
* option-edit.el (lyskom-custom-variables): Added kom-text-links.
(lyskom-customize-buffer-format): Ditto.
(lyskom-widget-functions): Added `list' widget type.
(lyskom-list-widget): New function.
Bugs in kom-list-summary:
* commands2.el (lyskom-list-summary): Copy the list of texts we're
reviewing so we can delete stuff from it.
......
......@@ -468,6 +468,15 @@ anonymously and take actions to avoid revealing the sender."
(message nil)
(aux-list nil))
;;
;; Run user hooks
;; ####: ++++: FIXME: We should quit more graciously.
(if (and (not (run-hook-with-args-until-failure 'kom-send-text-hook))
(not (run-hook-with-args-until-failure 'lyskom-send-text-hook)))
(signal 'lyskom-edit-text-abort nil))
(save-excursion
(setq headers (lyskom-edit-parse-headers)
misc-list (apply 'lyskom-create-misc-list
......@@ -512,13 +521,6 @@ anonymously and take actions to avoid revealing the sender."
(rplacd misc-list (delq (rassq lyskom-pers-no (cdr misc-list))
(cdr misc-list))))
;;
;; Run user hooks
;; ####: ++++: FIXME: We should quit more graciously.
(if (and (not (run-hook-with-args-until-failure 'kom-send-text-hook))
(not (run-hook-with-args-until-failure 'lyskom-send-text-hook)))
(signal 'lyskom-edit-text-abort nil))
;;
;; Transform the message text
......
......@@ -2751,6 +2751,14 @@ Select whether to execute command or keyboard macro.")
(default-namedays . "Namedays for current language")
(specific-namedays . "Specific name list:")
(link-pattern-for . "Link patterns for")
(all-conferences . "All recipients")
(link-specific-rcpt . "Specific recipient")
(link-pattern . "Link pattern")
(link-replace . "Link substitution")
(link-highlight-match . "Highlight group")
(link-fold-case . "Case insensitive")
;;
;; Misc doc strings
;;
......@@ -3686,6 +3694,23 @@ be saved in the server. Otherwise it will be saved in your .emacs.")
\\N means substitute match for (...) number N,
\\\\ means insert one \\.")
(kom-text-links-doc . "\
Text link definitions. Each line defines one link for texts with a
particular recipient. All occurrences of the link pattern will be shown
as URL links. The URL pointed to by the link is generated from the text
matching the link pattern, by substituting according to the link
substitution. The text that is highlighted is determined by the
\"Highlight group\" setting: zero means highlight the entire match. A
number 1-9 indicated the parenthesized group to highlight (and if that
makes no sense to you, stick with zero). If \"Case insensitive\" is
on, text will be matched without recard for character case.
The link substitution can contain the following special sequences:
\\& means substitute original matched text,
\\N means substitute match for (...) number N,
\\\\ means insert one \\.")
;;
;; Tags for variables
;;
......@@ -3864,6 +3889,7 @@ be saved in the server. Otherwise it will be saved in your .emacs.")
(kom-max-overlays-tag . "Maximum number of overlays:")
(kom-mark-read-texts-as-read-in-new-recipient-tag . "Mark read texts read when added to new recipients:")
(kom-url-transformation-rules-tag . "Transformation of URLs:")
(kom-text-links-tag . "Text links:")
)
)
......
......@@ -226,6 +226,7 @@
(urls bold centered)
section
"\n"
[kom-text-links]
[kom-url-transformation-rules]
[kom-url-viewer-preferences]
[kom-windows-browser-command]
......@@ -731,6 +732,17 @@ customize buffer but do not save them to the server."
(kom-keyboard-menu-immediate-selection (noggle (yes no)))
(kom-url-transformation-rules (repeat (cons ((string nil :tag url-transform-regexp)
(string nil :tag url-transform-newtext)))))
(kom-text-links (repeat (cons ((choice ((person nil :tag link-specific-rcpt :lyskom-predicate (pers conf))
(const (all-conferences t)))
:tag link-pattern-for
:format "%[%t%]: %v")
(repeat (list ((string nil :tag link-pattern :format "%[%t%]: %v\n")
(string nil :tag link-replace :format "%[%t%]: %v\n")
(number (0 9) :tag link-highlight-match :format "%[%t%]: %v\n")
(toggle (yes no) :tag link-fold-case :format "%[%t%]: %v"))
) :indent 8 :tag "")
))
:indent 4))
))
(defvar lyskom-widget-functions
......@@ -743,6 +755,7 @@ customize buffer but do not save them to the server."
(const . lyskom-item-widget)
(repeat . lyskom-repeat-widget)
(cons . lyskom-cons-widget)
(list . lyskom-list-widget)
(nameday . lyskom-nameday-widget)
(kbd-macro . lyskom-kbd-macro-widget)
(url-viewer . lyskom-url-viewer-widget)
......@@ -1175,6 +1188,14 @@ customize buffer but do not save them to the server."
(lyskom-widget-convert-specification (elt args 1))))
propl))
(defun lyskom-list-widget (type &optional args propl)
(lyskom-build-simple-widget-spec
'list
(list ':format "%v\n"
':tag ""
':args (mapcar 'lyskom-widget-convert-specification args))
propl))
(defun lyskom-choice-widget (type &optional args propl)
(lyskom-build-simple-widget-spec
'menu-choice
......
......@@ -85,11 +85,14 @@
(define-key lyskom-sv-edit-prefix (kbd "]") 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix (kbd "C-]") 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix (kbd "C-}") 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix (kbd "C-") 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix (kbd "C-") 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix [(control aring)] 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix [(control Aring)] 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix [(control 229)] 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix [(control 197)] 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix "\205" 'lyskom-sv-edit-review-prefix) ;For windows
(define-key lyskom-sv-edit-prefix (lyskom-keys 'C-) 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix (lyskom-keys 'C-) 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix [(control )] 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix [(control )] 'lyskom-sv-edit-review-prefix)
(define-key lyskom-sv-edit-prefix (kbd "*") 'kom-button-press)
(define-key lyskom-sv-edit-prefix (kbd "=") 'kom-menu-button-press)
......@@ -2838,6 +2841,14 @@ teckenkodning.
(default-namedays . "Namnsdagar fr aktuellt sprk")
(specific-namedays . "Specifik namnlngd:")
(link-pattern-for . "Mnster fr")
(all-conferences . "Alla mottagare")
(link-specific-rcpt . "Specifik mottagare")
(link-pattern . "Lnkmnster")
(link-replace . "Lnksubstitution")
(link-highlight-match . "Visa grupp")
(link-fold-case . "Versaler och gemener lika")
;;
;; Misc doc strings
;;
......@@ -3778,6 +3789,22 @@ i servern. Annars sparas det i din .emacs.")
\\& erstts med den text som matchar regexpen
\\N erstts med den text som matchar (...)-uttryck N i regexpen
\\\\ erstts med en \\.")
(kom-text-links-doc . "\
Definition av textlnkar. Varje rad definierar en lnk fr inlgg i ett
visst mte. Alla frekomster av lnkmnstret blir URL-lnkar genom att
texten som lnkmnstret matchar substitueras enligt lnksubstitutionen.
Den text som faktist visas som lnk i LysKOM-bufferten bestms av
instllningen \"Visa grupp\". Anvnd 0 fr att visa hela den matchande
texten eller en siffta frn 1 till 9 fr att visa den N-te gruppen i
lnkmnstret (anvnd 0 om du inte frstr vad som avses med detta).
Om instllningen \"Versaler och gemener lika\" r p s rknas versaker
och gemener av samma bokstav som lika.
Lnksubstitutionen kan innehlla fljande specialtecken:
\\& erstts med den text som matchar regexpen
\\N erstts med den text som matchar (...)-uttryck N i regexpen
\\\\ erstts med en \\.")
;;
;; Tags for variables
......@@ -3957,6 +3984,7 @@ i servern. Annars sparas det i din .emacs.")
(kom-max-overlays-tag . "Hgsta antal frgmarkeringar:")
(kom-mark-read-texts-as-read-in-new-recipient-tag . "Markera lsta inlgg lsta ven i nya mottagare:")
(kom-url-transformation-rules-tag . "Transformation av URLer:")
(kom-text-links-tag . "Textlnkar:")
)
)
......
......@@ -776,8 +776,8 @@ its first argument and remaining list items appended to the argument list."
((eq compare-value t) ;; provided a default value for the prompt
(let ((new-default (lyskom-evaluate-text-no-strategy
what-text prompt default constraint)))
(when (and (lyskom-plusp new-default))
(setq default (or default new-default)))))
(when (lyskom-plusp new-default)
(setq default new-default))))
((or (eq compare-value current-prefix-arg) ;; a text-no strategy
(and (functionp strategy-pred)
......
......@@ -744,7 +744,9 @@ be sent."
(def-kom-var kom-send-text-hook nil
"*Hook that is called before sending a text. Hook functions return t to
signal success and nil to prevent the text from being sent."
signal success and nil to prevent the text from being sent. Note that this
hook is called before the text headers are parsed, so it is possible that
sending will be canceled or recipients altered after calling this hook."
local-hook)
(def-kom-var lyskom-send-text-hook nil
......
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