Commit 9480dda2 authored by Ulrik Haugen's avatar Ulrik Haugen

replaced member with memq in lots of places, added constants

lyskom-comment-types-list, lyskom-recpt-types-list and
lyskom-review-types-list.
parent b961e415
2001-01-02 Ulrik Haugen <qha@lysator.liu.se>
* All files changed when I replaced
(or (eq foo 'a) (eq foo 'b) ...) with (member foo '(a b ...)):
Replaced member with memq which compares with `eq', and
substituted lyskom-comment-types-list & c. where apropriate.
* vars.el.in (lyskom-comment-types-list): Added constant.
(lyskom-recpt-types-list): Ditto.
(lyskom-review-types-list): Ditto.
2000-12-31 Ulrik Haugen <qha@lysator.liu.se>
* view-text.el (lyskom-view-text): Replaced
......
......@@ -667,7 +667,7 @@ converted, before insertion."
misc-info (text-stat->misc-info-list text-stat)
(let ((type (misc-info->type misc-info)))
(cond
((member type '(RECPT CC-RECPT BCC-RECPT))
((memq type lyskom-recpt-types-list)
;; add on lyskom-reading-list and lyskom-to-do-list if
;; this recipient is a recipient that has been checked.
(if (and (eq (misc-info->recipient-no misc-info)
......@@ -703,7 +703,7 @@ converted, before insertion."
(lyskom-traverse
misc-info (text-stat->misc-info-list text-stat)
(let ((type (misc-info->type misc-info)))
(cond ((member type '(RECPT CC-RECPT BCC-RECPT))
(cond ((memq type lyskom-recpt-types-list)
(initiate-get-conf-stat 'async 'lyskom-delete-old-text
(misc-info->recipient-no misc-info)
text-stat
......
......@@ -19,7 +19,7 @@
(cond ((and (eq c ?') (not dquot)) (setq squot (not squot)))
((and (eq c ?\") (not squot)) (setq dquot (not dquot)))
((eq c ?\\) (setq start (1+ start)))
((and (member c '(?\ ?\t ?\r ?\n))
((and (memq c '(?\ ?\t ?\r ?\n))
(not squot)
(not dquot))
(setq end i))
......
......@@ -499,7 +499,7 @@ Returns the window displaying BUFFER."
;; OTHER, OTHER-WINDOW -- Switch to in another window
;;
((member open '(other other-window))
((memq open '(other other-window))
(switch-to-buffer-other-window buffer)
(setq dedicated-window (selected-window))
(setq window (selected-window)))
......
......@@ -254,7 +254,7 @@ TEXT-NO may be nil, in which case only empty read-infos on RLIST are removed."
(cond
((let ((type (read-info->type (car curr))))
; Don't change REVIEW et c.
(member type '(REVIEW REVIEW-TREE REVIEW-MARK))))
(memq type lyskom-review-types-list)))
(t ; Do change all other entries.
(let ((tl (read-info->text-list (car curr))))
(text-list->delq tl text-no)))))
......
......@@ -1209,7 +1209,7 @@ Don't ask for confirmation."
(let* ((info (car misc-list))
(type (misc-info->type info)))
(cond ((null misc-list) '())
((member type '(RECPT CC-RECPT BCC-RECPT))
((memq type lyskom-recpt-types-list)
(append (list (intern (downcase (symbol-name type)))
(misc-info->recipient-no info))
(lyskom-get-recipients-from-misc-list
......@@ -1599,7 +1599,7 @@ Those that you are not a member in will be marked with an asterisk."
(lyskom-message (lyskom-format (if arg 'finding-created-pers-confs 'finding-created-confs)
(elt counter 1)
(elt counter 2)))
(when (and cs (member pers-no (list (conf-stat->creator cs)
(when (and cs (memq pers-no (list (conf-stat->creator cs)
(conf-stat->supervisor cs)
(conf-stat->super-conf cs))))
(aset counter 3 (1+ (elt counter 3)))
......@@ -3173,7 +3173,7 @@ footnotes) to it as read in the server."
misc
(text-stat->misc-info-list text-stat)
(cond
((and (member (misc-info->type misc) '(COMM-IN FOOTN-IN))
((and (memq (misc-info->type misc) lyskom-comment-types-list)
(> (if (eq (misc-info->type misc)
'COMM-IN)
(misc-info->comm-in misc)
......
......@@ -937,7 +937,7 @@ on one line."
(let ((type (read-info->type
(read-list->nth lyskom-reading-list
r))))
(if (member type '(CONF REVIEW-MARK REVIEW))
(if (memq type '(CONF REVIEW-MARK REVIEW))
(setq len 0)
(++ r))))
(read-list->nth lyskom-reading-list r)))))))
......@@ -1517,9 +1517,9 @@ current conference to another session."
(> len 0))
(let ((type (read-info->type (read-list->first lyskom-reading-list))))
(cond
((member type '(REVIEW REVIEW-TREE REVIEW-MARK))
((memq type lyskom-review-types-list)
(read-list-rotate lyskom-reading-list))
((member type '(COMM-IN FOOTN-IN))
((memq type lyskom-comment-types-list)
(set-read-list-del-first lyskom-reading-list))
((eq type 'CONF)
(let* ((rlist (read-info->text-list
......@@ -2020,7 +2020,7 @@ Return-value: 'no-session if there is no suitable session to switch to
0 label)))
(cache-del-text-stat objno))
((member type '(conf pers))
((memq type '(conf pers))
(setq object
(lyskom-read-conf-stat (lyskom-get-string
(if (eq type 'pers)
......
......@@ -631,7 +631,7 @@ the LysKOM rules of string matching."
((eq (aref next-char-state 0) 'match)
(if (eq (aref next-char-state 1) ?\ )
(progn
(cond ((member (symbol-value current-state)
(cond ((memq (symbol-value current-state)
'(start-of-word start-of-string))
nil)
((eq last-event-worth-noting 'mismatch)
......@@ -698,7 +698,7 @@ the LysKOM rules of string matching."
;;
((and (> paren-depth 0)
(member (aref next-char-state 0)
(memq (aref next-char-state 0)
'(mismatch space-mismatch open-paren-mismatch)))
(setq last-event-worth-noting 'mismatch)
(setq tmp-accumulator nil)
......@@ -714,7 +714,7 @@ the LysKOM rules of string matching."
;;
((and (eq (aref next-char-state 0) 'space-mismatch)
(member (symbol-value current-state)
(memq (symbol-value current-state)
'(start-of-string start-of-word)))
(setq last-event-worth-noting nil)
(lyskom-complete-string-skip-whitespace data-list))
......@@ -724,10 +724,10 @@ the LysKOM rules of string matching."
;; Advance to the end of the current word
;;
((and (member (aref next-char-state 0) '(mismatch space-mismatch))
((and (memq (aref next-char-state 0) '(mismatch space-mismatch))
(zerop paren-depth))
(setq last-event-worth-noting 'mismatch)
(if (member (symbol-value current-state)
(if (memq (symbol-value current-state)
'(start-of-word start-of-string))
(setq done t)
(progn
......
......@@ -796,7 +796,7 @@ Cannot be called from a callback."
(cond ((eq (car misc) 'comm-to)
(setq comm-to-list (cons (cdr misc)
comm-to-list)))
((member (car misc) '(recpt cc-recpt bcc-recpt))
((memq (car misc) '(recpt cc-recpt bcc-recpt))
(when (eq (car misc) 'recpt)
(setq num-real-recpt (1+ num-real-recpt))
(when (eq (cdr misc) me) (setq num-me (1+ num-me))))
......@@ -913,7 +913,7 @@ Cannot be called from a callback."
;;
(lyskom-traverse misc (cdr misc-list)
(cond ((member (car misc) '(recpt bcc-recpt cc-recpt))
(cond ((memq (car misc) '(recpt bcc-recpt cc-recpt))
(if (or (memq (cdr misc) author-list)
(eq (cdr misc) me))
(setq author-list (delq (cdr misc) author-list))))))
......@@ -1078,7 +1078,7 @@ WINDOW plus any optional arguments given in ARG-LIST."
(lyskom-edit-error nil))) ; Ignore these errors
(no nil))
(while headers
(if (member (car headers) '(comm-to footn-to))
(if (memq (car headers) '(comm-to footn-to))
(setq no (car (cdr headers))
headers nil)
(setq headers (cdr (cdr headers)))))
......
......@@ -130,17 +130,17 @@
((eq 'not (car (car filter)))
(lyskom-verify-filter-pattern
(cons (cdr (car filter)) (cdr filter))))
((member (car (car filter))
((memq (car (car filter))
'(author-re recipient-re subject-re text-re))
(and
(lyskom-filter-verify-regexp (cdr (car filter)))
(lyskom-verify-filter-pattern (cdr filter))))
((member (car (car filter)) '(author subject recipient text))
((memq (car (car filter)) '(author subject recipient text))
(and
(stringp (cdr (car filter)))
(lyskom-verify-filter-pattern (cdr filter))))
((member (car (car filter)) '(author-no recipient-no))
((memq (car (car filter)) '(author-no recipient-no))
(and
(integerp (cdr (car filter)))
(lyskom-verify-filter-pattern (cdr filter))))
......@@ -275,7 +275,7 @@ If NEG is non-nil, format the negation."
" != "
" = ")
(cdr (car pat))))
(cond ((member (car (car pat)) '(recipient-no author-no))
(cond ((memq (car (car pat)) '(recipient-no author-no))
(save-excursion
(if (boundp 'lyskom-buffer)
(set-buffer lyskom-buffer))
......@@ -527,11 +527,11 @@ If NEWLINE is non-nil, insert a newline after the header."
(setq what (cdr (assoc what rev-what)))
(if (not
(cond ((member what '(author subject text recipient))
(cond ((memq what '(author subject text recipient))
(setq arg argstring))
((member what '(author-no recipient-no))
((memq what '(author-no recipient-no))
(setq arg (string-to-int argstring)))
((member what '(author-re subject-re text-re recipient-re))
((memq what '(author-re subject-re text-re recipient-re))
(setq arg argstring)
(lyskom-filter-verify-regexp arg))))
(lyskom-error (lyskom-get-string 'filter-edit-bad-argument)
......
......@@ -166,7 +166,7 @@ invalid-value until a filter action has been selected.")
misc
(text-stat->misc-info-list text-stat)
(let ((type (misc-info->type misc)))
(if (member type '(RECPT CC-RECPT BCC-RECPT))
(if (memq type lyskom-recpt-types-list)
(initiate-get-conf-stat 'filter
nil
(misc-info->recipient-no misc)))))
......
......@@ -2024,7 +2024,7 @@ Args: CONF-STAT TAG PERSON"
(let ((result nil))
(lyskom-traverse misc
(text-stat->misc-info-list text-stat)
(when (and (member (misc-info->type misc) '(RECPT CC-RECPT BCC-RECPT))
(when (and (memq (misc-info->type misc) lyskom-recpt-types-list)
(eq (misc-info->recipient-no misc) conf-no))
(setq result t)))
result))
......
......@@ -421,7 +421,7 @@ information."
(hints (and data (elt data 4)))
(the-hint (lyskom-get-button-hint hints))
(props
(cond ((and (member type '(conf pers))
(cond ((and (memq type '(conf pers))
numarg)
(list 'face
(or face
......@@ -868,7 +868,7 @@ This is a LysKOM button action."
(defun lyskom-view-url-windows (url manager)
"View the URL URL in Microsoft Windows. MANGER is the URL manager.
Fall back on Netscape if not running in Microsoft Windows."
(cond ((member window-system '(win32 mswindows w32))
(cond ((memq window-system '(win32 mswindows w32))
(let ((programs '("start"
"explorer"
"C:\\Program Files\\Netscape\\Communicator\\Program\\netscape.exe"
......@@ -896,7 +896,7 @@ that, starts a new one."
(setq url (replace-in-string url "," "%2C"))
(setq url (replace-in-string url "(" "%28"))
(setq url (replace-in-string url ")" "%29"))
(let* ((url-string (if (member window-system '(win32 mswindows w32))
(let* ((url-string (if (memq window-system '(win32 mswindows w32))
(list url)
(list "-remote"
(format "openUrl(%s)" url))))
......
......@@ -364,9 +364,9 @@ If the optional argument REFETCH is non-nil, all caches are cleared and
(> len 1))
(let ((type (read-info->type (read-list->first lyskom-reading-list))))
(cond
((member type '(REVIEW REVIEW-TREE REVIEW-MARK))
((memq type lyskom-review-types-list)
(read-list-rotate lyskom-reading-list))
((member type '(COMM-IN FOOTN-IN))
((memq type lyskom-comment-types-list)
(set-read-list-del-first lyskom-reading-list))
(t
(setq finished t))))
......@@ -396,7 +396,7 @@ If the optional argument REFETCH is non-nil, all caches are cleared and
(priority (read-info->priority
(read-list->first lyskom-reading-list)))
(is-review-tree (eq type 'REVIEW-TREE))
(is-review (or (member type '(REVIEW REVIEW-MARK))
(is-review (or (memq type '(REVIEW REVIEW-MARK))
is-review-tree))
(mark-as-read (not is-review)))
(when is-review
......@@ -411,7 +411,7 @@ If the optional argument REFETCH is non-nil, all caches are cleared and
priority
is-review-tree
(not is-review)
(member type '(REVIEW REVIEW-MARK))))
(memq type '(REVIEW REVIEW-MARK))))
(if mark-as-read
(lyskom-is-read text-no)
(read-list-delete-text nil lyskom-reading-list)
......@@ -458,7 +458,7 @@ lyskom-mark-as-read."
"Update lyskom-membership for all recipients to TEXT-STAT."
(lyskom-traverse
misc (text-stat->misc-info-list text-stat)
(if (member (misc-info->type misc) '(RECPT BCC-RECPT CC-RECPT))
(if (memq (misc-info->type misc) '(RECPT BCC-RECPT CC-RECPT))
(let ((membership (lyskom-try-get-membership
(misc-info->recipient-no misc))))
(if membership
......@@ -2630,7 +2630,7 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing."
(defun lyskom-get-prioritized-session ()
"Get the session to go to if we are doing an auto-goto-session"
(let ((session-list (if (member kom-server-priority-breaks
(let ((session-list (if (memq kom-server-priority-breaks
'(express-letters letters
after-conf-letters))
lyskom-sessions-with-unread-letters
......@@ -2680,7 +2680,7 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing."
(set-buffer pri-session)
kom-server-priority))))
(and (not (eq pri-session (current-buffer)))
(or (and (member kom-server-priority-breaks
(or (and (memq kom-server-priority-breaks
'(express express-letters))
pri-session
(or (null pri) (> pri-session-pri pri)))
......@@ -2688,14 +2688,14 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing."
pri-session
(read-list-isempty lyskom-reading-list)
(read-list-isempty lyskom-to-do-list))
(and (member kom-server-priority-breaks '(t letters))
(and (memq kom-server-priority-breaks '(t letters))
pri-session
(or (null type)
(eq type 'CONF)
(eq type 'REVIEW)
(eq type 'REVIEW-MARK))
(or (null pri) (> pri-session-pri pri)))
(and (member kom-server-priority-breaks
(and (memq kom-server-priority-breaks
'(after-conf after-conf-letters))
pri-session
(read-list-isempty lyskom-reading-list)
......@@ -2708,7 +2708,7 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing."
(not (read-list-isempty lyskom-to-do-list))
(let ((type (read-info->type (read-list->first lyskom-reading-list))))
(or (eq kom-higher-priority-breaks 'express)
(member type '(CONF REVIEW REVIEW-MARK))))
(memq type '(CONF REVIEW REVIEW-MARK))))
(> (read-info->priority (read-list->first lyskom-to-do-list))
(read-info->priority (read-list->first lyskom-reading-list))))
(if (> (text-list->length (read-info->text-list
......
......@@ -259,7 +259,7 @@ only recomputed if the window width changes."
(lp--format-entry mship-conf-stat entry))
(when (or (eq (lp--entry->state entry) 'expanded)
(not (member (membership->created-by
(not (memq (membership->created-by
(lp--entry->membership entry))
(list lyskom-pers-no 0 'contracted))))
(lyskom-insert-at-point "\n ")
......
......@@ -284,7 +284,7 @@ Signal lyskom-parse-incomplete if there is no nonwhite char to parse."
(t (lyskom-protocol-error 'lyskom-parse-bitstring
"Expected bool or space, got %S"
char))))
(if (not (member char '(?\ ?\n)))
(if (not (memq char '(?\ ?\n)))
;; This occurs when the received string is longer than
;; expected.
(progn
......
......@@ -640,7 +640,7 @@ Put the requests on QUEUE."
(text-stat->misc-info-list text-stat)
(let ((type (misc-info->type misc)))
(cond
((member type '(RECPT BCC-RECPT CC-RECPT))
((memq type '(RECPT BCC-RECPT CC-RECPT))
(lyskom-prefetch-conf (misc-info->recipient-no misc) queue))
((eq type 'COMM-IN)
(lyskom-prefetch-textauth (misc-info->comm-in misc) queue))
......@@ -670,7 +670,7 @@ Put the requests on QUEUE."
(text-stat->misc-info-list text-stat)
(let ((type (misc-info->type misc)))
(cond
((member type '(RECPT BCC-RECPT CC-RECPT))
((memq type '(RECPT BCC-RECPT CC-RECPT))
(lyskom-prefetch-conf (misc-info->recipient-no misc) queue))
((eq type 'COMM-IN)
(lyskom-prefetch-texttree (misc-info->comm-in misc) queue t))
......@@ -804,7 +804,7 @@ Put the requests on QUEUE."
(text-stat->misc-info-list text-stat)
(let ((type (misc-info->type misc)))
(cond
((member type '(RECPT BCC-RECPT CC-RECPT))
((memq type '(RECPT BCC-RECPT CC-RECPT))
(lyskom-prefetch-conf (misc-info->recipient-no misc) queue))
((eq type 'COMM-IN)
(lyskom-prefetch-textauth (misc-info->comm-in misc) queue))
......
......@@ -281,8 +281,8 @@ Args: BY TO NUM"
(lyskom-traverse misc (text-stat->misc-info-list x)
(setq found
(or found
(and (member (misc-info->type misc)
'(RECPT CC-RECPT BCC-RECPT))
(and (memq (misc-info->type misc)
lyskom-recpt-types-list)
(eq (misc-info->recipient-no misc) to)))))
found)))
(list to)
......@@ -947,7 +947,7 @@ If reading forward then starts reading backward and the other way round."
(interactive)
(cond
((and (not (read-list-isempty lyskom-reading-list))
(member (read-info->type (read-list->first lyskom-reading-list))
(memq (read-info->type (read-list->first lyskom-reading-list))
'(REVIEW REVIEW-MARK)))
(let* ((info (read-list->first lyskom-reading-list))
(list (read-info->text-list info))
......@@ -1171,13 +1171,13 @@ end."
(interactive)
(let ((found nil))
(if (not (read-list-isempty lyskom-reading-list))
(while (member (read-info->type (read-list->first lyskom-reading-list))
'(REVIEW REVIEW-TREE REVIEW-MARK))
(while (memq (read-info->type (read-list->first lyskom-reading-list))
lyskom-review-types-list)
(set-read-list-del-first lyskom-reading-list)
(setq found t)))
(if (not (read-list-isempty lyskom-to-do-list))
(while (member (read-info->type (read-list->first lyskom-to-do-list))
'(REVIEW REVIEW-TREE REVIEW-MARK))
(while (memq (read-info->type (read-list->first lyskom-to-do-list))
lyskom-review-types-list)
(set-read-list-del-first lyskom-to-do-list)
(setq found t)))
......
......@@ -1178,7 +1178,7 @@ If WANT-TYPES is non-nil then the result is an assoc list where the
car of each element is the recipient number and the cdr is the type."
(let ((result nil))
(lyskom-traverse misc (text-stat->misc-info-list text-stat)
(when (member (misc-info->type misc) '(RECPT CC-RECPT BCC-RECPT))
(when (memq (misc-info->type misc) lyskom-recpt-types-list)
(if want-types
(setq result (cons (cons (misc-info->recipient-no misc)
(misc-info->type misc))
......
......@@ -2354,6 +2354,11 @@ to be bold with yellow text on a red background."
(defvar lyskom-fast-reply-history nil)
;;; ============================================================
(defconst lyskom-comment-types-list '(COMM-IN FOOTN-IN))
(defconst lyskom-recpt-types-list '(RECPT CC-RECPT BCC-RECPT))
(defconst lyskom-review-types-list '(REVIEW REVIEW-TREE REVIEW-MARK))
(eval-and-compile (provide 'lyskom-vars))
......
......@@ -215,7 +215,7 @@ Note that this function must not be called asynchronously."
(text-stat->misc-info-list text-stat)
(let ((type (misc-info->type misc)))
(cond
((member type '(RECPT BCC-RECPT CC-RECPT))
((memq type '(RECPT BCC-RECPT CC-RECPT))
(lyskom-print-header-recpt
(misc-info->recipient-no misc)
misc))
......@@ -524,7 +524,7 @@ recipients to it that the user is a member in."
(let* ((misc-info (elt misc-info-list i))
(type (misc-info->type misc-info)))
(cond
((member type '(RECPT BCC-RECPT CC-RECPT))
((memq type '(RECPT BCC-RECPT CC-RECPT))
;; Is this function ever called asynchronously? If not, we
;; can use lyskom-get-membership istead.
(let ((membership (lyskom-try-get-membership
......@@ -562,7 +562,7 @@ blocking-do."
(setq misc-item (car misc-info-list))
(setq type (misc-info->type misc-item))
(setq misc-info-list (cdr misc-info-list))
(cond ((member type '(RECPT BCC-RECPT CC-RECPT))
(cond ((memq type '(RECPT BCC-RECPT CC-RECPT))
(setq membership (if bg
(lyskom-try-get-membership
(misc-info->recipient-no misc-item) t)
......@@ -900,7 +900,7 @@ the client. That is done by lyskom-is-read."
(let ((misc-info-list (text-stat->misc-info-list text-stat)))
(lyskom-traverse
misc-info misc-info-list
(if (and (member (misc-info->type misc-info) '(RECPT BCC-RECPT CC-RECPT))
(if (and (memq (misc-info->type misc-info) '(RECPT BCC-RECPT CC-RECPT))
;; The whole membership list might not be fetched
;; yet. So we better mark it as read in all conferences.
;; (lyskom-member-p (misc-info->recipient-no misc-info))
......
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