Commit 23c0b80e authored by David Byers's avatar David Byers
Browse files

Minor bug fixes

Prompt to edit text that couldn't be created
parent 03eba4b7
1999-10-17 David Byers <davby@ida.liu.se>
* commands2.el (kom-postpone): Added RE-EDIT-TEXT read-info type.
* clienttypes.el (set-read-info->misc): Add misc field to read-info.
(read-info->misc): Same here.
(lyskom-create-read-info): Same here.
* lyskom-rest.el (lyskom-what-to-do): Add support for re-edit text.
(kom-re-edit-next-text): New function.
(lyskom-next-command): Add support for re-edit text.
(lyskom-update-prompt): Add support for re-edit text.
1999-10-16 David Byers <davby@ida.liu.se>
* option-edit.el (lyskom-ding-widget): Turned-off is zero, not
nil to make the per sender option avalable in Gnu Emacs.
* swedish-strings.el (lyskom-custom-strings): Fixed speling eror.
1999-10-15 David Byers <davby@ida.liu.se>
* swedish-strings.el (lyskom-sv-mode-map): Bind aring and
adiaeresis.
1999-10-15 David Byers <davby@ida.liu.se> 1999-10-15 David Byers <davby@ida.liu.se>
* utilities.el (lyskom-client-date-string): Print year correctly. * utilities.el (lyskom-client-date-string): Print year correctly.
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
;;; COMM-IN - Type containing the list of comments to a text ;;; COMM-IN - Type containing the list of comments to a text
;;; FOOTN-IN - Type containing the list of footnotes to a text ;;; FOOTN-IN - Type containing the list of footnotes to a text
;;; CONF - Basic type of unread in a conf. ;;; CONF - Basic type of unread in a conf.
;;; RE-EDIT-TEXT - Re-edit a failed submission. Buffer is in misc.
;;; ;;;
;;; The types REVIEW-TREE, COMM-IN and FOOTN-IN are created for new for ;;; The types REVIEW-TREE, COMM-IN and FOOTN-IN are created for new for
;;; every text read (recursively) when appropriate. ;;; every text read (recursively) when appropriate.
...@@ -72,7 +73,7 @@ ...@@ -72,7 +73,7 @@
conf-stat conf-stat
priority priority
text-list text-list
&optional comm-to forward) &optional comm-to forward misc)
"Create a read-info from all parameters." "Create a read-info from all parameters."
;; The last nil is for the unfetched-texts pair (first . last) ;; The last nil is for the unfetched-texts pair (first . last)
;; This field is only applicable in read-infos of type CONF where ;; This field is only applicable in read-infos of type CONF where
...@@ -80,7 +81,7 @@ ...@@ -80,7 +81,7 @@
;; yet been fetched. ;; yet been fetched.
(cons (cons
'READ-INFO 'READ-INFO
(vector type conf-stat priority text-list comm-to forward nil))) (vector type conf-stat priority text-list comm-to forward nil misc)))
(defsubst read-info->type (read-info) (defsubst read-info->type (read-info)
"Get type from read-info." "Get type from read-info."
...@@ -110,6 +111,10 @@ ...@@ -110,6 +111,10 @@
"Get forward from read-info." "Get forward from read-info."
(elt (cdr read-info) 6)) (elt (cdr read-info) 6))
(defsubst read-info->misc (read-info)
"Get forward from read-info."
(elt (cdr read-info) 7))
(defsubst set-read-info->type (read-info newval) (defsubst set-read-info->type (read-info newval)
"Set type in read-info to NEWVAL." "Set type in read-info to NEWVAL."
(aset (cdr read-info) 0 newval)) (aset (cdr read-info) 0 newval))
...@@ -138,6 +143,10 @@ ...@@ -138,6 +143,10 @@
"Set forward in read-info to NEWVAL." "Set forward in read-info to NEWVAL."
(aset (cdr read-info) 6 newval)) (aset (cdr read-info) 6 newval))
(defsubst set-read-info->misc (read-info newval)
"Set forward in read-info to NEWVAL."
(aset (cdr read-info) 7 newval))
(defsubst lyskom-read-info-p (object) (defsubst lyskom-read-info-p (object)
"Return t if OBJECT is a read-info." "Return t if OBJECT is a read-info."
......
...@@ -1543,6 +1543,7 @@ current conference to another session." ...@@ -1543,6 +1543,7 @@ current conference to another session."
rlist))) rlist)))
(setcdr rlist cell)) (setcdr rlist cell))
(setq finished t)) (setq finished t))
((eq type 'RE-EDIT-TEXT))
(t (t
(signal 'lyskom-internal-error '("lyskom-remove-comment-chains"))))) (signal 'lyskom-internal-error '("lyskom-remove-comment-chains")))))
(-- len))) (-- len)))
......
...@@ -480,7 +480,7 @@ so it's not as clean as it ought to be." ...@@ -480,7 +480,7 @@ so it's not as clean as it ought to be."
If optional IS-ANONYMOUS is non-nil, assume that the text is being submitted If optional IS-ANONYMOUS is non-nil, assume that the text is being submitted
anonymously and take actions to avoid revealing the sender." anonymously and take actions to avoid revealing the sender."
(condition-case err (condition-case err
(if (or (not lyskom-edit-text-sent) ;++MINOR checked mode-name against lyskom-edit-mode-name (if (or (not lyskom-edit-text-sent)
(j-or-n-p (lyskom-get-string 'already-sent))) (j-or-n-p (lyskom-get-string 'already-sent)))
(progn (progn
(let ((buffer (current-buffer)) (let ((buffer (current-buffer))
...@@ -541,7 +541,6 @@ anonymously and take actions to avoid revealing the sender." ...@@ -541,7 +541,6 @@ anonymously and take actions to avoid revealing the sender."
(lyskom-edit-extract-text)) (lyskom-edit-extract-text))
(lyskom-edit-extract-text))) (lyskom-edit-extract-text)))
;++MINOR (setq mode-name "LysKOM sending")
(lyskom-edit-sending-mode 1) (lyskom-edit-sending-mode 1)
(save-excursion (save-excursion
(let ((full-message (let ((full-message
...@@ -1583,9 +1582,18 @@ Point must be located on the line where the subject is." ...@@ -1583,9 +1582,18 @@ Point must be located on the line where the subject is."
(beep) (beep)
(lyskom-message "%s" (lyskom-format 'could-not-create-text lyskom-errno (lyskom-message "%s" (lyskom-format 'could-not-create-text lyskom-errno
(lyskom-get-error-text lyskom-errno))) (lyskom-get-error-text lyskom-errno)))
(set-buffer lyskom-buffer)
(read-list-enter-first (lyskom-create-read-info 'RE-EDIT-TEXT
nil
256
nil
nil
nil
edit-buffer)
lyskom-reading-list)
(lyskom-update-prompt)
(set-buffer edit-buffer) (set-buffer edit-buffer)
(lyskom-edit-mode 1) (lyskom-edit-mode 1)
;++MINOR (setq mode-name lyskom-edit-mode-name)
(sit-for 0)) (sit-for 0))
(is-anonymous (is-anonymous
(lyskom-format-insert-before-prompt 'text-created-anonymous text-no)) (lyskom-format-insert-before-prompt 'text-created-anonymous text-no))
......
...@@ -987,6 +987,8 @@ You should set it to a better value.\n") ...@@ -987,6 +987,8 @@ You should set it to a better value.\n")
(prompt-several-messages . "(%d messages)") (prompt-several-messages . "(%d messages)")
(prompt-single-message . "(%d message)") (prompt-single-message . "(%d message)")
(re-edit-text-prompt . "Edit the text that couldn't be created")
(text-buffer-missing . "The text buffer no longer exists.\n")
(go-to-pri-conf-prompt . "Go to next prioritized conference") (go-to-pri-conf-prompt . "Go to next prioritized conference")
(read-pri-text-conf . "Read next prioritized text") (read-pri-text-conf . "Read next prioritized text")
(review-next-text-prompt . "Review next text") (review-next-text-prompt . "Review next text")
...@@ -3230,7 +3232,7 @@ be saved in the server. Otherwise it will be saved in your .emacs.") ...@@ -3230,7 +3232,7 @@ be saved in the server. Otherwise it will be saved in your .emacs.")
(error-22 . "Secret but not read-protected") (error-22 . "Secret but not read-protected")
(error-23 . "You are not allowed to change the erson/conference flag") (error-23 . "You are not allowed to change the erson/conference flag")
(error-24 . "Error in the dtabase. Tough luck.") (error-24 . "Error in the dtabase. Tough luck.")
(error-25 . "Illegal misc-field. (Internal error)") (error-25 . "Invalid recipient or comment type")
(error-26 . "Illegal info type. (Bug in the client)") (error-26 . "Illegal info type. (Bug in the client)")
(error-27 . "Already recipient of this text") (error-27 . "Already recipient of this text")
(error-28 . "Already comment to this text") (error-28 . "Already comment to this text")
......
...@@ -250,6 +250,8 @@ If the optional argument REFETCH is non-nil, all caches are cleared and ...@@ -250,6 +250,8 @@ If the optional argument REFETCH is non-nil, all caches are cleared and
(lyskom-view-priority-text)) (lyskom-view-priority-text))
((eq lyskom-command-to-do 'next-text) ((eq lyskom-command-to-do 'next-text)
(kom-view-next-text)) (kom-view-next-text))
((eq lyskom-command-to-do 'reedit-text)
(kom-re-edit-next-text))
((eq lyskom-command-to-do 'next-conf) ((eq lyskom-command-to-do 'next-conf)
(kom-go-to-next-conf)) (kom-go-to-next-conf))
((eq lyskom-command-to-do 'next-pri-conf) ((eq lyskom-command-to-do 'next-pri-conf)
...@@ -303,6 +305,19 @@ If the optional argument REFETCH is non-nil, all caches are cleared and ...@@ -303,6 +305,19 @@ If the optional argument REFETCH is non-nil, all caches are cleared and
(lyskom-end-of-command))) (lyskom-end-of-command)))
;;;; ================================================================
;;;; Re-edit text
(def-kom-command kom-re-edit-next-text ()
"Display a buffer containing a failed submission"
(interactive)
(let ((el (read-list->first lyskom-reading-list)))
(set-read-list-del-first lyskom-reading-list)
(if (buffer-live-p (read-info->misc el))
(lyskom-display-buffer (read-info->misc el))
(lyskom-format-insert 'text-buffer-missing))))
;;;; ================================================================ ;;;; ================================================================
;;;; View next text. ;;;; View next text.
...@@ -2288,6 +2303,11 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing." ...@@ -2288,6 +2303,11 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing."
(or (eq lyskom-current-prompt prompt) (or (eq lyskom-current-prompt prompt)
(lyskom-beep kom-ding-on-priority-break))) (lyskom-beep kom-ding-on-priority-break)))
((eq to-do 'reedit-text)
(setq prompt 're-edit-text-prompt)
(or (eq lyskom-current-prompt prompt)))
((eq to-do 'next-pri-text) ((eq to-do 'next-pri-text)
(setq prompt 'read-pri-text-conf) (setq prompt 'read-pri-text-conf)
(or (eq lyskom-current-prompt prompt) (or (eq lyskom-current-prompt prompt)
...@@ -2500,6 +2520,7 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing." ...@@ -2500,6 +2520,7 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing."
next-pri-conf There is a conference with higher priority to be read. next-pri-conf There is a conference with higher priority to be read.
next-text There are texts on lyskom-reading-list. next-text There are texts on lyskom-reading-list.
next-conf There are texts on lyskom-to-do-list. next-conf There are texts on lyskom-to-do-list.
reedit-text There is an edit buffer with an error.
when-done There are no unread texts. when-done There are no unread texts.
unknown There are pending replies." unknown There are pending replies."
(cond (cond
...@@ -2518,6 +2539,10 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing." ...@@ -2518,6 +2539,10 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing."
1) 1)
'next-pri-conf 'next-pri-conf
'next-pri-text)) 'next-pri-text))
((and (not (read-list-isempty lyskom-reading-list))
(eq (read-info->type (read-list->first lyskom-reading-list))
'RE-EDIT-TEXT))
'reedit-text)
((not (read-list-isempty lyskom-reading-list)) ((not (read-list-isempty lyskom-reading-list))
'next-text) 'next-text)
((not (read-list-isempty lyskom-to-do-list)) ((not (read-list-isempty lyskom-to-do-list))
......
...@@ -893,9 +893,9 @@ customize buffer but do not save them to the server." ...@@ -893,9 +893,9 @@ customize buffer but do not save them to the server."
':args ':args
(list (list 'item (list (list 'item
':tag (lyskom-custom-string 'turned-off) ':tag (lyskom-custom-string 'turned-off)
':value nil ':value 0
':format "%t" ':format "%t"
':match '(lambda (w v) (or (null v) (eq v 0)))) ':match '(lambda (w v) (eq v 0)))
(list 'lyskom-number (list 'lyskom-number
':tag (lyskom-custom-string 'number-of-times) ':tag (lyskom-custom-string 'number-of-times)
':help-echo (lyskom-custom-string 'select-number) ':help-echo (lyskom-custom-string 'select-number)
......
...@@ -81,6 +81,8 @@ ...@@ -81,6 +81,8 @@
(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 (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 (kbd "*") 'kom-button-press) (define-key lyskom-sv-edit-prefix (kbd "*") 'kom-button-press)
(define-key lyskom-sv-edit-prefix (kbd "=") 'kom-menu-button-press) (define-key lyskom-sv-edit-prefix (kbd "=") 'kom-menu-button-press)
(define-key lyskom-sv-edit-prefix (kbd "C-i") 'lyskom-sv-edit-insert-prefix) (define-key lyskom-sv-edit-prefix (kbd "C-i") 'lyskom-sv-edit-insert-prefix)
...@@ -766,7 +768,7 @@ Annat se \\[describe-mode] ---") ...@@ -766,7 +768,7 @@ Annat se \\[describe-mode] ---")
(text-to-comment-q . "Vilket inlgg vill du kommentera? ") (text-to-comment-q . "Vilket inlgg vill du kommentera? ")
(conf-has-motd-no . "Mtet har en lapp p drren. (%#1d)\n\n%#2s") (conf-has-motd-no . "Mtet har en lapp p drren. (%#1d)\n\n%#2s")
(still-want-to-add . "Vill du fortfarande addera mtet? ") (still-want-to-add . "Vill du fortfarande addera mtet? ")
(could-not-create-text . "\nTexten kunde ej skapas. Felet: %#2s.\n") (could-not-create-text . "\nTexten kunde ej skapas. %#2s.\n")
(no-get-text . "Du fick inte hmta texten.") (no-get-text . "Du fick inte hmta texten.")
(unknown-header . "Oknd information p raden") (unknown-header . "Oknd information p raden")
(transform-error . "Skicka in oformatterat (%#1s)? ") (transform-error . "Skicka in oformatterat (%#1s)? ")
...@@ -994,6 +996,8 @@ Du b ...@@ -994,6 +996,8 @@ Du b
(prompt-several-messages . "(%d meddelanden)") (prompt-several-messages . "(%d meddelanden)")
(prompt-single-message . "(%d meddelande)") (prompt-single-message . "(%d meddelande)")
(re-edit-text-prompt . "Redigera texten som inte kunde skapas")
(text-buffer-missing . "Inlggsbufferten existerar inte lngre.\n")
(go-to-pri-conf-prompt . "G till nsta prioriterade mte") (go-to-pri-conf-prompt . "G till nsta prioriterade mte")
(read-pri-text-conf . "Lsa nsta prioriterade text") (read-pri-text-conf . "Lsa nsta prioriterade text")
(review-next-text-prompt . "terse nsta text") (review-next-text-prompt . "terse nsta text")
...@@ -1771,8 +1775,12 @@ Du m ...@@ -1771,8 +1775,12 @@ Du m
(define-key lyskom-sv-mode-map (kbd "{") 'lyskom-sv-change-prefix) ; krullar (define-key lyskom-sv-mode-map (kbd "{") 'lyskom-sv-change-prefix) ; krullar
(define-key lyskom-sv-mode-map (kbd "[") 'lyskom-sv-change-prefix) (define-key lyskom-sv-mode-map (kbd "[") 'lyskom-sv-change-prefix)
(define-key lyskom-sv-mode-map [adiaeresis] 'lyskom-sv-change-prefix)
(define-key lyskom-sv-mode-map [Adiaeresis] 'lyskom-sv-change-prefix)
(define-key lyskom-sv-mode-map (kbd "}") 'lyskom-sv-review-prefix) (define-key lyskom-sv-mode-map (kbd "}") 'lyskom-sv-review-prefix)
(define-key lyskom-sv-mode-map (kbd "]") 'lyskom-sv-review-prefix) (define-key lyskom-sv-mode-map (kbd "]") 'lyskom-sv-review-prefix)
(define-key lyskom-sv-mode-map [aring] 'lyskom-sv-review-prefix)
(define-key lyskom-sv-mode-map [Aring] 'lyskom-sv-review-prefix)
;;(define-key lyskom-sv-mode-map "vi" 'vilka) ;;(define-key lyskom-sv-mode-map "vi" 'vilka)
...@@ -1814,6 +1822,8 @@ Du m ...@@ -1814,6 +1822,8 @@ Du m
(define-key lyskom-sv-mode-map (kbd "l s") 'kom-membership) (define-key lyskom-sv-mode-map (kbd "l s") 'kom-membership)
(define-key lyskom-sv-mode-map (kbd "l ") 'kom-list-summary) (define-key lyskom-sv-mode-map (kbd "l ") 'kom-list-summary)
(define-key lyskom-sv-mode-map (kbd "l ") 'kom-list-summary) (define-key lyskom-sv-mode-map (kbd "l ") 'kom-list-summary)
(define-key lyskom-sv-mode-map [?l adiaeresis] 'kom-list-summary)
(define-key lyskom-sv-mode-map [?l Adiaeresis] 'kom-list-summary)
(define-key lyskom-sv-mode-map (kbd "l {") 'kom-list-summary) (define-key lyskom-sv-mode-map (kbd "l {") 'kom-list-summary)
(define-key lyskom-sv-mode-map (kbd "l [") 'kom-list-summary) (define-key lyskom-sv-mode-map (kbd "l [") 'kom-list-summary)
(define-key lyskom-sv-mode-map (kbd "l f") 'kom-list-filters) (define-key lyskom-sv-mode-map (kbd "l f") 'kom-list-filters)
...@@ -1836,6 +1846,8 @@ Du m ...@@ -1836,6 +1846,8 @@ Du m
(define-key lyskom-sv-mode-map (kbd "f t") 'kom-move-text) (define-key lyskom-sv-mode-map (kbd "f t") 'kom-move-text)
(define-key lyskom-sv-mode-map (kbd "f ") 'kom-filter-subject) (define-key lyskom-sv-mode-map (kbd "f ") 'kom-filter-subject)
(define-key lyskom-sv-mode-map (kbd "f ") 'kom-filter-subject) (define-key lyskom-sv-mode-map (kbd "f ") 'kom-filter-subject)
(define-key lyskom-sv-mode-map [?f Adiaeresis] 'kom-filter-subject)
(define-key lyskom-sv-mode-map [?f adiaeresis] 'kom-filter-subject)
(define-key lyskom-sv-mode-map (kbd "f {") 'kom-filter-subject) (define-key lyskom-sv-mode-map (kbd "f {") 'kom-filter-subject)
(define-key lyskom-sv-mode-map (kbd "f [") 'kom-filter-subject) (define-key lyskom-sv-mode-map (kbd "f [") 'kom-filter-subject)
(define-key lyskom-sv-mode-map (kbd "f f") 'kom-filter-author) (define-key lyskom-sv-mode-map (kbd "f f") 'kom-filter-author)
...@@ -1884,6 +1896,8 @@ Du m ...@@ -1884,6 +1896,8 @@ Du m
(define-key lyskom-sv-mode-map (kbd "s p") 'kom-status-person) (define-key lyskom-sv-mode-map (kbd "s p") 'kom-status-person)
(define-key lyskom-sv-mode-map (kbd "s s") 'kom-status-session) (define-key lyskom-sv-mode-map (kbd "s s") 'kom-status-session)
(define-key lyskom-sv-mode-map (kbd "s ") 'kom-send-message) (define-key lyskom-sv-mode-map (kbd "s ") 'kom-send-message)
(define-key lyskom-sv-mode-map [?s adiaeresis] 'kom-send-message)
(define-key lyskom-sv-mode-map [?s Adiaeresis] 'kom-send-message)
(define-key lyskom-sv-mode-map (kbd "s {") 'kom-send-message) (define-key lyskom-sv-mode-map (kbd "s {") 'kom-send-message)
(define-key lyskom-sv-mode-map (kbd "s [") 'kom-send-message) (define-key lyskom-sv-mode-map (kbd "s [") 'kom-send-message)
...@@ -2095,7 +2109,7 @@ Du m ...@@ -2095,7 +2109,7 @@ Du m
(turned-off . "Avslaget ") (turned-off . "Avslaget ")
(number-of-times . "Ngra gnger") (number-of-times . "Ngra gnger")
(specific-spec . "Per mottager/avsndare") (specific-spec . "Per mottagare/avsndare")
(sound-file . "Ljudfil") (sound-file . "Ljudfil")
(other-persons . "Alla andra") (other-persons . "Alla andra")
(selected-mark . "Markering") (selected-mark . "Markering")
...@@ -3275,14 +3289,14 @@ i servern. Annars sparas det i din .emacs.") ...@@ -3275,14 +3289,14 @@ i servern. Annars sparas det i din .emacs.")
(error-15 . "Du kan inte anvnda globalt textnummer 0") (error-15 . "Du kan inte anvnda globalt textnummer 0")
(error-16 . "Inget sdant lokalt textnummer") (error-16 . "Inget sdant lokalt textnummer")
(error-17 . "Du kan inte anvnda lokalt textnummer 0") (error-17 . "Du kan inte anvnda lokalt textnummer 0")
(error-18 . "Namnet fr kort eller fr lngt eller innehller felaktiga tecken") (error-18 . "Namnet fr kort, fr lngt eller innehller felaktiga tecken")
(error-19 . "Index utanfr grnserna") (error-19 . "Index utanfr grnserna")
(error-20 . "Mtet existerar redan") (error-20 . "Mtet existerar redan")
(error-21 . "Personen existerar redan") (error-21 . "Personen existerar redan")
(error-22 . "Hemligt, men ej lsskyddat") (error-22 . "Hemligt, men ej lsskyddat")
(error-23 . "Du fr inte ndra person/mtesflaggan") (error-23 . "Du fr inte ndra person/mtesflaggan")
(error-24 . "Fel i databasen. Attans otur.") (error-24 . "Fel i databasen. Attans otur.")
(error-25 . "Otilltet misc-flt. (Internt fel)") (error-25 . "Otillten mottagartyp eller kommentarslnk")
(error-26 . "Otillten infotyp. (Bug i klienten)") (error-26 . "Otillten infotyp. (Bug i klienten)")
(error-27 . "Redan mottagare till denna text") (error-27 . "Redan mottagare till denna text")
(error-28 . "Redan kommentar till denna text") (error-28 . "Redan kommentar till denna text")
......
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