Commit 2bebbbde authored by David Byers's avatar David Byers
Browse files

Some work on kom-handle-membership. Better support for message-flag and for...

Some work on kom-handle-membership. Better support for message-flag and for setting number of unread when joining a conference.

Detailed changes:
> 2003-07-28  David Byers  <byers@lysator.liu.se>
>
> 	Better support for message-flag and no-of unread when joining:
> 	* commands1.el (lyskom-go-to-conf): Ask for number of unread when
> 	joining.
> 	(kom-add-self): Ask for message-flag when de-passivating.
> 	(lyskom-add-member-answer): Ask for message-flag when adding self.
>
> 	* lyskom-rest.el (lyskom-check-go-to-conf): Ask for message-flag
> 	when de-passivating a membership.
>
> 	Some more work for kom-handle-membership:
> 	* mship-edit.el (lp--create-buffer): Made the header and footer
> 	adapt to the window width like the contents do.
> 	(lp--toggle-passive): New command. Also added binding.
>
> 	* check-strings.el (lcs-split-format-string): Reflect changes to
> 	lyskom-format-format here.
>
> 	* lyskom-rest.el (lyskom-list-unread-mapping): Removed unused
> 	variable.
> 	(lyskom-format-aux-help): Added format directie l.
> 	(lyskom-format-aux): Support arbitrary pad characters.
>
parent 7a9c872e
2003-07-28 David Byers <byers@lysator.liu.se>
Better support for message-flag and no-of unread when joining:
* commands1.el (lyskom-go-to-conf): Ask for number of unread when
joining.
(kom-add-self): Ask for message-flag when de-passivating.
(lyskom-add-member-answer): Ask for message-flag when adding self.
* lyskom-rest.el (lyskom-check-go-to-conf): Ask for message-flag
when de-passivating a membership.
Some more work for kom-handle-membership:
* mship-edit.el (lp--create-buffer): Made the header and footer
adapt to the window width like the contents do.
(lp--toggle-passive): New command. Also added binding.
* check-strings.el (lcs-split-format-string): Reflect changes to
lyskom-format-format here.
* lyskom-rest.el (lyskom-list-unread-mapping): Removed unused
variable.
(lyskom-format-aux-help): Added format directie l.
(lyskom-format-aux): Support arbitrary pad characters.
2003-07-27 David Byers <byers@lysator.liu.se>
Like bug 755 but for footnotes:
......
......@@ -211,9 +211,9 @@ STRING is the string."
(setq result (cons
(concat
(match-string 1 string)
(match-string 3 string)
(match-string 6 string)
(match-string 8 string))
(match-string 4 string)
(match-string 7 string)
(match-string 9 string))
result))))
result))
......
......@@ -559,6 +559,9 @@ See `kom-membership-default-priority' and
(cond ((and mship (membership-type->passive
(membership->type mship)))
(set-membership-type->passive (membership->type mship) nil)
(set-membership-type->message-flag (membership->type mship)
(lyskom-j-or-n-p
(lyskom-format 'set-message-flag-q whereto)))
(blocking-do 'set-membership-type
lyskom-pers-no
(conf-stat->conf-no whereto)
......@@ -598,7 +601,8 @@ See `kom-membership-default-priority' and
nil
no-of-unread)
whereto who
no-of-unread))))))
no-of-unread
))))))
(def-kom-command kom-change-priority (&optional conf)
......@@ -801,9 +805,17 @@ If optional USE-PRIORITY is non-nil then use that as the priority.
(t (lyskom-insert-error errno err-stat)))))
;;+++Borde {ndra i cachen i st{llet.
(when (and (eq (conf-stat->conf-no pers-conf-stat)
lyskom-pers-no)
(lyskom-j-or-n-p
(lyskom-format 'set-message-flag-q conf-conf-stat)))
(blocking-do 'set-membership-type
(conf-stat->conf-no pers-conf-stat)
(conf-stat->conf-no conf-conf-stat)
(lyskom-create-membership-type nil nil nil t
nil nil nil nil)))
(cache-del-pers-stat (conf-stat->conf-no pers-conf-stat))
;;+++Borde {ndra i cachen i st{llet.
(cache-del-conf-stat (conf-stat->conf-no conf-conf-stat))
(when (= (conf-stat->conf-no pers-conf-stat)
lyskom-pers-no)
......@@ -920,6 +932,7 @@ See `kom-unsubscribe-makes-passive'."
(unless have-message
(lyskom-format-insert 'unsubscribe-to conf))
(set-membership-type->passive (membership->type mship) t)
(set-membership-type->message-flag (membership->type mship) nil)
(setq reply (blocking-do 'set-membership-type
(conf-stat->conf-no pers)
(conf-stat->conf-no conf)
......@@ -1731,12 +1744,20 @@ If NO-PROMPT is non-nil, don't print message that we have gone to conf."
conf)
(lyskom-scroll)
(if (lyskom-j-or-n-p (lyskom-get-string 'want-become-member))
(if (lyskom-add-member-by-no (conf-stat->conf-no conf)
lyskom-pers-no)
(lyskom-do-go-to-conf conf
(lyskom-get-membership
(conf-stat->conf-no conf) t))
(lyskom-report-command-answer nil))
(let ((no-of-unread
(lyskom-read-num-range-or-date
0
(conf-stat->no-of-texts conf)
(lyskom-format 'initial-unread)
nil
t
nil)))
(if (lyskom-add-member-by-no (conf-stat->conf-no conf)
lyskom-pers-no no-of-unread)
(lyskom-do-go-to-conf conf
(lyskom-get-membership
(conf-stat->conf-no conf) t))
(lyskom-report-command-answer nil)))
(lyskom-insert-string 'no-ok))))))
;; DEBUG+++
......
......@@ -1932,6 +1932,7 @@ environment to one that uses \"%#2s\" to encode text.
(text-has-no-comments . "Text %#1n has no comments\n")
(text-has-no-footnotes . "Text %#1n has no footnotes\n")
(set-message-flag-q . "Accept group messages to %#1M? ")
))
......
......@@ -718,6 +718,10 @@ If CONF is nil, check the first conf on the to-do list."
(if (lyskom-j-or-n-p (lyskom-format 'convert-passive conf-stat))
(progn
(set-membership-type->passive type nil)
(set-membership-type->message-flag
type
(lyskom-j-or-n-p (lyskom-format 'set-message-flag-q
conf-stat)))
(blocking-do 'set-membership-type
lyskom-pers-no
(conf-stat->conf-no conf-stat)
......@@ -1247,7 +1251,7 @@ Args: FORMAT-STRING &rest ARGS"
(defvar lyskom-format-format
"%\\(=\\)?\\(-?[0-9]+\\)?\\(#\\([0-9]+\\)\\)?\\(_\\)?\\(:\\)?\\(&\\)?\\([][$@MmPpnrtsdoxcCSDF%?]\\)"
"%\\(=\\)?\\(-?[0-9]+\\)?\\(:.\\)?\\(#\\([0-9]+\\)\\)?\\(_\\)?\\(:\\)?\\(&\\)?\\([][$@MmPpnrtsdoxlcCSDF%?]\\)"
"regexp matching format string parts.")
(defun lyskom-insert-string (atom)
......@@ -1390,6 +1394,7 @@ Deferred insertions are not supported."
(let ((format-length (length (format-state->format-string format-state)))
(arg-no nil)
(pad-length nil)
(pad-string nil)
(format-letter nil)
(colon-flag nil)
(equals-flag nil)
......@@ -1439,25 +1444,26 @@ Deferred insertions are not supported."
(setq equals-flag (match-beginning 1)
pad-length (if (match-beginning 2)
(string-to-int (substring
(format-state->format-string
format-state)
(match-beginning 2)
(match-end 2)))
(string-to-int (match-string
2 (format-state->format-string
format-state)))
nil)
arg-no (if (match-beginning 4)
(string-to-int (substring (format-state->format-string
format-state)
(match-beginning 4)
(match-end 4)))
arg-no (if (match-beginning 5)
(string-to-int (match-string
5 (format-state->format-string
format-state)))
nil)
downcase-flag (match-beginning 5)
colon-flag (match-beginning 6)
face-flag (match-beginning 7)
format-letter (if (match-beginning 8)
downcase-flag (match-beginning 6)
colon-flag (match-beginning 7)
face-flag (match-beginning 8)
pad-string (and (match-beginning 3)
(substring (format-state->format-string format-state)
(1+ (match-beginning 3))
(match-end 3)))
format-letter (if (match-beginning 9)
(aref (format-state->format-string
format-state)
(match-beginning 8))
(match-beginning 9))
(signal 'lyskom-internal-error
(list 'lyskom-format-aux
(format-state->format-string
......@@ -1484,12 +1490,13 @@ Deferred insertions are not supported."
colon-flag
face-flag
downcase-flag
(if (and (match-beginning 2)
(eq (aref (format-state->format-string format-state)
(match-beginning 2))
?0))
?0
?\ )
(or (elt pad-string 0)
(if (and (match-beginning 2)
(eq (aref (format-state->format-string format-state)
(match-beginning 2))
?0))
?0
?\ ))
allow-defer))))))
(lyskom-tweak-format-state format-state)
(set-format-state->depth format-state
......@@ -1528,6 +1535,23 @@ Deferred insertions are not supported."
;; Format a string or symbol by simply inserting it into the
;; result list
;;
((= format-letter ?l)
(setq result
(cond ((or (integerp arg)
(characterp arg))
(make-string pad-length arg))
((stringp arg)
(let ((count (/ pad-length (length arg))))
(apply 'concat
(nreverse
(cons (substring
arg 0
(- pad-length (* (length arg) count)))
(make-list count arg))))))
(t (signal 'lyskom-internal-error
(list 'lyskom-format
": argument error (expected char or string)"))))))
((= format-letter ?s)
(setq result (cond ((stringp arg) arg)
((symbolp arg) (symbol-name arg))
......@@ -3314,8 +3338,7 @@ The list consists of text-nos."
"Args: MAP MEMBERSHIP. Return a list of unread texts.
The list consists of text-nos."
(let ((read (membership->read-texts membership))
(first (text-mapping->range-begin map))
(iter (text-mapping->iterator map))
(iter (text-mapping->iterator map))
(el nil))
(when (not (null read))
(while (setq el (text-mapping-iterator->next iter))
......
......@@ -109,6 +109,7 @@ access this variable directly.")
(defvar lp--list-end-marker nil)
(defvar lp--selected-entry-list nil)
(defvar lp--buffer-done nil)
(defvar lp--conf-name-width nil)
;;; ============================================================
......@@ -272,6 +273,7 @@ only recomputed if the window width changes."
lp--last-format-string
(let ((total (- (window-width) 1 3 3 2 12 2 5 2 4 1)))
(setq lp--last-window-width (window-width))
(setq lp--conf-name-width total)
(setq lp--last-format-string
(concat "%#1c %=3#2s %#10c %=-" (number-to-string total)
"#3M %=-12#4s %[%#15@%=5#5s%] %[%#11@%#6c%]%[%#12@%#7c%]%[%#13@%#8c%]%[%#14@%#9c%]")))))
......@@ -842,6 +844,16 @@ clicked on."
(list cur 'passive)
""))))))
(defun lp--toggle-message-flag ()
"Toggle the passive bit of the current entry"
(interactive)
(lp--save-excursion
(let ((cur (lp--entry-at (point))))
(cond ((null cur) (error "No entry at point"))
(t (lyskom-prioritize-flag-toggle (current-buffer)
(list cur 'message-flag)
""))))))
(defun lp--toggle-secret ()
"Toggle the secret bit of the current entry"
(interactive)
......@@ -1411,6 +1423,7 @@ With prefix arg, contract only those that were created by self."
(define-key lp--mode-map (kbd "I") 'lp--toggle-invitation)
(define-key lp--mode-map (kbd "H") 'lp--toggle-secret)
(define-key lp--mode-map (kbd "P") 'lp--toggle-passive)
(define-key lp--mode-map (kbd "M") 'lp--toggle-message-flag)
(define-key lp--mode-map (kbd "C-c C-c") 'lp--quit)
(define-key lp--mode-map (kbd "q") 'lp--quit)
......@@ -1521,13 +1534,20 @@ Entry to this mode runs lyskom-prioritize-mode-hook."
(make-local-variable 'lp--buffer-done)
(setq lp--entry-list nil)
(setq lp--buffer-done nil)
(lyskom-format-insert "\
Medlemskap för %#1M på %#2s
(lp--compute-format-string)
(lyskom-format-insert "Medlemskap för %#1M på %#2s\n" lyskom-pers-no lyskom-server-name)
(lyskom-insert (make-string (1- (window-width)) ?=))
(lyskom-insert "\n")
(lyskom-format-insert " Prio %#1s Senast inne Oläst IHPM\n"
(concat (lyskom-get-string 'conference)
(make-string (- lp--conf-name-width
(length (lyskom-get-string 'conference)))
?\ )))
(lyskom-insert (make-string (1- (window-width)) ?-))
(lyskom-insert "\n")
===============================================================================
Prio Möte Senast inne Oläst IHP
-------------------------------------------------------------------------------
" lyskom-pers-no lyskom-server-name)
(setq lp--list-start-marker (point-marker))
(goto-char (point-max))
(lyskom-sort-membership)
......@@ -1548,11 +1568,11 @@ Medlemskap f
(setq entry-list (cons entry entry-list))))
(lp--set-entry-list (nreverse entry-list))
(setq lp--list-end-marker (point-marker))
(insert "\
===============================================================================
(lyskom-insert (make-string (1- (window-width)) ?=))
(lyskom-insert "
Markera medlemskap: SPC Markera område: C-w Flytta markerade: C-y
Sätt prioritet: p Öka prioritet: + Minska prioritet: -
Flytta upp: M-p Flytta ned: M-n Ändra flaggor: I,H,P
Flytta upp: M-p Flytta ned: M-n Ändra flaggor: I,H,P,M
Avsluta: C-c C-c Mer hjälp: C-h m
")
))
......
......@@ -1966,6 +1966,7 @@ teckenkodning.
(text-has-no-comments . "Inlgg %#1n har inga kommentarer\n")
(text-has-no-footnotes . "Inlgg %#1n har inga fotnoter\n")
(set-message-flag-q . "Ta emot gruppmeddelanden till %#1M? ")
))
(lyskom-language-var local lyskom-month-names sv
......
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