Commit b7c41a01 authored by Ulrik Haugen's avatar Ulrik Haugen
Browse files

Added "remove" menu option for the recpt-type menu in the edit buffer.

parent 293b4421
2001-11-19 Ulrik Haugen <qha@lysator.liu.se>
* vars.el.in (lyskom-button-actions): added "remove" option to the
recpt-type menu. Better argument names for the lambda-functions in
recpt-type
* lyskom-buttons.el (lyskom-generate-button): do a car on
menu-title so we get an errormessage if it's not a cons when the
button is generated in stead of when it's used.
* swedish-strings.el, english-strings.el (lyskom-message): new
string: lyskom-button-recpt-type-sub.
* edit-text.el (lyskom-edit-insert-misc-conf): use lyskom-format
to add text properties for the recipient type.
(lyskom-edit-do-add-recipient/copy): use save-excursion in stead
of lyskom-save-excursion.
(lyskom-edit-sub-recipient/copy): new function.
2001-11-14 Ulrik Haugen <qha@lysator.liu.se>
* vars.el.in (lyskom-button-actions): added remove alternative for
recpt-type buttons.
* edit-text.el (lyskom-edit-sub-recipient/copy): new function.
* swedish-strings.el, english-strings.el (lyskom-message): new
string: lyskom-button-recpt-type-sub.
2001-11-17 Per Cederqvist <ceder@moria>
Use content types as specified in the current version of the
......
......@@ -177,7 +177,8 @@ recpt -> Mottagare: <%d> %s.
cc-recpt -> Extra kopia: <%d> %s.
bcc-recpt -> Blind kopia: <%d> %s.
comm-to -> Kommentar till text %d.
footn-to -> Fotnot till text %d."
footn-to -> Fotnot till text %d.
nil -> Ingenting."
(let ((edit-buffer (current-buffer))
(where-put-misc (point-min-marker))
(main-buffer lyskom-buffer))
......@@ -245,21 +246,18 @@ CONF-STAT is the conf-stat of the conference that is about to be put in,
STRING is the string that is inserted.
STREAM is the buffer or a marker telling the position.
NUMBER is the number of the person. Used if the conf-stat is nil."
(add-text-properties
0 (length string)
(lyskom-default-button
'recpt-type
(list (or (conf-stat->conf-no conf-stat)
number)
(marker-buffer stream))
(list (lyskom-get-string 'recpt-type-popup-title)
string))
string)
(lyskom-princ (lyskom-format "%#1s: <%#2m> %#3M\n"
string
(or conf-stat number)
(or conf-stat ""))
stream))
(lyskom-princ
(lyskom-format "%[%#1@%#2s%]: <%#3m> %#4M\n"
(lyskom-default-button
'recpt-type
(list (or (conf-stat->conf-no conf-stat) number)
(marker-buffer stream))
(list (lyskom-get-string 'recpt-type-popup-title)
string))
string
(or conf-stat number)
(or conf-stat ""))
stream))
(defun lyskom-edit-get-commented-author (text-stat string stream number)
(if text-stat
......@@ -1219,7 +1217,7 @@ CC recipients."
(defun lyskom-edit-do-add-recipient/copy (recpt-type recpt-no edit-buffer)
(lyskom-save-excursion
(save-excursion
(set-buffer edit-buffer)
(let* ((headers (lyskom-edit-parse-headers))
(miscs (lyskom-edit-translate-headers (elt headers 1)))
......@@ -1232,8 +1230,6 @@ CC recipients."
(lyskom-edit-replace-headers (elt headers 0)
miscs
(elt headers 2)))))
(defun lyskom-edit-add-recipient/copy (prompt
......@@ -1290,6 +1286,23 @@ RECPT-TYPE is the type of recipient to add."
edit-buffer)))
(when win-config (set-window-configuration win-config)))))))
(defun lyskom-edit-sub-recipient/copy (recpt-no edit-buffer)
"Remove the recipient having RECPT-NO from EDIT-BUFFER"
;; XXX: lyskom-edit-sub-recipient/copy: Symbol's value as variable is void: recpt
(save-excursion
(set-buffer edit-buffer)
(let* ((headers (lyskom-edit-parse-headers))
(miscs (lyskom-edit-translate-headers (elt headers 1)))
(elem (lyskom-edit-find-misc miscs '(cc-recpt bcc-recpt recpt)
recpt-no)))
(when elem (setcar elem nil))
(lyskom-edit-replace-headers (elt headers 0)
miscs
(elt headers 2)))))
(defun kom-edit-add-cross-reference ()
(interactive)
(let ((item (lyskom-read-cross-reference-and-get-aux-item)))
......
......@@ -1570,6 +1570,7 @@ You must become an active member of the conference to enter it.\n")
(lyskom-button-recpt-type-recipient . "Recipient")
(lyskom-button-recpt-type-copy . "Carbon copy")
(lyskom-button-recpt-type-bcc . "Blind Carbon copy")
(lyskom-button-recpt-type-sub . "Remove")
(lyskom-edit-toggle-secret-aux-action . "Toggle \"secret\"")
(lyskom-edit-toggle-anonymous-aux-action . "Toggle \"anonymous\"")
(lyskom-edit-toggle-inherit-aux-action . "Toggle \"inherited\"")
......
......@@ -411,6 +411,7 @@ argument MENU-TITLE defines the title for the popup menu. See
lyskom-default-button for more information. Optional argument SUBTLE
means don't set the lyskom-button property if non-nil. that means
kom-next- and -previous-link won't notice the button"
(car menu-title) ; produce error if menu-title not cons
(let* ((persno (cond ((boundp 'lyskom-pers-no) lyskom-pers-no)
((and (boundp 'lyskom-buffer) lyskom-buffer)
(save-excursion
......
......@@ -1569,6 +1569,7 @@ Du m
(lyskom-button-recpt-type-recipient . "Mottagare")
(lyskom-button-recpt-type-copy . "Extra kopia")
(lyskom-button-recpt-type-bcc . "Dold kopia")
(lyskom-button-recpt-type-sub . "Subtrahera")
(lyskom-edit-toggle-secret-aux-action . "Vxla \"hemlig\"")
(lyskom-edit-toggle-anonymous-aux-action . "Vxla \"anonym\"")
(lyskom-edit-toggle-inherit-aux-action . "Vxla \"rvd\"")
......
......@@ -1249,17 +1249,25 @@ each time ."
recpt-type-popup-title
(lambda (buffer argument text) nil)
((lyskom-button-recpt-type-recipient
. (lambda (buffer argument text)
. (lambda (buffer recpt-and-buffer text)
(lyskom-edit-do-add-recipient/copy
'recpt (car argument) (cadr argument))))
'recpt (car recpt-and-buffer)
(cadr recpt-and-buffer))))
(lyskom-button-recpt-type-copy
. (lambda (buffer argument text)
. (lambda (buffer recpt-and-buffer text)
(lyskom-edit-do-add-recipient/copy
'cc-recpt (car argument) (cadr argument))))
'cc-recpt (car recpt-and-buffer)
(cadr recpt-and-buffer))))
(lyskom-button-recpt-type-bcc
. (lambda (buffer argument text)
. (lambda (buffer recpt-and-buffer text)
(lyskom-edit-do-add-recipient/copy
'bcc-recpt (car argument) (cadr argument))))))
'bcc-recpt (car recpt-and-buffer)
(cadr recpt-and-buffer))))
(lyskom-button-recpt-type-sub
. (lambda (buffer recpt-and-buffer text)
(lyskom-edit-sub-recipient/copy
(car recpt-and-buffer)
(cadr recpt-and-buffer))))))
)
"This variable defines valid button types in LysKOM. Each element is a
list consisting of (TYPE LABEL DEFAULT ACTIONS HINTS).
......
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