Commit c17249df authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Regexp matching searches among persons, conferences or both.

parent 9ee0c0d6
2002-09-07 Per Cederqvist <ceder@ceder.dyndns.org>
Regexp matching searches among persons, conferences or both.
* commands1.el (kom-list-re): New optional argument: what. This
function can now search among persons, conferences, or both.
* english-strings.el, swedish-strings.el (lyskom-message): Added
'include-persons, 'include-conferences, 'matching-regexp-perss and
'matching-regexp-confs.
2002-08-28 Hans Persson <hans@localhost.localdomain>
* swedish-strings.el (local): Spelling fix.
......
......@@ -1849,17 +1849,35 @@ If you are not member in the conference it will be flagged with an asterisk."
(apply 'concat (nreverse res))))
(def-kom-command kom-list-re (regexp &optional case-sensitive)
(def-kom-command kom-list-re (regexp &optional case-sensitive what)
"List all persons and conferences whose name matches REGEXP.
If the optional argument CASE-SENSITIVE is true, the regexp will not
be converted so that the search is case sensitive."
By default, the regexp will be converted so that the match is
performed in a case insensitive way. If the optional argument
CASE-SENSITIVE is true, that conversion will not be performed.
If the optional argument WHAT is 'person, only persons will be listed.
If it is 'conf, only conferences will be listed."
(interactive (list (lyskom-read-string
(lyskom-get-string 'search-re))
current-prefix-arg))
current-prefix-arg
(let ((pers (lyskom-j-or-n-p 'include-persons))
(conf (lyskom-j-or-n-p 'include-conferences)))
(cond
((and pers conf) nil)
(pers 'pers)
(conf 'conf)
(t (error "This user interface is stupid."))))))
(unless case-sensitive
(setq regexp (lyskom-make-re-case-insensitive regexp)))
(lyskom-format-insert 'matching-regexp regexp)
(let ((conf-list (blocking-do 're-z-lookup regexp 1 1)))
(lyskom-format-insert (cond
((eq what 'pers) 'matching-regexp-perss)
((eq what 'conf) 'matching-regexp-confs)
(t 'matching-regexp))
regexp)
(let ((conf-list (blocking-do 're-z-lookup regexp
(if (eq what 'conf) 0 1)
(if (eq what 'pers) 0 1))))
(if conf-list
(if (conf-z-info-list->conf-z-infos conf-list)
(lyskom-traverse czi (conf-z-info-list->conf-z-infos conf-list)
......@@ -1872,7 +1890,11 @@ be converted so that the search is case sensitive."
(conf-z-info->conf-type czi))
?P ?M)
))
(lyskom-format-insert 'no-matching-anys regexp))
(lyskom-format-insert (cond
((eq what 'pers) 'no-matching-perss)
((eq what 'conf) 'no-matching-confs)
(t 'no-matching-anys))
regexp))
(lyskom-format-insert (lyskom-current-error)))))
......
......@@ -379,6 +379,8 @@ and you have finished reading. Please come back later.
(search-for-pers . "Enter search key (RETURN for all users): ")
(search-for-conf . "Enter search key (RETURN for all conferences): ")
(search-re . "Enter search regexp: ")
(include-persons . "Search among persons? ")
(include-conferences . "Search among conferences? ")
(no-matching-confs . "No conferences match \"%#1s\".\n")
(no-matching-perss . "No persons match \"%#1s\".\n")
......@@ -550,6 +552,8 @@ Read all about it at http://www.lysator.liu.se/history/")
(no-recipients . "Unable to post text. No recipients were specified.")
(matching-regexp . "Conferences/users matching `%#1s'\n")
(matching-regexp-perss . "Users matching `%#1s'\n")
(matching-regexp-confs . "Conferences matching `%#1s'\n")
(who-is-active-all . "Showing all sessions.\n")
(who-is-active-last-minutes . "Showing all sessions active the last %#1d minutes.\n")
......
......@@ -349,6 +349,9 @@ du har l
(search-for-pers . "Ange skvillkor (RETURN fr alla personer): ")
(search-for-conf . "Ange skvillkor (RETURN fr alla mten): ")
(search-re . "Ange skuttryck (reguljrt uttryck): ")
(include-persons . "Sk bland personer? ")
(include-conferences . "Sk bland mten? ")
(no-matching-confs . "Inga mten uppfyller skvillkoret \"%#1s\".\n")
(no-matching-perss . "Inga personer uppfyller skvillkoret \"%#1s\".\n")
(no-matching-anys . "Inga personer eller mten uppfyller uttrycket \"%#1s\".\n")
......@@ -541,6 +544,8 @@ i svensk datorhistoria. L
(add-recipient-p . "Addera mottagare %#2?b%[ %#2M fr att n%]%[%] %#1P? ")
(matching-regexp . "Mten/personer som matchar '%#1s'\n")
(matching-regexp-perss . "Personer som matchar '%#1s'\n")
(matching-regexp-confs . "Mten som matchar '%#1s'\n")
(who-is-active-all . "Visar alla sessioner.\n")
(who-is-active-last-minutes . "Visar alla sessioner som har varit aktiva de senaste %#1d minuterna.\n")
......
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