Commit e7368e3f authored by David Byers's avatar David Byers
Browse files

Work on bug 984 (mark texts unread)

Detailed changes:
> 2003-03-15  David Byers  <david.byers@swipnet.se>
>
> 	* lyskom-rest.el (kom-initial-digit-unread): New command.
>
> 	* vars.el.in (lyskom-text-no-prompts-defaults): Added
> 	kom-mark-unread.
>
> 	* lyskom-rest.el (lyskom-mark-unread): New function.
> 	(kom-mark-unread): New command.
>
> 	* services.el (initiate-mark-as-unread): New function.
>
parent 7bee7316
2003-03-15 David Byers <david.byers@swipnet.se>
Work on bug 984:
* lyskom-rest.el (kom-initial-digit-unread): New command.
* vars.el.in (lyskom-text-no-prompts-defaults): Added
kom-mark-unread.
* lyskom-rest.el (lyskom-mark-unread): New function.
(kom-mark-unread): New command.
* services.el (initiate-mark-as-unread): New function.
2003-03-13 David Byers <david.byers@swipnet.se>
Some work on bug 983:
......
......@@ -1847,6 +1847,9 @@ environment to one that uses \"%#2s\" to encode text.
(super-jump-q . "Super jump which text? ")
(conf-list-legend . "* Not member; - Passive member\n")
(unread-text-q . "Make which text unread? ")
(marking-text-unread . "Marking text %#1n as unread...")
))
......@@ -2052,6 +2055,7 @@ environment to one that uses \"%#2s\" to encode text.
(kom-recommend-conference . "Recommend conference")
(kom-redirect-comments . "Redirect comments")
(kom-copy-options . "Copy options")
(kom-mark-unread . "Unread text")
))
(lyskom-language-var global lyskom-language-codes en
......@@ -2271,6 +2275,7 @@ environment to one that uses \"%#2s\" to encode text.
(defvar lyskom-en-who-prefix)
(defvar lyskom-en-A-prefix)
(defvar lyskom-en-B-prefix)
(defvar lyskom-en-unread-prefix)
(if lyskom-en-mode-map
nil
......@@ -2285,6 +2290,7 @@ environment to one that uses \"%#2s\" to encode text.
(define-prefix-command 'lyskom-en-who-prefix)
(define-prefix-command 'lyskom-en-A-prefix)
(define-prefix-command 'lyskom-en-B-prefix)
(define-prefix-command 'lyskom-en-unread-prefix)
(define-key lyskom-en-mode-map (kbd "h") 'lyskom-en-change-prefix)
(define-key lyskom-en-mode-map (kbd "r") 'lyskom-en-review-prefix)
......@@ -2295,6 +2301,7 @@ environment to one that uses \"%#2s\" to encode text.
(define-key lyskom-en-mode-map (kbd "w") 'lyskom-en-who-prefix)
(define-key lyskom-en-mode-map (kbd "a") 'lyskom-en-A-prefix)
(define-key lyskom-en-mode-map (kbd "b") 'lyskom-en-B-prefix)
(define-key lyskom-en-mode-map (kbd "u") 'lyskom-en-unread-prefix)
(define-key lyskom-en-mode-map (kbd "M-m") 'kom-toggle-mark-as-read-prefix)
......@@ -2378,6 +2385,18 @@ environment to one that uses \"%#2s\" to encode text.
(define-key lyskom-en-change-prefix (kbd "t") 'kom-move-text)
(define-key lyskom-en-change-prefix (kbd "T") 'kom-move-text-tree)
(define-key lyskom-en-unread-prefix (kbd "SPC") 'kom-mark-unread)
(define-key lyskom-en-unread-prefix (kbd "0") 'kom-initial-digit-unread)
(define-key lyskom-en-unread-prefix (kbd "1") 'kom-initial-digit-unread)
(define-key lyskom-en-unread-prefix (kbd "2") 'kom-initial-digit-unread)
(define-key lyskom-en-unread-prefix (kbd "3") 'kom-initial-digit-unread)
(define-key lyskom-en-unread-prefix (kbd "4") 'kom-initial-digit-unread)
(define-key lyskom-en-unread-prefix (kbd "5") 'kom-initial-digit-unread)
(define-key lyskom-en-unread-prefix (kbd "6") 'kom-initial-digit-unread)
(define-key lyskom-en-unread-prefix (kbd "7") 'kom-initial-digit-unread)
(define-key lyskom-en-unread-prefix (kbd "8") 'kom-initial-digit-unread)
(define-key lyskom-en-unread-prefix (kbd "9") 'kom-initial-digit-unread)
(define-key lyskom-en-review-prefix (kbd "SPC") 'kom-view)
(define-key lyskom-en-review-prefix (kbd "0") 'kom-initial-digit-view)
(define-key lyskom-en-review-prefix (kbd "1") 'kom-initial-digit-view)
......
......@@ -356,6 +356,47 @@ by design."
(t (lyskom-insert 'confusion-what-to-view))))
(lyskom-end-of-command)))
(defun kom-initial-digit-unread ()
(interactive)
(setq unread-command-events (cons last-command-event
unread-command-events))
(call-interactively 'kom-mark-unread nil))
(def-kom-command kom-mark-unread (text-no)
"MAke a single text unread. This command is functional only on servers
that support making text unread."
(interactive (list (lyskom-read-text-no-prefix-arg 'unread-text-q)))
(lyskom-format-insert 'marking-text-unread text-no)
(lyskom-report-command-answer (lyskom-mark-unread text-no)))
(defun lyskom-mark-unread (text-no)
"Mark text TEXT-NO in all conferences.
Returns non-nil if successful."
(let ((text-stat (blocking-do 'get-text-stat text-no))
(conf-list nil))
(and text-stat
(not (lyskom-traverse misc-info (text-stat->misc-info-list text-stat)
(when (memq (misc-info->type misc-info) lyskom-recpt-types-list)
(let* ((mship (lyskom-get-membership (misc-info->recipient-no misc-info)))
(recipient (and mship (blocking-do 'get-conf-stat (misc-info->recipient-no misc-info)))))
(when (and mship recipient)
(if (not (blocking-do 'mark-as-unread
(misc-info->recipient-no misc-info)
(misc-info->local-no misc-info)))
(lyskom-traverse-break 'error)
(when (lyskom-visible-membership mship)
(unless (read-list-enter-text text-no
recipient
lyskom-to-do-list)
(let ((info (lyskom-create-read-info
'CONF
recipient
(membership->priority mship)
(lyskom-create-text-list (list text-no)))))
(read-list-enter-read-info info lyskom-to-do-list)
(if (= lyskom-current-conf (conf-stat->conf-no recipient))
(read-list-enter-read-info info lyskom-reading-list))))))))))))))
;;;; ================================================================
;;;; Re-edit text
......
......@@ -1265,6 +1265,12 @@ Args: KOM-QUEUE HANDLER SESSION-NO &rest DATA"
(lyskom-send-packet kom-queue (lyskom-format-objects 106 pers-no flags))
(cache-del-pers-stat pers-no)))
(defun initiate-mark-as-unread (kom-queue handler conf-no text &rest data)
(lyskom-server-call
(lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-void)
(lyskom-send-packet kom-queue (lyskom-format-objects 109 conf-no text))))
;;; ================================================================
......
......@@ -1882,6 +1882,10 @@ teckenkodning.
(super-jump-q . "Superhoppa vilket inlgg? ")
(conf-list-legend . "* Ej medlem; - Passiv medlem\n")
(unread-text-q . "Gr vilket inlgg olst? ")
(marking-text-unread . "Markerar inlgg %#1n olst...")
))
(lyskom-language-var local lyskom-month-names sv
......@@ -2087,6 +2091,7 @@ teckenkodning.
(kom-move-text-tree . "Flytta trd")
(kom-copy-options . "Kopiera instllningar")
(kom-mark-unread . "Olsmarkera inlgg")
))
(lyskom-language-var local lyskom-language-codes sv
......@@ -2308,6 +2313,7 @@ teckenkodning.
(defvar lyskom-sv-filter-get-prefix)
(defvar lyskom-sv-who-prefix)
(defvar lyskom-sv-A-prefix)
(defvar lyskom-sv-unread-prefix)
(if lyskom-sv-mode-map
nil
......@@ -2322,6 +2328,7 @@ teckenkodning.
(define-prefix-command 'lyskom-sv-filter-get-prefix)
(define-prefix-command 'lyskom-sv-who-prefix)
(define-prefix-command 'lyskom-sv-A-prefix)
(define-prefix-command 'lyskom-sv-unread-prefix)
(define-key lyskom-sv-mode-map (kbd "f") 'lyskom-sv-filter-get-prefix)
(define-key lyskom-sv-mode-map (kbd "n") 'lyskom-sv-next-prefix)
......@@ -2330,6 +2337,7 @@ teckenkodning.
(define-key lyskom-sv-mode-map (kbd "r") 'lyskom-sv-fast-reply-prefix)
(define-key lyskom-sv-mode-map (kbd "v") 'lyskom-sv-who-prefix)
(define-key lyskom-sv-mode-map (kbd "a") 'lyskom-sv-A-prefix)
(define-key lyskom-sv-mode-map (kbd "o") 'lyskom-sv-unread-prefix)
(lyskom-try-define-key lyskom-sv-mode-map (kbd "") 'lyskom-sv-change-prefix)
(lyskom-try-define-key lyskom-sv-mode-map (kbd "{") 'lyskom-sv-change-prefix)
......@@ -2475,6 +2483,19 @@ teckenkodning.
(define-key lyskom-sv-change-prefix (kbd "q") 'kom-change-conf-faq)
(define-key lyskom-sv-change-prefix (kbd "f") 'kom-filter-edit)
(define-key lyskom-sv-change-prefix (kbd "m") 'kom-change-auto-reply)
(define-key lyskom-sv-unread-prefix (kbd "SPC") 'kom-mark-unread)
(define-key lyskom-sv-unread-prefix (kbd "0") 'kom-initial-digit-unread)
(define-key lyskom-sv-unread-prefix (kbd "1") 'kom-initial-digit-unread)
(define-key lyskom-sv-unread-prefix (kbd "2") 'kom-initial-digit-unread)
(define-key lyskom-sv-unread-prefix (kbd "3") 'kom-initial-digit-unread)
(define-key lyskom-sv-unread-prefix (kbd "4") 'kom-initial-digit-unread)
(define-key lyskom-sv-unread-prefix (kbd "5") 'kom-initial-digit-unread)
(define-key lyskom-sv-unread-prefix (kbd "6") 'kom-initial-digit-unread)
(define-key lyskom-sv-unread-prefix (kbd "7") 'kom-initial-digit-unread)
(define-key lyskom-sv-unread-prefix (kbd "8") 'kom-initial-digit-unread)
(define-key lyskom-sv-unread-prefix (kbd "9") 'kom-initial-digit-unread)
(define-key lyskom-sv-review-prefix (kbd "SPC") 'kom-view)
(define-key lyskom-sv-review-prefix (kbd "0") 'kom-initial-digit-view)
(define-key lyskom-sv-review-prefix (kbd "1") 'kom-initial-digit-view)
......
......@@ -2932,6 +2932,7 @@ Users are encouraged to use their best sense of humor."
kom-recommend-conference
kom-redirect-comments
kom-copy-options
kom-mark-unread
))
;;; ================================================================
......@@ -3470,6 +3471,7 @@ This is currently not implemented.")
kom-add-private-answer
kom-add-request-confirm
kom-add-server-faq
kom-mark-unread
)
"Commands that prompt for a text number rather than assume a default."
inherited)
......
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