Commit 00ac77f8 authored by David Byers's avatar David Byers
Browse files

Handle new asyncs. Clear initial value when typing a conference name.

Detailed changes:
> 2003-08-13  David Byers  <byers@lysator.liu.se>
>
> 	Delete initial value on change:
> 	* completing-read.el (lyskom-read-from-minibuffer-clear-initial):
> 	New function.
> 	(lyskom-read-conf): Put it into before-change-functions in
> 	minibuffer-setup-hook.
>
> 2003-08-12  David Byers  <byers@lysator.liu.se>
>
> 	* async.el (lyskom-parse-async): Handle async 20.
> 	(lyskom-parse-async): Handle async 21.
>
parent 8e988907
2003-08-13 David Byers <byers@lysator.liu.se>
Delete initial value on change:
* completing-read.el (lyskom-read-from-minibuffer-clear-initial):
New function.
(lyskom-read-conf): Put it into before-change-functions in
minibuffer-setup-hook.
2003-08-12 David Byers <byers@lysator.liu.se>
* async.el (lyskom-parse-async): Handle async 20.
(lyskom-parse-async): Handle async 21.
2003-08-05 Per Cederqvist <ceder@ceder.dyndns.org> 2003-08-05 Per Cederqvist <ceder@ceder.dyndns.org>
* completing-read.el (lyskom-read-conf): Typographic doc fix. * completing-read.el (lyskom-read-conf): Typographic doc fix.
......
...@@ -282,6 +282,26 @@ this function shall be with current-buffer the BUFFER." ...@@ -282,6 +282,26 @@ this function shall be with current-buffer the BUFFER."
pers-no pers-no
old-user-area old-user-area
new-user-area))))) new-user-area)))))
((eq msg-no 20) ; async-new-presentation
(let* ((conf-no (lyskom-parse-num))
(old-pres (lyskom-parse-num))
(new-pres (lyskom-parse-num)))
(lyskom-ignore old-pres)
(when (cache-get-conf-stat conf-no)
(set-conf-stat->presentation (cache-get-conf-stat conf-no)
new-pres)
(lp--maybe-update-entry-for-conf conf-no))))
((eq msg-no 21) ; async-new-motd
(let* ((conf-no (lyskom-parse-num))
(old-motd (lyskom-parse-num))
(new-motd (lyskom-parse-num)))
(lyskom-ignore old-motd)
(when (cache-get-conf-stat conf-no)
(set-conf-stat->msg-of-day (cache-get-conf-stat conf-no)
new-motd))))
(t (t
(lyskom-skip-tokens tokens))))) (lyskom-skip-tokens tokens)))))
......
...@@ -115,6 +115,23 @@ but first checks a cache." ...@@ -115,6 +115,23 @@ but first checks a cache."
map) map)
"Keymap used for reading LysKOM names.") "Keymap used for reading LysKOM names.")
(defun lyskom-read-from-minibuffer-clear-initial (&rest args)
(condition-case nil
(let ((ranges nil)
(tmp nil)
(start (point-min)))
(while (setq tmp (lyskom-next-property-bounds
start (point-max) 'lyskom-initial-mbc))
(setq ranges (cons tmp ranges)
start (cdr tmp)))
(lyskom-traverse range ranges
(delete-region (car range) (cdr range)))
(when ranges
(setq before-change-functions
(delq 'lyskom-read-from-minibuffer-clear-initial
before-change-functions))))
(error nil)))
(defsubst lyskom-completing-match-string-regexp (string) (defsubst lyskom-completing-match-string-regexp (string)
(concat "^" (concat "^"
(replace-in-string (regexp-quote (lyskom-unicase (lyskom-completing-strip-name string))) (replace-in-string (regexp-quote (lyskom-unicase (lyskom-completing-strip-name string)))
...@@ -243,6 +260,16 @@ A string: A name that matched nothing in the database." ...@@ -243,6 +260,16 @@ A string: A name that matched nothing in the database."
(blocking-do 'get-uconf-stat lyskom-current-conf))) (blocking-do 'get-uconf-stat lyskom-current-conf)))
(t nil))) (t nil)))
(cond ((stringp initial)
(setq initial (copy-sequence initial))
(add-text-properties 0 (length initial)
'(lyskom-initial-mbc t) initial))
(initial
(setq initial (cons (copy-sequence (car initial)) (cdr initial)))
(add-text-properties 0 (length (car initial))
'(lyskom-initial-mbc t) (car initial))))
(let* ((completion-ignore-case t) (let* ((completion-ignore-case t)
(minibuffer-local-completion-map (minibuffer-local-completion-map
lyskom-minibuffer-local-completion-map) lyskom-minibuffer-local-completion-map)
...@@ -254,16 +281,23 @@ A string: A name that matched nothing in the database." ...@@ -254,16 +281,23 @@ A string: A name that matched nothing in the database."
(while keep-going (while keep-going
(lyskom-with-lyskom-minibuffer (lyskom-with-lyskom-minibuffer
(setq read-string (completing-read (cond ((stringp prompt) prompt) (let ((before-change-functions before-change-functions)
((symbolp prompt) (lyskom-get-string prompt)) (minibuffer-setup-hook
(t (lyskom-get-string 'conf-prompt))) (cons (lambda ()
'lyskom-read-conf-internal (setq before-change-functions
type (cons 'lyskom-read-from-minibuffer-clear-initial
mustmatch before-change-functions)))
(if (listp initial) minibuffer-setup-hook)))
initial (setq read-string (completing-read (cond ((stringp prompt) prompt)
(cons initial 0)) ((symbolp prompt) (lyskom-get-string prompt))
'lyskom-name-hist))) (t (lyskom-get-string 'conf-prompt)))
'lyskom-read-conf-internal
type
mustmatch
(if (listp initial)
initial
(cons initial 0))
'lyskom-name-hist))))
(setq result (setq result
(cond ((null read-string) nil) (cond ((null read-string) nil)
((string= "" read-string) nil) ((string= "" read-string) nil)
......
...@@ -2382,7 +2382,7 @@ written a presentation.%] ...@@ -2382,7 +2382,7 @@ written a presentation.%]
(recipient-no . "Recipient (number)") (recipient-no . "Recipient (number)")
(recipient-re . "Recipient (regexp)") (recipient-re . "Recipient (regexp)")
(text . "Contents") (text . "Contents")
(text . "Contents (regexp)"))) (text-re . "Contents (regexp)")))
(lyskom-language-var local lyskom-filter-actions en (lyskom-language-var local lyskom-filter-actions en
'((skip-text . "Skip") '((skip-text . "Skip")
......
...@@ -201,11 +201,11 @@ Automatically created with def-komtype" type) ...@@ -201,11 +201,11 @@ Automatically created with def-komtype" type)
(creation-time :read-only t) (creation-time :read-only t)
(last-written :read-only t) (last-written :read-only t)
(creator :read-only t) (creator :read-only t)
(presentation :read-only t) (presentation)
(supervisor :read-only t) (supervisor :read-only t)
(permitted-submitters :read-only t) (permitted-submitters :read-only t)
(super-conf :read-only t) (super-conf :read-only t)
(msg-of-day :read-only t) (msg-of-day)
(garb-nice :read-only t) (garb-nice :read-only t)
(keep-commented :read-only t) (keep-commented :read-only t)
(no-of-members :read-only t) (no-of-members :read-only t)
......
...@@ -2412,7 +2412,7 @@ att upprepas d ...@@ -2412,7 +2412,7 @@ att upprepas d
(recipient-no . "Mottagare (nummer)") (recipient-no . "Mottagare (nummer)")
(recipient-re . "Mottagare (regexp)") (recipient-re . "Mottagare (regexp)")
(text . "Innehll") (text . "Innehll")
(text . "Innehll (regexp)"))) (text-re . "Innehll (regexp)")))
(lyskom-language-var local lyskom-filter-actions sv (lyskom-language-var local lyskom-filter-actions sv
'((skip-text . "Hoppa ver") '((skip-text . "Hoppa ver")
......
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