Commit 80cfb08b authored by David Byers's avatar David Byers

Fix bug 1141:

Detailed changes:
> 2005-01-09  David Byers  <byers@lysator.liu.se>
>
> 	* commands1.el (kom-move-text-tree): Handle missing text in the
> 	tree.
> 	(lyskom-move-recipient): Add leave-cc argument.
>
> 	* lyskom-rest.el (lyskom-a-or-b-or-c-p): Display chosen option
> 	when just pressing RET. Show default choice in bold. Compact
> 	display a bit.
>
> 	* commands1.el (kom-move-text-tree): Use lyskom-a-or-b-or-c-p to
> 	ask about what to do. Support a null source (useful to just add a
> 	recipient, not remove anything).
>
> 	* NEWS-0.48: Updated to here.
>
> 	* commands2.el (kom-list-sessions): Docstring fixes.
>
> 	* vars.el.in (kom-default-server): No default server in default
> 	build.
> 	Variois docstring fixes.
>
> 	* mship-edit.el (lp--show-hide-read-memberships): Toggle filter.
> 	(lp--show-hide-passive-memberships): Ditto.
> 	(lp--mode): Fixed key binding references in docstring.
parent 823a84b5
2005-01-09 David Byers <byers@lysator.liu.se>
* commands1.el (kom-move-text-tree): Handle missing text in the
tree.
(lyskom-move-recipient): Add leave-cc argument.
* lyskom-rest.el (lyskom-a-or-b-or-c-p): Display chosen option
when just pressing RET. Show default choice in bold. Compact
display a bit.
* commands1.el (kom-move-text-tree): Use lyskom-a-or-b-or-c-p to
ask about what to do. Support a null source (useful to just add a
recipient, not remove anything).
* NEWS-0.48: Updated to here.
* commands2.el (kom-list-sessions): Docstring fixes.
* vars.el.in (kom-default-server): No default server in default
build.
Variois docstring fixes.
* mship-edit.el (lp--show-hide-read-memberships): Toggle filter.
(lp--show-hide-passive-memberships): Ditto.
(lp--mode): Fixed key binding references in docstring.
2005-01-08 David Byers <byers@lysator.liu.se>
* vars.el.in: Documentation updates in preparation for generating
......@@ -39,7 +65,7 @@
* swedish-strings.el (lyskom-sv-mode-map): Added keybindings for
unaccelerated < and >.
* english-strings.el (lyskom-en-mode-map): Ditto.
2004-12-06 Pontus Freyhult <pont@soua.net>
......@@ -85,12 +111,12 @@
2004-11-12 Pontus Freyhult <pont@soua.net>
* commands2.el (kom-list-sessions): Use session-list-no-unread-in
* commands2.el (kom-list-sessions): Use session-list-no-unread-in
if there are no texts in the session.
* english-strings.el, swedish-strings.el (local):
Added session-list-no-unread-in.
* commands2.el (kom-modeline-select-unread-kom): Use
lyskom-session-nickname.
(kom-status-server): Dito.
......@@ -98,10 +124,10 @@
* lyskom-rest.el (lyskom-session-nickname): Take additional argument
if the nick name is to be put in the mode line.
(lyskom-mode-name-from-host): Pass mode-line arg.
* async.el (lyskom-show-logged-in-person): Use lyskom-session-nickname.
(lyskom-show-logged-out-person): Dito.
* utilities.el (lyskom-get-server-alias): Deleted (almost) unused
function.
(lyskom-nag-about-presentation): Use lyskom-session-nickname instead.
......@@ -113,7 +139,7 @@
* commands2.el (kom-list-sessions): Sort first on priority,
then on session name. Corrected bad usage of sort.
Handle nil entries in lyskom-list-news result.
* swedish-strings.el (local): Corrected singular form for
unread letters in session-list-unreads-in-conf.
......@@ -163,9 +189,10 @@
(lyskom-default-password): Dito.
(kom-default-user-name): Dito.
(lyskom-default-user-name): Dito.
* startup.el (lyskom): Use kom-default-server, kom-default-user-name
and kom-default-password.
* commands1.el (kom-view-commented-text): Cleanup (progn removal),
inhibit immediate display of footnotes.
......@@ -176,16 +203,16 @@
(lp--postpone): New function.
(lp--set-unread): New function.
(lp--toggle-message-flag, lp--toggle-invitiation,
lp--toggle-secret, lp--toggle-passive): Use
lp--toggle-secret, lp--toggle-passive): Use
lp--selected-or-current-arg and lp--toggle-flag.
* english-strings.el, swedish-strings.el (local):
* english-strings.el, swedish-strings.el (lyskom-messages):
Added lp--only-last and lp-skipping-missing-meeting.
Changed lp-footer-help.
(global): Added lp--set-unread.
(lyskom-menu): Added lp--set-unread.
(lyskom-prioritize-mode-map): Added keyboard mappings
for lp--postpone and lp--set-unread.
2004-10-29 Pontus Freyhult <pont@soua.net>
* mship-edit.el (lp--entry-set-background): Use
......@@ -198,7 +225,7 @@
(color-specifier-p): New alias.
(face-background): Reverted previous change, alias again.
(face-foreground): Reverted previous change, alias again.
2004-10-29 Pontus Freyhult <pont@pontus.its.uu.se>
* lyskom-rest.el (lyskom-format-image): Disabled run time
......@@ -210,7 +237,7 @@
2004-10-29 Pontus Freyhult <pont@soua.net>
* lyskom-rest.el (lyskom-format-image): Bugix: Used let instead
* lyskom-rest.el (lyskom-format-image): Bugfix: Used let instead
of let*.
2004-10-28 David Byers <byers@lysator.liu.se>
......@@ -263,7 +290,7 @@
kom-show-imported-message-id.
(lyskom-custom-variables): Dito.
*vars.el.in (kom-show-imported-message-id): New variable.
* vars.el.in (kom-show-imported-message-id): New variable.
(kom-show-imported-external-recipients): Changed documentation
(added kom-show-imported-message-id as "see also").
......@@ -279,7 +306,7 @@
* startup.el (kom-start-anew): Handle the case of
lyskom-default-user-name being an integer.
*vars.el.in (kom-relogin-behaviour): New variable.
* vars.el.in (kom-relogin-behaviour): New variable.
(lyskom-default-user-name): Changed documentation.
* english-strings.el, swedish-strings.el:
......
......@@ -3712,7 +3712,10 @@ a recipient. Confirmation is required for each single move.
This command accepts text number prefix arguments (see
`lyskom-read-text-no-prefix-arg')."
(interactive (list (lyskom-read-text-no-prefix-arg 'text-tree-to-move)))
(let ((root-text-stat (blocking-do 'get-text-stat text-no)))
(let ((root-text-stat (blocking-do 'get-text-stat text-no))
(last-move-tree-add-type 'move-tree-rcpt)
(last-move-leave-cc 'abc-no)
(last-move-tree-action nil))
(if root-text-stat
;; Set up default recipients for from and to.
......@@ -3732,7 +3735,7 @@ This command accepts text number prefix arguments (see
(let ((source (lyskom-read-conf-stat
'who-to-move-from-q
(list (cons 'restrict (mapcar 'car recipients)))
nil nil t))
t nil t))
(to-do (list (text-stat->text-no root-text-stat)))
(done nil))
......@@ -3749,9 +3752,17 @@ This command accepts text number prefix arguments (see
;; Check that this text is a candidate for moving
;; If not, put it in done to fool the next control
;; structure.
;;
;; A text is candidate for moving if one of its
;; recipients is the source, or there is no
;; source (in which case we're just adding)
(unless (memq (conf-stat->conf-no source)
text-to-move-recipients)
(unless text-stat
(setq done (cons text-to-move done)))
(unless (or (null source)
(memq (conf-stat->conf-no source)
text-to-move-recipients))
(lyskom-format-insert 'moving-already-moved
text-to-move source)
(setq done (cons text-to-move done)))
......@@ -3783,63 +3794,119 @@ This command accepts text number prefix arguments (see
(setq lyskom-last-viewed (point-max)))
;; Ask the user what to do
;; Ask the user what to do. Options:
;; source
;; --------------------------------------
;; null add, quit, ign, jump
;; non-null sub, move, quit, ign, jump
;; --------------------------------------
(let* ((completion-ignore-case t)
(action
(cdr
(lyskom-string-assoc
(lyskom-completing-read (lyskom-get-string 'moving-tree-what-action-q)
lyskom-move-tree-actions
nil
t
nil
nil
(car (rassoc 'move lyskom-move-tree-actions)))
lyskom-move-tree-actions))))
(action (lyskom-a-or-b-or-c-p
(lyskom-get-string 'moving-tree-what-action-q)
(if source
'(move-tree-move
move-tree-sub move-tree-ign
move-tree-jump move-tree-quit)
'(move-tree-add
move-tree-ign move-tree-jump
move-tree-quit))
(if source
(if (memq last-move-tree-action '(move-tree-move move-tree-sub))
last-move-tree-action
'move-tree-move)
'move-tree-add))))
(setq last-move-tree-action action)
(cond
;; Add recipient.
((eq action 'move-tree-add)
(condition-case nil
(let ((target
(lyskom-read-conf-stat 'who-to-add-q
'(all)
nil nil t)))
(setq last-move-tree-add-type
(lyskom-a-or-b-or-c-p 'move-tree-add-rcpt-type
'(move-tree-rcpt move-tree-cc move-tree-bcc)
last-move-tree-add-type))
(when target
(lyskom-format-insert (or (cdr (assq last-move-tree-add-type
'((move-tree-rcpt . adding-name-as-recipient)
(move-tree-cc . adding-name-as-copy)
(move-tree-bcc . adding-name-as-bcc))))
'adding-name-as-recipient)
target (text-stat->text-no text-stat))
(lyskom-move-recipient text-to-move source target
(or (cdr (assq last-move-tree-add-type
'((move-tree-rcpt . RECPT)
(move-tree-cc . CC-RECPT)
(move-tree-bcc . BCC-RECPT))))
'RECPT)))
(setq to-do (nconc (lyskom-text-comments text-stat) to-do))
)
(quit (setq to-do (cons text-to-move to-do))))
)
;; Move the text.
((eq action 'move)
((or (eq action 'move-tree-move)
(eq action 'move-tree-sub))
(condition-case nil
(let ((target
(lyskom-read-conf-stat
(if (> (length text-to-move-recipients) 1)
'who-to-move-to-or-sub-q
'who-to-move-to-q)
'(all)
(> (length text-to-move-recipients) 1)
nil t)))
(when (eq action 'move-tree-move)
(lyskom-read-conf-stat
(if (> (length text-to-move-recipients) 1)
'who-to-move-to-or-sub-q
'who-to-move-to-q)
'(all)
(> (length text-to-move-recipients) 1)
nil t))))
(if target
(lyskom-format-insert 'moving-name source target text-stat)
(lyskom-format-insert 'remove-name-as-recipient
source
(text-stat->text-no text-stat)))
(lyskom-move-recipient text-to-move source target 'RECPT)
(lyskom-move-recipient text-to-move
source
target
'RECPT
(cond ((eq last-move-leave-cc 'abc-yes-all) t)
((eq last-move-leave-cc 'abc-no-all) nil)
(t (setq last-move-leave-cc
(lyskom-a-or-b-or-c-p 'move-tree-leave-cc-q
'(abc-yes abc-no abc-yes-all abc-no-all)
last-move-leave-cc))
(cdr (assq last-move-leave-cc '((abc-yes . t)
(abc-no . nil)
(abc-yes-all . t)
(abc-no-all . nil))))))
)
(setq to-do (nconc (lyskom-text-comments text-stat) to-do))
)
(quit (setq to-do (cons text-to-move to-do))))
)
((eq action 'skip)
((eq action 'move-tree-ign)
(setq to-do (nconc (lyskom-text-comments text-stat) to-do))
)
((eq action 'quit)
((eq action 'move-tree-quit)
(setq to-do nil))
((eq action 'jump))))))))))
((eq action 'move-tree-jump))))))))))
(lyskom-format-insert 'no-such-text-no text-no)
)))
(defun lyskom-move-recipient (text-no source target type)
(defun lyskom-move-recipient (text-no source target type &optional leave-cc)
"Remove TEXT-NO from SOURCE and add it to TARGET as TYPE.
This is the internal function for moving texts around. SOURCE or TARGET
may be nil. TYPE is ignored if TARGET is nil.
may be nil. TYPE is ignored if TARGET is nil. If optional LEAVE-CC is
non-nil, then leave the original conference as a CC recipient.
Calls lyskom-report-command-answer to report the result, to callers
must have printed something without a newline at the end of the buffer."
......@@ -3854,9 +3921,14 @@ must have printed something without a newline at the end of the buffer."
t))
(add-errno lyskom-errno)
(sub-result (if (and source add-result)
(blocking-do 'sub-recipient
text-no
(conf-stat->conf-no source))
(if leave-cc
(blocking-do 'add-recipient
text-no
(conf-stat->conf-no source)
'CC-RECPT)
(blocking-do 'sub-recipient
text-no
(conf-stat->conf-no source)) )
t))
(sub-errno lyskom-errno))
......
......@@ -749,7 +749,9 @@ send. If DONTSHOW is non-nil, don't display the sent message."
(def-kom-command kom-list-sessions ()
"List current LysKOM sessions and unread messages for each sessions."
"List current LysKOM sessions and unread messages for each session.
See `kom-session-nickname' for a setting that affects display."
(interactive)
(let ((total-letters 0)
(total-texts 0)
......
......@@ -485,6 +485,22 @@ and you have finished reading. Please come back later.
(unsub-all-open . "aLeave all open conferences")
(abc-yes . "yYes")
(abc-no . "nNo")
(abc-yes-all . "aJa to all")
(abc-no-all . "xNej to all")
(move-tree-move . "mMove")
(move-tree-sub . "rRemove")
(move-tree-add . "aAdd")
(move-tree-ign . "nNothing")
(move-tree-jump . "jJump")
(move-tree-quit . "qCancel")
(move-tree-add-rcpt-type . "Add as: ")
(move-tree-rcpt . "rRecipient")
(move-tree-cc . "cCarbon copy")
(move-tree-bcc . "dBlind carbon copy")
(move-tree-leave-cc-q . "Leave original recipient as carbon copy recipient? ")
(exclude-from . "Removing %#1P from %#2M...")
......@@ -559,6 +575,7 @@ Read all about it at http://www.lysator.liu.se/history/")
(adding-name-as-recipient . "Adding %#1M as recipient of text %#2n...")
(adding-name-as-copy . "%#1M will receive a carbon copy of text %#2n...")
(adding-name-as-bcc . "%#1M will receive a blind carbon copy of text %#2n...")
(remove-name-as-recipient .
"Removing %#1M as recipient of text %#2n...")
(adding-cross-reference . "Adding cross reference...")
......@@ -570,7 +587,7 @@ Read all about it at http://www.lysator.liu.se/history/")
(error-access-denied-add-recpt . "You are not allowed to add texts to %#2M.\n")
(error-not-recipient . "%#2M is not a recipient of text %#1n.\n")
(moving-tree-what-action-q . "What do you want to do? (move) ")
(moving-tree-what-action-q . "What do you want to do? ")
(moving-cant-read . "Can't move text %#1n (unable to read text).\n")
(moving-name . "Moving text %#3n from %#1M to %#2M...")
(moving-already-moved . "Text %#1n does not have %#2M as a recipient.\nSkipping this text and its comments.\n")
......@@ -2568,12 +2585,6 @@ Change privileges for %#1P (%#1p)...")
(lp--quit . "Quit")
))
(lyskom-language-var local lyskom-move-tree-actions en
'(("Move text or subtract recipient" . move)
("Leave text and continue with comments" . skip)
("Abort this command" . quit)
("Skip this command and its comment tree" . jump)))
(lyskom-language-var local lyskom-onoff-table en
'(("on" . on) ("off" . off)))
......
......@@ -3767,9 +3767,11 @@ Returns the selected alternative (a symbol)"
alt)))
alternatives))
(alts-string (format "(%s) " (mapconcat (lambda (c)
(format "%c: %s"
(lyskom-format "%#3@%#1c:%#2s"
(elt c 0)
(elt c 1)))
(elt c 1)
(and (eq (elt c 2) default) '(face bold))
))
alts
", ")))
(nagging nil))
......@@ -3814,6 +3816,9 @@ Returns the selected alternative (a symbol)"
t)))
(signal 'quit nil))
(setq alts (cons (list ?\C-m
(lyskom-traverse alt alts (when (eq default (elt alt 2)) (lyskom-traverse-break (elt alt 1))))
default) alts))
(lyskom-message "%s" (concat prompt (elt (assq input-char alts) 1)))
(if (eq input-char ?\C-m)
default
......
......@@ -1699,21 +1699,21 @@ See `kom-prioritize-in-window'."
(defun lp--mode ()
"\\<lyskom-prioritize-mode-map>Mode for prioritizing conferences in LysKOM.
\[lp--move-up] moves a single conference up in the list.
\[lp--mode-down] moves a single conference down in the list.
\\[lp--move-up] moves a single conference up in the list.
\\[lp--mode-down] moves a single conference down in the list.
SPC toggles the selection of a single membership.
\[lp--select-region] selects all conferences between point and mark.
\[lp--select-priority] selects all conferences with a certain priority.
\[lp--deselect-region] clears the selection.
\\[lp--select-region] selects all conferences between point and mark.
\\[lp--select-priority] selects all conferences with a certain priority.
\\[lp--deselect-region] clears the selection.
\[lp--yank] moves all selected conferences to where point is in the list.
\[lp--set-priority] changes the priority of all selected conferences.
\\[lp--yank] moves all selected conferences to where point is in the list.
\\[lp--set-priority] changes the priority of all selected conferences.
\[lp--toggle-passive] makes passive memberships active and vice versa.
\[lp--toggle-invitation] toggles the invitation flag of a membership.
\[lp--toggle-secret] makes secret memberships non-secret and vice versa.
\[lp--toggle-message-flag] toggles reception of group messages for that conference.
\\[lp--toggle-passive] makes passive memberships active and vice versa.
\\[lp--toggle-invitation] toggles the invitation flag of a membership.
\\[lp--toggle-secret] makes secret memberships non-secret and vice versa.
\\[lp--toggle-message-flag] toggles reception of group messages for that conference.
Changes take effect immediately.
......@@ -1880,22 +1880,21 @@ With prefix arg, removes any such filter that has been applied."
(defun lp--show-hide-read-memberships (arg)
"Hide memberships that contain only read texts.
With prefix argument, remove any such filters."
"Toggle display of memberships with no unread texts."
(interactive "P")
(if arg
(if (lp--entry-filter-active 'lp--entry-filter-read)
(lp--del-entry-filter 'lp--entry-filter-read)
(unless (lp--entry-filter-active 'lp--entry-filter-read)
(lp--add-entry-filter 'lp--entry-filter-read))))
(lp--add-entry-filter 'lp--entry-filter-read)))
(defun lp--show-hide-passive-memberships (arg)
"Hide passive memberships.
With prefix argument, remove any such filters."
"Toggle display of passive memberships."
(interactive "P")
(if arg
(if (lp--entry-filter-active 'lp--entry-filter-passive)
(lp--del-entry-filter 'lp--entry-filter-passive)
(unless (lp--entry-filter-active 'lp--entry-filter-passive)
(lp--add-entry-filter 'lp--entry-filter-passive))))
(lp--add-entry-filter 'lp--entry-filter-passive)))
......
......@@ -484,6 +484,22 @@ du har l
(unsub-all-open . "aG ur alla ppna mten")
(abc-yes . "jJa")
(abc-no . "nNej")
(abc-yes-all . "aJa till alla")
(abc-no-all . "xNej till alla")
(move-tree-move . "fFlytta")
(move-tree-sub . "sSubtrahera")
(move-tree-add . "aAddera")
(move-tree-ign . "iIngenting")
(move-tree-jump . "hHoppa")
(move-tree-quit . "qAvbryt")
(move-tree-add-rcpt-type . "Addera som: ")
(move-tree-rcpt . "mMottagare")
(move-tree-cc . "eExtra kopia")
(move-tree-bcc . "dDold kopia")
(move-tree-leave-cc-q . "Lmna ursprungsmottagare som extrakopiemottagare? ")
(exclude-from . "Utesluta %#1P frn %#2M...")
......@@ -582,6 +598,7 @@ i svensk datorhistoria. L
(adding-name-as-recipient . "Adderar %#1M som mottagare till text %#2n...")
(adding-name-as-copy . "Adderar %#1M som kopiemottagare till text %#2n...")
(adding-name-as-bcc . "Adderar %#1M som dold kopiemottagare till text %#2n...")
(remove-name-as-recipient .
"Subtraherar %#1M som mottagare frn text %#2n...")
(adding-cross-reference . "Adderar referens...")
......@@ -593,7 +610,7 @@ i svensk datorhistoria. L
(error-access-denied-add-recpt . "Du fr inte addera inlgg till %#2M.\n")
(error-not-recipient . "%#2M r inte mottagare till inlgg %#1n.\n")
(moving-tree-what-action-q . "Vad vill du gra? (flytta) ")
(moving-tree-what-action-q . "Vad vill du gra? ")
(moving-cant-read . "Det gick inte att inte flytta text %#1n (kan inte lsa texten).\n")
(moving-name . "Flyttar text %#3n frn %#1M till %#2M...")
(moving-already-moved . "Inlgg %#1n har inte %#2M som mottagare.\nFlyttar inte inlgget eller dess kommentarstrd.\n")
......@@ -2608,12 +2625,6 @@ Nuvarande r
(lp--quit . "Avsluta")
))
(lyskom-language-var local lyskom-move-tree-actions sv
'(("Flytta eller subtrahera mottagare" . move)
("Lmna kvar och fortstt med kommentarerna" . skip)
("Avsluta helt" . quit)
("Hoppa ver inlgget och dess kommentarstrd" . jump)))
(lyskom-language-var local lyskom-onoff-table sv
'(("p" . on) ("av" . off)))
......
......@@ -356,6 +356,10 @@ the priority among links that match the same text is undefined."
lyskom-default-conference-current))
(save last-added-rcpt))
(who-to-move-to-q
(default . ((lyskom-default-conference-saved last-added-rcpt)
lyskom-default-conference-current))
(save last-added-rcpt))
(who-to-add-q
(default . ((lyskom-default-conference-saved last-added-rcpt)
lyskom-default-conference-current))
(save last-added-rcpt)))
......@@ -1838,7 +1842,7 @@ reattach. When set to `nil', the client will not attempt to reattach."
When this is set to `t', the client will store the password for the
current session as a buffert local variable. This can be used in
conjunction with kom-relogin-behaviour to reattach dead sessions
conjunction with `kom-relogin-behaviour' to reattach dead sessions
automatically."
server)
......@@ -4400,7 +4404,7 @@ Values other than `t' and `nil' are reserved for future use."
server)
(def-kom-var kom-format-show-images t
"**Control in-line display of images.
"**Controls in-line display of images.
When set to `t', attempt to display images in-line. When set to `nil',
images are handled as normal texts.
......@@ -4646,9 +4650,12 @@ the value of kom-tell-phrases for fun.")
;;; Externally defined variables (environment)
(def-kom-var kom-default-server "kom.lysator.liu.se"
(def-kom-var kom-default-server nil
"**Default LysKOM server.
Use this server to log in to LysKOM. Can be overridden by the
`KOMSERVER' environment variable.
The value of this variable must be a string or `nil'."
local)
......@@ -4664,7 +4671,9 @@ The value of this variable must be a string, indicating the
default user name, an integer indicating the conference number or
`nil' to indicate no default. If set to an integer, log in as the
user with that conference number. If set to a string, log in as the
user with that name."
user with that name.
Overrides the environment variable `KOMNAME'."
local)
(def-kom-var lyskom-default-user-name nil
......@@ -4675,8 +4684,8 @@ user with that name."
(def-kom-var kom-default-password nil
"**Default LysKOM password.
The value of this variable must be a string or `nil'. There may be an
environment variable for this, but it shouldn't be used if there is."
The value of this variable must be a string or `nil'. Overrides the
environment variable `KOMPASSWORD' \(which should never be used)."
local)
(def-kom-var lyskom-default-password 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