Commit 59eca83c authored by David Kågedal's avatar David Kågedal
Browse files

Återställde Lista (med) regexpar

parent 6b8d0e51
Sat May 4 00:07:06 1996 David Kgedal <davidk@lysator.liu.se> Sat May 4 00:07:06 1996 David Kgedal <davidk@lysator.liu.se>
* Jag plockade koden fr "Lista (med) regexpar" frn 0.38.2.
* parse.el (lyskom-parse-conf-z-info-list): Ny funktion.
(lyskom-parse-conf-z-info): Dito.
* komtypes.el: La till funktioner fr conf-z-info-list och
conf-z-info.
* services.el (initiate-re-z-lookup): Ny funktion.
* swedish-strings.el (lyskom-commands): La till "Lista (med)
regexpar".
(lyskom-mode-map): La in kommandot p "lr".
* english-strings.el: Dito.
* lyskom-rest.el (lyskom-format-aux-help): Inga knappar p mte * lyskom-rest.el (lyskom-format-aux-help): Inga knappar p mte
0. 0.
......
...@@ -38,7 +38,7 @@ Buggar ...@@ -38,7 +38,7 @@ Buggar
Allmänna förbättringar Allmänna förbättringar
Återinför "Lista (med) regexpar", eller vad den nu hette. Återinför "Lista (med) regexpar", eller vad den nu hette. (FIXAT)
Inläggsnumren borde vara mer kontextkänsliga. Om man klickar på Inläggsnumren borde vara mer kontextkänsliga. Om man klickar på
ett inläggs eget nummer, alltså det som står precis innan datumet ett inläggs eget nummer, alltså det som står precis innan datumet
......
...@@ -1183,6 +1183,26 @@ If you are not member in the conference it will be flagged with an asterisk." ...@@ -1183,6 +1183,26 @@ If you are not member in the conference it will be flagged with an asterisk."
32 ?*) 32 ?*)
conf-no)) conf-no))
;;; ================================================================
;;; Lista med regexpar - List regexp
(def-kom-command kom-list-re (regexp)
"List all persons and conferences whose name matches REGEXP."
(interactive "sSearch regexp: ")
(lyskom-format-insert 'matching-regexp regexp)
(let ((conf-list (blocking-do 're-z-lookup regexp 1 1)))
(mapcar
(function (lambda (czi)
(lyskom-insert
(concat
(format "%4d %c %s\n"
(conf-z-info->conf-no czi)
(if (conf-type->letterbox
(conf-z-info->conf-type czi))
?P ?M)
(conf-z-info->name czi))))))
(conf-z-info-list->conf-z-infos conf-list))))
;;; ================================================================ ;;; ================================================================
;;; [ndra namn - Change name ;;; [ndra namn - Change name
......
...@@ -358,6 +358,7 @@ and you have finished reading. Please come back later. ...@@ -358,6 +358,7 @@ and you have finished reading. Please come back later.
(add-comment-to . "Adding article %#1n as a comment to text %#2n...") (add-comment-to . "Adding article %#1n as a comment to text %#2n...")
(sub-comment-to . "Removing article %#1n as a comment to article %#2n...") (sub-comment-to . "Removing article %#1n as a comment to article %#2n...")
(comment-keep-recpt-p ."Should %#1s remain a recipient? ") (comment-keep-recpt-p ."Should %#1s remain a recipient? ")
(matching-regexp . "Conferences/users matching `%#1s'\n")
; From commands2.el: ; From commands2.el:
...@@ -904,6 +905,7 @@ Text: ...@@ -904,6 +905,7 @@ Text:
(kom-list-conferences "List conferences") (kom-list-conferences "List conferences")
(kom-list-persons "List users") (kom-list-persons "List users")
(kom-list-news "List news") (kom-list-news "List news")
(kom-list-re "List (using) regexps")
(kom-membership "List memberships") (kom-membership "List memberships")
;; (kom-list-marks "List marks") ;; (kom-list-marks "List marks")
(kom-postpone "Postpone reading") (kom-postpone "Postpone reading")
...@@ -1098,6 +1100,7 @@ Cf. paragraph-start.") ...@@ -1098,6 +1100,7 @@ Cf. paragraph-start.")
(define-key lyskom-mode-map "lc" 'kom-list-conferences) (define-key lyskom-mode-map "lc" 'kom-list-conferences)
(define-key lyskom-mode-map "ln" 'kom-list-news) (define-key lyskom-mode-map "ln" 'kom-list-news)
(define-key lyskom-mode-map "lu" 'kom-list-persons) (define-key lyskom-mode-map "lu" 'kom-list-persons)
(define-key lyskom-mode-map "lr" 'kom-list-re)
(define-key lyskom-mode-map "ls" 'kom-membership) (define-key lyskom-mode-map "ls" 'kom-membership)
(define-key lyskom-mode-map "la" 'kom-list-summary) (define-key lyskom-mode-map "la" 'kom-list-summary)
(define-key lyskom-mode-map "lf" 'kom-list-filters) (define-key lyskom-mode-map "lf" 'kom-list-filters)
......
...@@ -1611,6 +1611,90 @@ The MAPS must be consecutive. No gaps or overlaps are currently allowed." ...@@ -1611,6 +1611,90 @@ The MAPS must be consecutive. No gaps or overlaps are currently allowed."
(eq (car-safe object) 'SERVER-INFO)) (eq (car-safe object) 'SERVER-INFO))
;;; ================================================================
;;; conf-z-info-list
;;; Constructor:
(defun lyskom-create-conf-z-info-list (conf-z-infos)
"Create a conf-z-info-list from all parameters."
(cons
'CONF-Z-INFO-LIST
(vector conf-z-infos)))
;;; Selector:
(defun conf-z-info-list->conf-z-infos (conf-z-info-list)
"Get conf-z-infos from conf-z-info-list."
(elt (cdr conf-z-info-list) 0))
;;; Modifier:
(defun set-conf-z-info-list->conf-z-infos (conf-z-info-list newval)
"Set conf-z-infos in conf-z-info-list to NEWVAL."
(aset (cdr conf-z-info-list) 0 newval))
;;; Predicate:
(defun lyskom-conf-z-info-list-p (object)
"Return t if OBJECT is a conf-z-info-list."
(eq (car-safe object) 'CONF-Z-INFO-LIST))
;;; ================================================================
;;; conf-z-info
;;; Constructor:
(defun lyskom-create-conf-z-info (name
conf-type
conf-no)
"Create a conf-z-info from all parameters."
(cons
'CONF-Z-INFO
(vector name conf-type conf-no)))
;;; Selectors:
(defun conf-z-info->name (conf-z-info)
"Get name from conf-z-info."
(elt (cdr conf-z-info) 0))
(defun conf-z-info->conf-type (conf-z-info)
"Get conf-type from conf-z-info."
(elt (cdr conf-z-info) 1))
(defun conf-z-info->conf-no (conf-z-info)
"Get conf-no from conf-z-info."
(elt (cdr conf-z-info) 2))
;;; Modifiers:
(defun set-conf-z-info->name (conf-z-info newval)
"Set name in conf-z-info to NEWVAL."
(aset (cdr conf-z-info) 0 newval))
(defun set-conf-z-info->conf-type (conf-z-info newval)
"Set conf-type in conf-z-info to NEWVAL."
(aset (cdr conf-z-info) 1 newval))
(defun set-conf-z-info->conf-no (conf-z-info newval)
"Set conf-no in conf-z-info to NEWVAL."
(aset (cdr conf-z-info) 2 newval))
;;; Predicate:
(defun lyskom-conf-z-info-p (object)
"Return t if OBJECT is a conf-z-info."
(eq (car-safe object) 'CONF-Z-INFO))
;;;; ================================================================ ;;;; ================================================================
;;;; This field is just simulation of a field in the conf-stat ;;;; This field is just simulation of a field in the conf-stat
;;;; that not yet exist. ;;;; that not yet exist.
......
...@@ -669,6 +669,21 @@ Args: TEXT-NO. Value: text-stat." ...@@ -669,6 +669,21 @@ Args: TEXT-NO. Value: text-stat."
text)) text))
(defun lyskom-parse-conf-z-info-list ()
"Parse result from functions that return a conf-z-info-list."
(let* ((list-len (lyskom-parse-num)))
(lyskom-create-conf-z-info-list
(lyskom-parse-vector list-len 'lyskom-parse-conf-z-info))))
(defun lyskom-parse-conf-z-info ()
"Parse a conf-z-info."
(lyskom-create-conf-z-info
(lyskom-parse-string) ;name
(lyskom-parse-conf-type) ;conf-type
(lyskom-parse-num))) ;conf-no
;;; ================================================================ ;;; ================================================================
;;; Parsing of complex datatypes without cache. ;;; Parsing of complex datatypes without cache.
......
...@@ -670,6 +670,14 @@ Args: KOM-QUEUE HANDLER CONF-NO TEXT-NO &rest DATA" ...@@ -670,6 +670,14 @@ Args: KOM-QUEUE HANDLER CONF-NO TEXT-NO &rest DATA"
(lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-string) (lyskom-call kom-queue lyskom-ref-no handler data 'lyskom-parse-string)
(lyskom-send-packet kom-queue (lyskom-format-objects 71 session))) (lyskom-send-packet kom-queue (lyskom-format-objects 71 session)))
(defun initiate-re-z-lookup (kom-queue handler regexp want-persons want-confs
&rest data)
"Perform a regexp lookup.
Args: KOM-QUEUE HANDLER REGEXP WANT-PERSONS WANT-CONFS &rest DATA."
(lyskom-call kom-queue lyskom-ref-no handler data
'lyskom-parse-conf-z-info-list)
(lyskom-send-packet kom-queue (lyskom-format-objects 74 regexp want-persons
want-confs)))
(defun initiate-set-last-read (kom-queue handler conf-no text-no &rest data) (defun initiate-set-last-read (kom-queue handler conf-no text-no &rest data)
"Tell the server to set the highest unread article in conference CONF-NO "Tell the server to set the highest unread article in conference CONF-NO
......
...@@ -361,6 +361,7 @@ du har l\344st klart allting. Kom tillbaks senare. ...@@ -361,6 +361,7 @@ du har l\344st klart allting. Kom tillbaks senare.
(add-comment-to . "Adderar text %#1n som kommentar till text %#2n...") (add-comment-to . "Adderar text %#1n som kommentar till text %#2n...")
(sub-comment-to . "Subtraherar text %#1n som kommentar till text %#2n...") (sub-comment-to . "Subtraherar text %#1n som kommentar till text %#2n...")
(comment-keep-recpt-p ."Ska %#1s vara mottagare? ") (comment-keep-recpt-p ."Ska %#1s vara mottagare? ")
(matching-regexp . "M\366ten/personer som matchar '%#1s'\n")
; From commands2.el: ; From commands2.el:
...@@ -928,6 +929,7 @@ Text: ...@@ -928,6 +929,7 @@ Text:
(kom-list-conferences "Lista m\366ten") (kom-list-conferences "Lista m\366ten")
(kom-list-persons "Lista personer") (kom-list-persons "Lista personer")
(kom-list-news "Lista nyheter") (kom-list-news "Lista nyheter")
(kom-list-re "Lista (med) regexpar")
(kom-membership "Lista medlemsskap") (kom-membership "Lista medlemsskap")
;; (kom-list-marks "Lista markeringar") ;; (kom-list-marks "Lista markeringar")
(kom-postpone "Uppskjuta l\344sning") (kom-postpone "Uppskjuta l\344sning")
...@@ -1150,6 +1152,7 @@ Cf. paragraph-start.") ...@@ -1150,6 +1152,7 @@ Cf. paragraph-start.")
(define-key lyskom-mode-map "lm" 'kom-list-conferences) (define-key lyskom-mode-map "lm" 'kom-list-conferences)
(define-key lyskom-mode-map "ln" 'kom-list-news) (define-key lyskom-mode-map "ln" 'kom-list-news)
(define-key lyskom-mode-map "lp" 'kom-list-persons) (define-key lyskom-mode-map "lp" 'kom-list-persons)
(define-key lyskom-mode-map "lr" 'kom-list-re)
(define-key lyskom-mode-map "ls" 'kom-membership) (define-key lyskom-mode-map "ls" 'kom-membership)
(define-key lyskom-mode-map "l{" 'kom-list-summary) (define-key lyskom-mode-map "l{" 'kom-list-summary)
(define-key lyskom-mode-map "l[" 'kom-list-summary) (define-key lyskom-mode-map "l[" 'kom-list-summary)
......
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