From: Katsumi Yamaoka Date: Wed, 20 Feb 2002 00:15:33 +0000 (+0000) Subject: * many files: Remove trailing whitespaces, replace spc+tab with X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=commitdiff_plain;h=ee4a7be24fb6982b5baa5eafb65178ccaca6df50 * many files: Remove trailing whitespaces, replace spc+tab with tab, replace leading whitespaces with tabs. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3e711625e..efae8e1c9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2002-02-20 Katsumi Yamaoka + + * many files: Remove trailing whitespaces, replace spc+tab with + tab, replace leading whitespaces with tabs. + 2002-02-19 Paul Jarc * gnus-sum.el (gnus-summary-toggle-header): Fix handling of diff --git a/lisp/binhex.el b/lisp/binhex.el index 4ae5419f9..8cdd74763 100644 --- a/lisp/binhex.el +++ b/lisp/binhex.el @@ -47,7 +47,7 @@ input and write the converted data to its standard output." :group 'gnus-extract :type '(repeat string)) -(defcustom binhex-use-external +(defcustom binhex-use-external (executable-find binhex-decoder-program) "*Use external binhex program." :group 'gnus-extract @@ -277,7 +277,7 @@ If HEADER-ONLY is non-nil only decode header and return filename." (interactive "r") (let ((cbuf (current-buffer)) firstline work-buffer status (file-name (expand-file-name - (concat (binhex-decode-region-internal start end t) + (concat (binhex-decode-region-internal start end t) ".data") binhex-temporary-file-directory))) (save-excursion @@ -315,7 +315,7 @@ If HEADER-ONLY is non-nil only decode header and return filename." (defun binhex-decode-region (start end) "Binhex decode region between START and END." (interactive "r") - (if binhex-use-external + (if binhex-use-external (binhex-decode-region-external start end) (binhex-decode-region-internal start end))) diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index c9567dbbf..7964a0ea7 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -257,7 +257,7 @@ Modify to suit your needs.")) (setq files (delete "nnrss.el" files)))) (dolist (file (if (featurep 'xemacs) - '("md5.el") + '("md5.el") '("gnus-xmas.el" "messagexmas.el" "nnheaderxm.el"))) (setq files (delete file files))) diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index 38e96de47..cfceee11c 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -357,7 +357,7 @@ If this is `ask' the hook will query the user." (progn (setq gnus-plugged plugged) (gnus-run-hooks 'gnus-agent-plugged-hook) - (setcar (cdr gnus-agent-mode-status) + (setcar (cdr gnus-agent-mode-status) (gnus-agent-make-mode-line-string " Plugged" 'mouse-2 'gnus-agent-toggle-plugged)) @@ -366,7 +366,7 @@ If this is `ask' the hook will query the user." (gnus-agent-close-connections) (setq gnus-plugged plugged) (gnus-run-hooks 'gnus-agent-unplugged-hook) - (setcar (cdr gnus-agent-mode-status) + (setcar (cdr gnus-agent-mode-status) (gnus-agent-make-mode-line-string " Unplugged" 'mouse-2 'gnus-agent-toggle-plugged))) @@ -821,7 +821,7 @@ the actual number of articles toggled is returned." (goto-char (point-min)) (when (re-search-forward (concat "^" (regexp-quote group) " ") nil t) - (save-excursion + (save-excursion (read (current-buffer)) ;; max (setq oactive-min (read (current-buffer)))) ;; min (gnus-delete-line)) @@ -981,7 +981,7 @@ the actual number of articles toggled is returned." (goto-char (match-end 0))) (gnus-agent-crosspost crosses (caar pos)))) (goto-char (point-min)) - (if (not (re-search-forward + (if (not (re-search-forward "^Message-ID: *<\\([^>\n]+\\)>" nil t)) (setq id "No-Message-ID-in-article") (setq id (buffer-substring (match-beginning 1) (match-end 1)))) @@ -1054,7 +1054,7 @@ the actual number of articles toggled is returned." (setq articles (sort (gnus-uncompress-sequence articles) '<)) ;; Remove known articles. (when (gnus-agent-load-alist group) - (setq articles (gnus-list-range-intersection + (setq articles (gnus-list-range-intersection articles (list (cons (1+ (caar (last gnus-agent-article-alist))) @@ -1065,11 +1065,11 @@ the actual number of articles toggled is returned." (when articles (gnus-message 7 "Fetching headers for %s..." group) (save-excursion - (set-buffer nntp-server-buffer) - (unless (eq 'nov (gnus-retrieve-headers articles group)) - (nnvirtual-convert-headers)) - ;; Save these headers for later processing. - (copy-to-buffer gnus-agent-overview-buffer (point-min) (point-max)) + (set-buffer nntp-server-buffer) + (unless (eq 'nov (gnus-retrieve-headers articles group)) + (nnvirtual-convert-headers)) + ;; Save these headers for later processing. + (copy-to-buffer gnus-agent-overview-buffer (point-min) (point-max)) (when (file-exists-p file) (gnus-agent-braid-nov group articles file)) (let ((coding-system-for-write @@ -1869,14 +1869,14 @@ The following commands are available: (push (read (current-buffer)) cached-articles)) (forward-line 1)) (setq cached-articles (nreverse cached-articles)))) - (if (setq uncached-articles + (if (setq uncached-articles (gnus-sorted-difference articles cached-articles)) (progn (set-buffer nntp-server-buffer) (erase-buffer) (let (gnus-agent-cache) - (unless (eq 'nov - (gnus-retrieve-headers + (unless (eq 'nov + (gnus-retrieve-headers uncached-articles group fetch-old)) (nnvirtual-convert-headers))) (set-buffer gnus-agent-overview-buffer) @@ -1945,7 +1945,7 @@ The following commands are available: (let ((nnheader-file-coding-system gnus-agent-file-coding-system)) (nnheader-insert-file-contents file))) - (goto-char (point-min)) + (goto-char (point-min)) (while (not (eobp)) (while (not (or (eobp) (looking-at "[0-9]"))) (setq point (point)) @@ -1958,7 +1958,7 @@ The following commands are available: (while (and arts (> n (car arts))) (message "Regenerating NOV %s %d..." group (car arts)) (mm-with-unibyte-buffer - (nnheader-insert-file-contents + (nnheader-insert-file-contents (concat dir (number-to-string (car arts)))) (goto-char (point-min)) (if (search-forward "\n\n" nil t) @@ -1983,15 +1983,15 @@ The following commands are available: (unless clean (gnus-agent-load-alist group)) (setq alist (sort alist 'car-less-than-car)) - (setq gnus-agent-article-alist (sort gnus-agent-article-alist + (setq gnus-agent-article-alist (sort gnus-agent-article-alist 'car-less-than-car)) (while (and alist gnus-agent-article-alist) - (cond + (cond ((< (caar alist) (caar gnus-agent-article-alist)) (push (pop alist) new-alist)) ((> (caar alist) (caar gnus-agent-article-alist)) (push (list (car (pop gnus-agent-article-alist))) new-alist)) - (t + (t (pop gnus-agent-article-alist) (while (and gnus-agent-article-alist (= (caar alist) (caar gnus-agent-article-alist))) @@ -2015,8 +2015,8 @@ The following commands are available: (if (not (re-search-forward "^Message-ID: *<\\([^>\n]+\\)>" nil t)) (setq id "No-Message-ID-in-article") (setq id (buffer-substring (match-beginning 1) (match-end 1)))) - (gnus-agent-enter-history - id (list (cons group article)) + (gnus-agent-enter-history + id (list (cons group article)) (time-to-days (nth 5 (file-attributes file))))))) ;;;###autoload @@ -2027,7 +2027,7 @@ If CLEAN, don't read existing active and agentview files." (message "Regenerating Gnus agent files...") (dolist (gnus-command-method gnus-agent-covered-methods) (let ((active-file (gnus-agent-lib-file "active")) - history-hashtb active-hashtb active-changed + history-hashtb active-hashtb active-changed history-changed point) (gnus-make-directory (file-name-directory active-file)) (if clean @@ -2049,12 +2049,12 @@ If CLEAN, don't read existing active and agentview files." (goto-char (point-min)) (forward-line 1) (while (not (eobp)) - (if (looking-at + (if (looking-at "\\([^\t\n]+\\)\t[0-9]+\t\\([^ \n]+\\) \\([0-9]+\\)") (progn - (unless (string= (match-string 1) + (unless (string= (match-string 1) "last-header-fetched-for-session") - (gnus-sethash (match-string 2) + (gnus-sethash (match-string 2) (cons (string-to-number (match-string 3)) (gnus-gethash-safe (match-string 2) history-hashtb)) @@ -2085,14 +2085,14 @@ If CLEAN, don't read existing active and agentview files." n) (gnus-sethash group arts history-hashtb) (while (and arts gnus-agent-article-alist) - (cond + (cond ((> (car arts) (caar gnus-agent-article-alist)) (when (cdar gnus-agent-article-alist) - (gnus-agent-regenerate-history + (gnus-agent-regenerate-history group (caar gnus-agent-article-alist)) (setq history-changed t)) (setq n (car (pop gnus-agent-article-alist))) - (while (and gnus-agent-article-alist + (while (and gnus-agent-article-alist (= n (caar gnus-agent-article-alist))) (pop gnus-agent-article-alist))) ((< (car arts) (caar gnus-agent-article-alist)) @@ -2101,7 +2101,7 @@ If CLEAN, don't read existing active and agentview files." (pop arts))) (t (setq n (car (pop gnus-agent-article-alist))) - (while (and gnus-agent-article-alist + (while (and gnus-agent-article-alist (= n (caar gnus-agent-article-alist))) (pop gnus-agent-article-alist)) (setq n (pop arts)) @@ -2109,18 +2109,18 @@ If CLEAN, don't read existing active and agentview files." (pop arts))))) (while gnus-agent-article-alist (when (cdar gnus-agent-article-alist) - (gnus-agent-regenerate-history + (gnus-agent-regenerate-history group (caar gnus-agent-article-alist)) (setq history-changed t)) (pop gnus-agent-article-alist)))) (when history-changed - (message "Regenerate the history file of %s:%s" + (message "Regenerate the history file of %s:%s" (car gnus-command-method) (cadr gnus-command-method)) (gnus-agent-save-history)) (gnus-agent-close-history) (when active-changed - (message "Regenerate %s" active-file) + (message "Regenerate %s" active-file) (let ((nnmail-active-file-coding-system gnus-agent-file-coding-system)) (gnus-write-active-file active-file active-hashtb))))) (message "Regenerating Gnus agent files...done")) @@ -2130,8 +2130,8 @@ If CLEAN, don't read existing active and agentview files." (interactive (list t)) (dolist (server gnus-opened-servers) (when (eq (nth 1 server) 'offline) - (if (if (eq force 'ask) - (gnus-y-or-n-p + (if (if (eq force 'ask) + (gnus-y-or-n-p (format "Switch %s:%s into online status? " (caar server) (cadar server))) force) diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 162f7e88e..c7bf11376 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -2111,7 +2111,7 @@ If READ-CHARSET, ask for a coding system." (mm-setup-w3) (let ((w3-strict-width (window-width)) (url-standalone-mode t) - (url-gateway-unplugged t) + (url-gateway-unplugged t) (w3-honor-stylesheets nil)) (condition-case var (w3-region (point-min) (point-max)) @@ -4120,7 +4120,7 @@ If no internal viewer is available, use an external viewer." ;; We have to do this since selecting the window ;; may change the point. So we set the window point. (set-window-point window point))) - (let* ((handles (or ihandles (mm-dissect-buffer + (let* ((handles (or ihandles (mm-dissect-buffer nil gnus-article-loose-mime) (mm-uu-dissect))) buffer-read-only handle name type b e display) diff --git a/lisp/gnus-bcklg.el b/lisp/gnus-bcklg.el index f95fcee8b..400dbd5d4 100644 --- a/lisp/gnus-bcklg.el +++ b/lisp/gnus-bcklg.el @@ -1,5 +1,5 @@ ;;; gnus-bcklg.el --- backlog functions for Gnus -;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen diff --git a/lisp/gnus-cache.el b/lisp/gnus-cache.el index f93d6be2a..ed2f79ff7 100644 --- a/lisp/gnus-cache.el +++ b/lisp/gnus-cache.el @@ -377,10 +377,10 @@ Returns the list of articles removed." (interactive) (let ((gnus-verbose (max 6 gnus-verbose))) (if gnus-newsgroup-cached - (progn - (gnus-summary-limit gnus-newsgroup-cached) - (gnus-summary-position-point)) - (gnus-message 3 "No cached articles for this group")))) + (progn + (gnus-summary-limit gnus-newsgroup-cached) + (gnus-summary-position-point)) + (gnus-message 3 "No cached articles for this group")))) ;;; Internal functions. @@ -720,7 +720,6 @@ If GROUP is non-nil, also cater to `gnus-cacheable-groups' and (string-match gnus-cacheable-groups group)) (or (not gnus-uncacheable-groups) (not (string-match gnus-uncacheable-groups group))))))) - (provide 'gnus-cache) diff --git a/lisp/gnus-cus.el b/lisp/gnus-cus.el index 6df3ffafa..85c5cbf4d 100644 --- a/lisp/gnus-cus.el +++ b/lisp/gnus-cus.el @@ -195,7 +195,7 @@ Which articles to display on entering the group. unread and ticked articles. `Other' - Display the articles that satisfy the S-expression. The S-expression + Display the articles that satisfy the S-expression. The S-expression should be in an array form.") (comment (string :tag "Comment") "\ diff --git a/lisp/gnus-diary.el b/lisp/gnus-diary.el index 11a2b8309..51c85002b 100644 --- a/lisp/gnus-diary.el +++ b/lisp/gnus-diary.el @@ -265,7 +265,7 @@ There are currently two built-in format functions: (o1 (nndiary-next-occurence s1 now)) (o2 (nndiary-next-occurence s2 now))) (if (and (= (car o1) (car o2)) (= (cadr o1) (cadr o2))) - (< (mail-header-number h1) (mail-header-number h2)) + (< (mail-header-number h1) (mail-header-number h2)) (time-less-p o1 o2)))) diff --git a/lisp/gnus-dired.el b/lisp/gnus-dired.el index 14104f4ce..22104f6c6 100644 --- a/lisp/gnus-dired.el +++ b/lisp/gnus-dired.el @@ -96,7 +96,7 @@ filenames." (let ((destination nil) (files-str nil) (bufs nil)) - ;; warn if user tries to attach without any files marked + ;; warn if user tries to attach without any files marked (if (null files-to-attach) (error "No files to attach") (setq files-str @@ -104,7 +104,7 @@ filenames." (lambda (f) (file-name-nondirectory f)) files-to-attach ", ")) (setq bufs (message-buffers)) - + ;; set up destination message buffer (if (and bufs (y-or-n-p "Attach files to existing message buffer? ")) @@ -146,12 +146,12 @@ If ARG is non-nil, open it in a new buffer." (not (file-directory-p file-name)) (string-match "\\.[^\\.]+$" file-name) (setq mime-type - (mailcap-extension-to-mime + (mailcap-extension-to-mime (match-string 0 file-name))) - (stringp + (stringp (setq method - (cdr (assoc 'viewer - (car (mailcap-mime-info mime-type + (cdr (assoc 'viewer + (car (mailcap-mime-info mime-type 'all))))))) (let ((view-command (mm-mailcap-command method file-name nil))) (message "viewing via %s" view-command) @@ -177,16 +177,16 @@ file to save in." (file-name-sans-versions (dired-get-filename) t) (ps-print-preprint current-prefix-arg))) (mailcap-parse-mailcaps) - (cond + (cond ((file-directory-p file-name) (error "Can't print a directory")) ((file-exists-p file-name) (let (mime-type method) (if (and (string-match "\\.[^\\.]+$" file-name) (setq mime-type - (mailcap-extension-to-mime + (mailcap-extension-to-mime (match-string 0 file-name))) - (stringp + (stringp (setq method (mailcap-mime-info mime-type "print")))) (call-process shell-file-name nil (generate-new-buffer " *mm*") diff --git a/lisp/gnus-dup.el b/lisp/gnus-dup.el index e148f4574..a2b5544b0 100644 --- a/lisp/gnus-dup.el +++ b/lisp/gnus-dup.el @@ -113,7 +113,7 @@ seen in the same session." (gnus-dup-open)) (setq gnus-dup-list-dirty t) ; mark list for saving (let ((data gnus-newsgroup-data) - datum msgid) + datum msgid) ;; Enter the Message-IDs of all read articles into the list ;; and hash table. (while (setq datum (pop data)) @@ -121,11 +121,11 @@ seen in the same session." (> (gnus-data-number datum) 0) (not (memq (gnus-data-number datum) gnus-newsgroup-unreads)) (not (= (gnus-data-mark datum) gnus-canceled-mark)) - (setq msgid (mail-header-id (gnus-data-header datum))) - (not (nnheader-fake-message-id-p msgid)) - (not (intern-soft msgid gnus-dup-hashtb))) + (setq msgid (mail-header-id (gnus-data-header datum))) + (not (nnheader-fake-message-id-p msgid)) + (not (intern-soft msgid gnus-dup-hashtb))) (push msgid gnus-dup-list) - (intern msgid gnus-dup-hashtb)))) + (intern msgid gnus-dup-hashtb)))) ;; Chop off excess Message-IDs from the list. (let ((end (nthcdr gnus-duplicate-list-length gnus-dup-list))) (when end diff --git a/lisp/gnus-ems.el b/lisp/gnus-ems.el index 662f580b6..7d208bef5 100644 --- a/lisp/gnus-ems.el +++ b/lisp/gnus-ems.el @@ -223,7 +223,7 @@ (defun gnus-put-image (glyph &optional string) (insert-image glyph (or string " ")) (unless string - (put-text-property (1- (point)) (point) + (put-text-property (1- (point)) (point) 'gnus-image-text-deletable t)) glyph) diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 16bffb26d..bb31909b4 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -190,7 +190,7 @@ Also note that if you change the format specification to include any of these specs, you must probably re-start Gnus to see them go into effect. -General format specifiers can also be used. +General format specifiers can also be used. See (gnus)Formatting Variables." :link '(custom-manual "(gnus)Formatting Variables") :group 'gnus-group-visual @@ -1888,14 +1888,14 @@ Return the name of the group if selection was successful." (,(intern (format "%s-address" (car method))) ,(cadr method)) ,@(cddr method))) (let ((group (if (gnus-group-foreign-p group) group - (gnus-group-prefixed-name (gnus-group-real-name group) + (gnus-group-prefixed-name (gnus-group-real-name group) method)))) (gnus-sethash group `(-1 nil (,group ,gnus-level-default-subscribed nil nil ,method ,(cons - (if quit-config + (if quit-config (cons 'quit-config quit-config) (cons 'quit-config (cons gnus-summary-buffer @@ -3696,10 +3696,10 @@ The hook gnus-suspend-gnus-hook is called before actually suspending." (let ((group-buf (get-buffer gnus-group-buffer))) (mapcar (lambda (buf) (unless (or (member buf (list group-buf gnus-dribble-buffer)) - (progn + (progn (save-excursion - (set-buffer buf) - (eq major-mode 'message-mode)))) + (set-buffer buf) + (eq major-mode 'message-mode)))) (gnus-kill-buffer buf))) (gnus-buffers)) (gnus-kill-gnus-frames) @@ -4023,7 +4023,7 @@ This command may read the active file." (mark gnus-read-mark) active n) (if (get-buffer buffer) - (with-current-buffer buffer + (with-current-buffer buffer (setq active gnus-newsgroup-active) (gnus-activate-group group) (when gnus-newsgroup-prepared @@ -4040,7 +4040,7 @@ This command may read the active file." (unless (eq n article) (push n gnus-newsgroup-unselected)) (setq n (1+ n))) - (setq gnus-newsgroup-unselected + (setq gnus-newsgroup-unselected (nreverse gnus-newsgroup-unselected))))) (gnus-activate-group group) (gnus-group-make-articles-read group diff --git a/lisp/gnus-int.el b/lisp/gnus-int.el index cc60057e2..47f45483d 100644 --- a/lisp/gnus-int.el +++ b/lisp/gnus-int.el @@ -202,16 +202,16 @@ If it is down, start it up (again)." (setq elem (list gnus-command-method nil) gnus-opened-servers (cons elem gnus-opened-servers))) ;; Set the status of this server. - (setcar (cdr elem) - (if result + (setcar (cdr elem) + (if result (if (eq (cadr elem) 'offline) 'offline 'ok) - (if (and gnus-agent + (if (and gnus-agent (not (eq (cadr elem) 'offline)) (gnus-agent-method-p gnus-command-method)) (or gnus-server-unopen-status - (if (gnus-y-or-n-p + (if (gnus-y-or-n-p (format "Unable to open %s:%s, go offline? " (car gnus-command-method) (cadr gnus-command-method))) diff --git a/lisp/gnus-ml.el b/lisp/gnus-ml.el index 41f85ae24..978b2e336 100644 --- a/lisp/gnus-ml.el +++ b/lisp/gnus-ml.el @@ -177,7 +177,7 @@ If FORCE is non-nil, replace the old ones." (cond ((string-match "]*\\)>" address) (let ((args (match-string 1 address))) - (cond ; with param + (cond ; with param ((string-match "\\(.*\\)\\?\\(.*\\)" args) (setq mailto (match-string 1 args)) (let ((param (match-string 2 args))) @@ -188,7 +188,7 @@ If FORCE is non-nil, replace the old ones." (if (string-match "to=\\([^&]*\\)" param) (push (match-string 1 param) to)) )) - (t (setq mailto args))))) ; without param + (t (setq mailto args))))) ; without param ; other case = number (caar ranges)))) + (>= number (caar ranges)))) (push number result))) (nreverse result))) diff --git a/lisp/gnus-sieve.el b/lisp/gnus-sieve.el index 36c99d076..18300ed85 100644 --- a/lisp/gnus-sieve.el +++ b/lisp/gnus-sieve.el @@ -219,7 +219,7 @@ This is returned as a string." (let* ((newsrc (cdr gnus-newsrc-alist)) script) (dolist (info newsrc) - (when (or (not method) + (when (or (not method) (gnus-server-equal method (gnus-info-method info))) (let* ((group (gnus-info-group info)) (spec (gnus-group-find-parameter group 'sieve t))) diff --git a/lisp/gnus-soup.el b/lisp/gnus-soup.el index 0c609e714..5fcda57e5 100644 --- a/lisp/gnus-soup.el +++ b/lisp/gnus-soup.el @@ -555,7 +555,7 @@ Return whether the unpacking was successful." result) (run-hooks 'message-send-news-hook) (gnus-open-server method) - (message "Sending news via %s..." + (message "Sending news via %s..." (gnus-server-string method)) (unless (let ((mail-header-separator "")) (gnus-request-post method)) diff --git a/lisp/gnus-spec.el b/lisp/gnus-spec.el index c9f0e5a92..2c756d3b9 100644 --- a/lisp/gnus-spec.el +++ b/lisp/gnus-spec.el @@ -291,7 +291,7 @@ (wseek 0) (seek 0) (length (length string)) - (string (concat string "\0"))) + (string (concat string "\0"))) ;; Find the start position. (while (and (< seek length) (< wseek start)) @@ -455,7 +455,7 @@ characters when given a pad value." `(let (gnus-position) ,@(gnus-complex-form-to-spec form spec-alist) (if gnus-position - (gnus-put-text-property gnus-position (1+ gnus-position) + (gnus-put-text-property gnus-position (1+ gnus-position) 'gnus-position t))) `(progn ,@(gnus-complex-form-to-spec form spec-alist))))))) @@ -538,7 +538,7 @@ characters when given a pad value." t) (t nil))) - (cond + (cond ;; User-defined spec -- find the spec name. ((eq (setq spec (char-after)) ?u) (forward-char 1) @@ -567,7 +567,7 @@ characters when given a pad value." (user-defined (setq elem (list - (list (intern (format + (list (intern (format (if (stringp user-defined) "gnus-user-format-function-%s" "gnus-user-format-function-%c") diff --git a/lisp/gnus-srvr.el b/lisp/gnus-srvr.el index 736d61a83..f0667b634 100644 --- a/lisp/gnus-srvr.el +++ b/lisp/gnus-srvr.el @@ -57,7 +57,7 @@ The following specs are understood: %s status %a agent covered -General format specifiers can also be used. +General format specifiers can also be used. See (gnus)Formatting Variables." :link '(custom-manual "(gnus)Formatting Variables") :group 'gnus-server-visual @@ -262,24 +262,24 @@ The following commands are available: (if (featurep 'xemacs) (put 'gnus-server-mode 'font-lock-defaults '(gnus-server-font-lock-keywords t)) (set (make-local-variable 'font-lock-defaults) - '(gnus-server-font-lock-keywords t))) + '(gnus-server-font-lock-keywords t))) (gnus-run-hooks 'gnus-server-mode-hook)) (defun gnus-server-insert-server-line (gnus-tmp-name method) (let* ((gnus-tmp-how (car method)) (gnus-tmp-where (nth 1 method)) (elem (assoc method gnus-opened-servers)) - (gnus-tmp-status - (cond + (gnus-tmp-status + (cond ((eq (nth 1 elem) 'denied) "(denied)") ((eq (nth 1 elem) 'offline) "(offline)") (t - (condition-case nil - (if (or (gnus-server-opened method) - (eq (nth 1 elem) 'ok)) + (condition-case nil + (if (or (gnus-server-opened method) + (eq (nth 1 elem) 'ok)) "(opened)" - "(closed)") - ((error) "(error)"))))) + "(closed)") + ((error) "(error)"))))) (gnus-tmp-agent (if (and gnus-agent (member method gnus-agent-covered-methods)) @@ -432,7 +432,7 @@ The following commands are available: (setq alist (cdr alist))) (if alist (setcdr alist (cons killed (cdr alist))) - (setq gnus-server-alist (list killed))))) + (setq gnus-server-alist (list killed))))) (gnus-server-update-server (car killed)) (setq gnus-server-killed-servers (cdr gnus-server-killed-servers)) (gnus-server-position-point))) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 8d8a19fdd..3a4884fdb 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -576,7 +576,7 @@ with some simple extensions. %S The subject -General format specifiers can also be used. +General format specifiers can also be used. See (gnus)Formatting Variables." :link '(custom-manual "(gnus)Formatting Variables") :group 'gnus-threading @@ -2086,10 +2086,10 @@ increase the score of each group you read." ["Wide reply and yank" gnus-summary-wide-reply-with-original ,@(if (featurep 'xemacs) '(t) '(:help "Mail a reply, quoting this article"))] - ["Very wide reply" gnus-summary-very-wide-reply t] - ["Very wide reply and yank" gnus-summary-very-wide-reply-with-original - ,@(if (featurep 'xemacs) '(t) - '(:help "Mail a very wide reply, quoting this article"))] + ["Very wide reply" gnus-summary-very-wide-reply t] + ["Very wide reply and yank" gnus-summary-very-wide-reply-with-original + ,@(if (featurep 'xemacs) '(t) + '(:help "Mail a very wide reply, quoting this article"))] ["Mail forward" gnus-summary-mail-forward t] ["Post forward" gnus-summary-post-forward t] ["Digest and mail" gnus-uu-digest-mail-forward t] @@ -4425,7 +4425,7 @@ or a straight list of headers." (delq number gnus-newsgroup-unreads)) (if gnus-newsgroup-auto-expire (setq gnus-newsgroup-expirable - (gnus-add-to-sorted-list + (gnus-add-to-sorted-list gnus-newsgroup-expirable number)) (push (cons number gnus-low-score-mark) gnus-newsgroup-reads)))) @@ -4884,7 +4884,7 @@ If SELECT-ARTICLES, only select those articles from GROUP." (gnus-uncompress-range (gnus-active group)) (gnus-cache-articles-in-group group)) ;; Select only the "normal" subset of articles. - (gnus-sorted-nunion + (gnus-sorted-nunion (gnus-sorted-union gnus-newsgroup-dormant gnus-newsgroup-marked) gnus-newsgroup-unreads))) (scored-list (gnus-killed-articles gnus-newsgroup-killed articles)) @@ -6018,7 +6018,7 @@ The prefix argument ALL means to select all articles." (set-buffer gnus-group-buffer) (gnus-undo-force-boundary)) (gnus-update-read-articles - group (gnus-sorted-union + group (gnus-sorted-union gnus-newsgroup-unreads gnus-newsgroup-unselected)) ;; Set the current article marks. (let ((gnus-newsgroup-scored @@ -7073,10 +7073,10 @@ articles that are younger than AGE days." (when (> (length days) 0) (setq days (read days))) (if (numberp days) - (progn + (progn (setq days-got t) (if (< days 0) - (progn + (progn (setq younger (not younger)) (setq days (* days -1))))) (message "Please enter a number.") @@ -8076,7 +8076,7 @@ If ARG (the prefix) is a number, show the article with the charset defined in `gnus-summary-show-article-charset-alist', or the charset input. If ARG (the prefix) is non-nil and not a number, show the raw article -without any article massaging functions being run. Normally, the key strokes +without any article massaging functions being run. Normally, the key strokes are `C-u g'." (interactive "P") (cond @@ -8173,19 +8173,19 @@ If ARG is a negative number, hide the unwanted header lines." (let* ((buffer-read-only nil) (inhibit-point-motion-hooks t) hidden e) - (save-restriction - (article-narrow-to-head) - (setq e (point-max) - hidden (if (numberp arg) - (>= arg 0) - (gnus-article-hidden-text-p 'headers)))) - (delete-region (point-min) e) + (save-restriction + (article-narrow-to-head) + (setq e (point-max) + hidden (if (numberp arg) + (>= arg 0) + (gnus-article-hidden-text-p 'headers)))) + (delete-region (point-min) e) (goto-char (point-min)) (save-excursion (set-buffer gnus-original-article-buffer) (goto-char (point-min)) - (setq e (search-forward "\n\n" nil t) - e (if e (1- e) (point-max)))) + (setq e (search-forward "\n\n" nil t) + e (if e (1- e) (point-max)))) (insert-buffer-substring gnus-original-article-buffer 1 e) (save-restriction (narrow-to-region (point-min) (point)) @@ -9204,15 +9204,15 @@ Iff NO-EXPIRE, auto-expiry will be inhibited." (setq gnus-newsgroup-reads (delq article gnus-newsgroup-reads)) (cond ((= mark gnus-ticked-mark) (setq gnus-newsgroup-marked - (gnus-add-to-sorted-list gnus-newsgroup-marked + (gnus-add-to-sorted-list gnus-newsgroup-marked article))) ((= mark gnus-dormant-mark) (setq gnus-newsgroup-dormant - (gnus-add-to-sorted-list gnus-newsgroup-dormant + (gnus-add-to-sorted-list gnus-newsgroup-dormant article))) (t (setq gnus-newsgroup-unreads - (gnus-add-to-sorted-list gnus-newsgroup-unreads + (gnus-add-to-sorted-list gnus-newsgroup-unreads article)))) (gnus-pull article gnus-newsgroup-reads) @@ -10836,7 +10836,7 @@ returned." (defun gnus-summary-insert-articles (articles) (when (setq articles (gnus-sorted-difference articles - (mapcar (lambda (h) + (mapcar (lambda (h) (mail-header-number h)) gnus-newsgroup-headers))) (setq gnus-newsgroup-headers diff --git a/lisp/gnus-topic.el b/lisp/gnus-topic.el index 1c493c665..b4a404281 100644 --- a/lisp/gnus-topic.el +++ b/lisp/gnus-topic.el @@ -61,7 +61,7 @@ with some simple extensions. %a Number of unread articles in the groups in the topic. %A Number of unread articles in the groups in the topic and its subtopics. -General format specifiers can also be used. +General format specifiers can also be used. See (gnus)Formatting Variables." :link '(custom-manual "(gnus)Formatting Variables") :type 'string @@ -1134,7 +1134,7 @@ articles in the topic and its subtopics." (setq gnus-group-change-level-function 'gnus-topic-change-level) (setq gnus-goto-missing-group-function 'gnus-topic-goto-missing-group) (make-local-hook 'gnus-check-bogus-groups-hook) - (add-hook 'gnus-check-bogus-groups-hook 'gnus-topic-clean-alist + (add-hook 'gnus-check-bogus-groups-hook 'gnus-topic-clean-alist nil 'local) (setq gnus-topology-checked-p nil) ;; We check the topology. diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index 099f14444..47708cdfb 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -1223,7 +1223,7 @@ forbidden in URL encoding." SPEC is a predicate specifier that contains stuff like `or', `and', `not', lists and functions. The functions all take one parameter." `(lambda (elem) ,(gnus-make-predicate-1 spec))) - + (defun gnus-make-predicate-1 (spec) (cond ((symbolp spec) diff --git a/lisp/gnus-win.el b/lisp/gnus-win.el index 9ac4c28ed..3a1472a89 100644 --- a/lisp/gnus-win.el +++ b/lisp/gnus-win.el @@ -557,7 +557,7 @@ should have point." (delq lowest-buf bufs))))) (eval-and-compile - (cond + (cond ((fboundp 'frames-on-display-list) (defalias 'gnus-frames-on-display-list 'frames-on-display-list)) ((and (featurep 'xemacs) (fboundp 'frame-device)) @@ -569,9 +569,9 @@ should have point." (defun gnus-get-buffer-window (buffer &optional frame) (cond ((and (null gnus-use-frames-on-any-display) (memq frame '(t 0 visible))) - (car + (car (let ((frames (gnus-frames-on-display-list))) - (gnus-delete-if (lambda (win) (not (memq (window-frame win) + (gnus-delete-if (lambda (win) (not (memq (window-frame win) frames))) (get-buffer-window-list buffer nil frame))))) (t diff --git a/lisp/gnus.el b/lisp/gnus.el index 23a34027a..9dfad4e66 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -2213,7 +2213,7 @@ possible. This restriction may disappear in later versions of Gnus. -General format specifiers can also be used. +General format specifiers can also be used. See (gnus)Formatting Variables." :link '(custom-manual "(gnus)Formatting Variables") :type 'string diff --git a/lisp/hex-util.el b/lisp/hex-util.el index ddf154d17..6936bf360 100644 --- a/lisp/hex-util.el +++ b/lisp/hex-util.el @@ -49,7 +49,7 @@ (aset dst idx (+ (* (hex-char-to-num (aref string pos)) 16) (hex-char-to-num (aref string (1+ pos))))) (setq idx (1+ idx) - pos (+ 2 pos))) + pos (+ 2 pos))) dst)) (defun encode-hex-string (string) @@ -65,7 +65,7 @@ ;;; (aset dst idx (num-to-hex-char (logand (aref string pos) 15))) (aset dst idx (num-to-hex-char (% (aref string pos) 16))) (setq idx (1+ idx) - pos (1+ pos))) + pos (1+ pos))) dst)) (provide 'hex-util) diff --git a/lisp/ietf-drums.el b/lisp/ietf-drums.el index 52d7b81c1..9c79e9112 100644 --- a/lisp/ietf-drums.el +++ b/lisp/ietf-drums.el @@ -221,7 +221,7 @@ ((eq c ?,) (setq address (condition-case nil - (ietf-drums-parse-address + (ietf-drums-parse-address (buffer-substring beg (point))) (error nil))) (if address (push address pairs)) @@ -231,7 +231,7 @@ (forward-char 1)))) (setq address (condition-case nil - (ietf-drums-parse-address + (ietf-drums-parse-address (buffer-substring beg (point))) (error nil))) (if address (push address pairs)) diff --git a/lisp/imap.el b/lisp/imap.el index 48106fd9b..786c1631b 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -766,7 +766,7 @@ Returns t if login was successful, nil otherwise." (while (or (not user) (not passwd)) (setq user (or imap-username (read-from-minibuffer - (concat "IMAP username for " imap-server + (concat "IMAP username for " imap-server " (using stream `" (symbol-name imap-stream) "'): ") (or user imap-default-user)))) @@ -964,8 +964,8 @@ necessery. If nil, the buffer name is generated." (imap-open-1 (current-buffer)))) (progn (kill-buffer (current-buffer)) - (message - "imap: Reconnecting with stream `%s'...failed" + (message + "imap: Reconnecting with stream `%s'...failed" stream)) ;; We're done, kill the first connection (imap-close buffer) @@ -983,7 +983,7 @@ necessery. If nil, the buffer name is generated." (setq streams nil)))))) (when (imap-opened buffer) (setq imap-mailbox-data (make-vector imap-mailbox-prime 0))) - (when imap-stream + (when imap-stream buffer)))) (defun imap-opened (&optional buffer) @@ -1012,7 +1012,7 @@ password is remembered in the buffer." (if user (setq imap-username user)) (if passwd (setq imap-password passwd)) (if imap-auth - (and (funcall (nth 2 (assq imap-auth + (and (funcall (nth 2 (assq imap-auth imap-authenticator-alist)) buffer) (setq imap-state 'auth)) ;; Choose authenticator. @@ -1955,7 +1955,7 @@ Return nil if no complete line has arrived." ;; resp-cond-bye = "BYE" SP resp-text ;; ;; mailbox-data = "FLAGS" SP flag-list / -;; "LIST" SP mailbox-list / +;; "LIST" SP mailbox-list / ;; "LSUB" SP mailbox-list / ;; "SEARCH" *(SP nz-number) / ;; "STATUS" SP mailbox SP "(" @@ -2060,7 +2060,7 @@ Return nil if no complete line has arrived." ;; [flag-perm *(SP flag-perm)] ")" / ;; "READ-ONLY" / ;; "READ-WRITE" / -;; "TRYCREATE" / +;; "TRYCREATE" / ;; "UIDNEXT" SP nz-number / ;; "UIDVALIDITY" SP nz-number / ;; "UNSEEN" SP nz-number / diff --git a/lisp/mail-source.el b/lisp/mail-source.el index 54cefbe92..35a03c967 100644 --- a/lisp/mail-source.el +++ b/lisp/mail-source.el @@ -593,7 +593,7 @@ If ARGS, PROMPT is used as an argument to `format'." (defun mail-source-fetch-with-program (program) (zerop (call-process shell-file-name nil nil nil - shell-command-switch program))) + shell-command-switch program))) (defun mail-source-run-script (script spec &optional delay) (when script @@ -862,13 +862,13 @@ This only works when `display-time' is enabled." (with-temp-file mail-source-crash-box (insert-file-contents file) (goto-char (point-min)) -;;; ;; Unix mail format -;;; (unless (looking-at "\n*From ") -;;; (insert "From maildir " -;;; (current-time-string) "\n")) -;;; (while (re-search-forward "^From " nil t) -;;; (replace-match ">From ")) -;;; (goto-char (point-max)) +;;; ;; Unix mail format +;;; (unless (looking-at "\n*From ") +;;; (insert "From maildir " +;;; (current-time-string) "\n")) +;;; (while (re-search-forward "^From " nil t) +;;; (replace-match ">From ")) +;;; (goto-char (point-max)) ;;; (insert "\n\n") ;; MMDF mail format (insert "\001\001\001\001\n")) diff --git a/lisp/mailcap.el b/lisp/mailcap.el index c5795b154..1762ed2cb 100644 --- a/lisp/mailcap.el +++ b/lisp/mailcap.el @@ -640,18 +640,18 @@ to supply to the test." (setq mailcap-mime-data (cons (cons major (list (cons minor info))) mailcap-mime-data)) - (let ((cur-minor (assoc minor old-major))) - (cond - ((or (null cur-minor) ; New minor area, or - (assq 'test info)) ; Has a test, insert at beginning - (setcdr old-major (cons (cons minor info) (cdr old-major)))) - ((and (not (assq 'test info)) ; No test info, replace completely - (not (assq 'test cur-minor)) + (let ((cur-minor (assoc minor old-major))) + (cond + ((or (null cur-minor) ; New minor area, or + (assq 'test info)) ; Has a test, insert at beginning + (setcdr old-major (cons (cons minor info) (cdr old-major)))) + ((and (not (assq 'test info)) ; No test info, replace completely + (not (assq 'test cur-minor)) (equal (assq 'viewer info) ; Keep alternative viewer (assq 'viewer cur-minor))) - (setcdr cur-minor info)) - (t - (setcdr old-major (cons (cons minor info) (cdr old-major)))))) + (setcdr cur-minor info)) + (t + (setcdr old-major (cons (cons minor info) (cdr old-major)))))) ))) (defun mailcap-add (type viewer &optional test) diff --git a/lisp/message-utils.el b/lisp/message-utils.el index c782aad44..8b8d45520 100644 --- a/lisp/message-utils.el +++ b/lisp/message-utils.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2002 Free Software Foundation, Inc. ;; Author: Holger Schauer -;; Keywords: utils message +;; Keywords: utils message ;; This file is part of GNU Emacs. @@ -25,7 +25,7 @@ ;;; Commentary: ;; This file contains some small additions to message mode: -;; * inserting files in a message and explicit marking it +;; * inserting files in a message and explicit marking it ;; as something somebody else has created, ;; * change Subject: header and add (was: ) ;; * strip (was: ) from Subject: headers @@ -49,7 +49,7 @@ ;; (autoload 'message-reduce-to-to-cc "message-utils" nil t) ;; as well as some keybindings like ;; (define-key message-mode-map '[(control c) m] 'message-mark-inserted-region) -;; (define-key message-mode-map '[(control c) f] 'message-mark-insert-file) +;; (define-key message-mode-map '[(control c) f] 'message-mark-insert-file) ;; (define-key message-mode-map '[(control c) x] 'message-xpost-fup2) ;; (define-key message-mode-map '[(control c) s] 'message-change-subject) ;; (define-key message-mode-map '[(control c) a] 'message-add-archive-header) @@ -63,13 +63,13 @@ ;; ["Insert Region Marked" message-mark-inserted-region t] "Spellcheck") ;; (easy-menu-add-item nil '("Message") ;; ["Insert File Marked" message-mark-insert-file t] "Spellcheck") -;; (easy-menu-add-item nil '("Field") +;; (easy-menu-add-item nil '("Field") ;; ["Crosspost / Followup" message-xpost-fup2 t] "----") ;; (easy-menu-add-item nil '("Field") ;; ["New Subject" message-change-subject t] "----") ;; (easy-menu-add-item nil '("Field") ;; ["Reduce To: to Cc:" message-reduce-to-to-cc t] "----") -;; (easy-menu-add-item nil '("Field") +;; (easy-menu-add-item nil '("Field") ;; [ "X-No-Archive:" message-add-archive-header t ])) ;; (add-hook 'message-mode-hook 'message-utils-setup) @@ -122,12 +122,12 @@ See `message-begin-inserted-text-mark' and `message-end-inserted-text-mark'." ;;; ************** ;;; Subject mangling -(defcustom message-subject-was-regexp +(defcustom message-subject-was-regexp "[ \t]*\\((*[Ww][Aa][SsRr]:[ \t]*.*)\\)" "*Regexp matching \"(was: )\" in the subject line." :group 'message-various :type 'regexp) - + ;;;###autoload (defun message-strip-subject-was () "Remove trailing \"(Was: )\" from subject lines." @@ -139,7 +139,7 @@ See `message-begin-inserted-text-mark' and `message-end-inserted-text-mark'." (cond ((> pos 0) (message-goto-subject) (message-delete-line) - (insert (concat "Subject: " + (insert (concat "Subject: " (substring subject 0 pos) "\n"))))))) (widen)) @@ -148,24 +148,24 @@ See `message-begin-inserted-text-mark' and `message-end-inserted-text-mark'." (defun message-change-subject (new-subject) "Ask for new Subject: header, append (was: )." (interactive - (list + (list (read-from-minibuffer "New subject: "))) (cond ((and (not (or (null new-subject) ; new subject not empty (zerop (string-width new-subject)) (string-match "^[ \t]*$" new-subject)))) (save-excursion (let ((old-subject (message-fetch-field "Subject"))) - (cond ((not (string-match - (concat "^[ \t]*" - (regexp-quote new-subject) + (cond ((not (string-match + (concat "^[ \t]*" + (regexp-quote new-subject) " \t]*$") old-subject)) ; yes, it really is a new subject ;; delete eventual Re: prefix - (setq old-subject + (setq old-subject (message-strip-subject-re old-subject)) (message-goto-subject) (message-delete-line) - (insert (concat "Subject: " + (insert (concat "Subject: " new-subject " (was: " old-subject ")\n"))))))))) @@ -201,7 +201,7 @@ When called with a prefix argument, ask for a text to insert." (message-sort-headers))) ;;; ************** -;;; Crossposts and Followups +;;; Crossposts and Followups ; inspired by JoH-followup-to by Jochem Huhman ; new suggestions by R. Weikusat @@ -226,7 +226,7 @@ With prefix-argument just set Follow-Up, don't cross-post." (completing-read "Follwup To: " (if (boundp 'gnus-newsrc-alist) gnus-newsrc-alist) - nil nil '("poster" . 0) + nil nil '("poster" . 0) (if (boundp 'gnus-group-history) 'gnus-group-history)))) (message-remove-header "Follow[Uu]p-[Tt]o" t) @@ -234,7 +234,7 @@ With prefix-argument just set Follow-Up, don't cross-post." (beginning-of-line) ;; if we already did a crosspost before, kill old target (if (and message-xpost-old-target - (re-search-forward + (re-search-forward (regexp-quote (concat "," message-xpost-old-target)) nil t)) (replace-match "")) @@ -244,15 +244,15 @@ With prefix-argument just set Follow-Up, don't cross-post." (cond ((and (or (and message-xpost-default (not current-prefix-arg)) ; def: xpost, req:no (and (not message-xpost-default) current-prefix-arg)) ; def: no-xpost, req:yes (not (string-match "poster" target-group)) - (not (string-match (regexp-quote target-group) + (not (string-match (regexp-quote target-group) (message-fetch-field "Newsgroups")))) (end-of-line) (insert-string (concat "," target-group)))) (end-of-line) ; ensure Followup: comes after Newsgroups: ;; unless new followup would be identical to Newsgroups line ;; make a new Followup-To line - (if (not (string-match (concat "^[ \t]*" - target-group + (if (not (string-match (concat "^[ \t]*" + target-group "[ \t]*$") (message-fetch-field "Newsgroups"))) (insert (concat "\nFollowup-To: " target-group))) @@ -280,16 +280,16 @@ OLD-GROUPS. OLD-GROUPS lists the old-groups the posting would have been made to before the user asked for a Crosspost." ;; start scanning body for previous uses (message-goto-signature) - (let ((head (re-search-backward - (concat "^" mail-header-separator) + (let ((head (re-search-backward + (concat "^" mail-header-separator) nil t))) ; just search in body (message-goto-signature) - (while (re-search-backward + (while (re-search-backward (concat "^" (regexp-quote message-xpost-note) ".*") head t) (message-delete-line)) (message-goto-signature) - (while (re-search-backward + (while (re-search-backward (concat "^" (regexp-quote message-fup2-note) ".*") head t) (message-delete-line)) @@ -306,8 +306,8 @@ been made to before the user asked for a Crosspost." (defcustom message-xpost-note-function 'message-xpost-insert-note "Function to use to insert note about Crosspost or Followup-To. -The function will be called with four arguments. The function should not -only insert a note, but also ensure old notes are deleted. See the +The function will be called with four arguments. The function should not +only insert a note, but also ensure old notes are deleted. See the documentation for `message-xpost-insert-note'. " :type 'function :group 'message-various) @@ -321,7 +321,7 @@ With prefix-argument just set Follow-Up, don't cross-post." (completing-read "Follwup To: " (if (boundp 'gnus-newsrc-alist) gnus-newsrc-alist) - nil nil '("poster" . 0) + nil nil '("poster" . 0) (if (boundp 'gnus-group-history) 'gnus-group-history)))) (cond ((not (or (null target-group) ; new subject not empty @@ -329,11 +329,11 @@ With prefix-argument just set Follow-Up, don't cross-post." (string-match "^[ \t]*$" target-group))) (save-excursion (let* ((old-groups (message-fetch-field "Newsgroups")) - (in-old (string-match + (in-old (string-match (regexp-quote target-group) old-groups))) ;; check whether target exactly matches old Newsgroups - (cond ((or (not in-old) - (not (string-match + (cond ((or (not in-old) + (not (string-match (concat "^[ \t]*" (regexp-quote target-group) "[ \t]*$") @@ -342,7 +342,7 @@ With prefix-argument just set Follow-Up, don't cross-post." (message-xpost-fup2-header target-group) ;; insert note whether we do xpost or fup2 (funcall message-xpost-note-function - target-group + target-group (if (or (and message-xpost-default (not current-prefix-arg)) (and (not message-xpost-default) current-prefix-arg)) t) @@ -365,10 +365,10 @@ With prefix-argument just set Follow-Up, don't cross-post." (message-goto-to) (message-delete-line) (insert (concat "To: " cc-content "\n")) - (message-remove-header (if bcc + (message-remove-header (if bcc "bcc" "cc"))))))) - + ;;; provide ourself (provide 'message-utils) diff --git a/lisp/message.el b/lisp/message.el index 21df60244..677821e61 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -361,7 +361,7 @@ The provided functions are: (set-syntax-table old-table) (if (equal non-word-constituents "") "\\([ \t]*\\(\\w\\)+>+\\|[ \t]*[]>»|:}+]\\)+" - (concat "\\([ \t]*\\(\\w\\|[" + (concat "\\([ \t]*\\(\\w\\|[" non-word-constituents "]\\)+>+\\|[ \t]*[]>»|:}+]\\)+")))) "*Regexp matching the longest possible citation prefix on a line." @@ -1116,7 +1116,7 @@ no, only reply back to the author." ;; can be removed, e.g. ;; From: joe@y.z (Joe K ;; User) - ;; can yield `From joe@y.z (Joe K Fri Mar 22 08:11:15 1996', and + ;; can yield `From joe@y.z (Joe K Fri Mar 22 08:11:15 1996', and ;; From: Joe User ;; ;; can yield `From Joe User Fri Mar 22 08:11:15 1996'. @@ -1577,7 +1577,7 @@ Point is left at the beginning of the narrowed-to region." ;;(define-key message-mode-map "\M-q" 'message-fill-paragraph) (define-key message-mode-map "\C-c\C-a" 'mml-attach-file) - + (define-key message-mode-map "\C-a" 'message-beginning-of-line) (define-key message-mode-map "\t" 'message-tab) (define-key message-mode-map "\M-;" 'comment-region)) @@ -1602,7 +1602,7 @@ Point is left at the beginning of the narrowed-to region." ["Flag As Unimportant" message-insert-importance-low ,@(if (featurep 'xemacs) '(t) '(:help "Mark this message as unimportant"))] - ["Request Receipt" + ["Request Receipt" message-insert-disposition-notification-to ,@(if (featurep 'xemacs) '(t) '(:help "Request a Disposition Notification of this article"))] @@ -1653,7 +1653,7 @@ Point is left at the beginning of the narrowed-to region." ;; ;; We use `after-change-functions' to keep special text properties ;; that interfer with the normal function of message mode out of the -;; buffer. +;; buffer. (defcustom message-strip-special-text-properties t "Strip special properties from the message buffer. @@ -1667,13 +1667,13 @@ message composition doesn't break too bad." :group 'message-various :type 'boolean) -(defconst message-forbidden-properties +(defconst message-forbidden-properties ;; No reason this should be clutter up customize. We make it a ;; property list (rather than a list of property symbols), to be ;; directly useful for `remove-text-properties'. - '(field nil read-only nil intangible nil invisible nil + '(field nil read-only nil intangible nil invisible nil mouse-face nil modification-hooks nil insert-in-front-hooks nil - insert-behind-hooks nil point-entered nil point-left nil) + insert-behind-hooks nil point-entered nil point-left nil) ;; Other special properties: ;; category, face, display: probably doesn't do any harm. ;; fontified: is used by font-lock. @@ -1769,10 +1769,10 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." (easy-menu-add message-mode-menu message-mode-map) (easy-menu-add message-mode-field-menu message-mode-map) ;; make-local-hook is harmless though obsolete in Emacs 21. - ;; Emacs 20 and XEmacs need make-local-hook. + ;; Emacs 20 and XEmacs need make-local-hook. (make-local-hook 'after-change-functions) ;; Mmmm... Forbidden properties... - (add-hook 'after-change-functions 'message-strip-forbidden-properties + (add-hook 'after-change-functions 'message-strip-forbidden-properties nil 'local) ;; Allow mail alias things. (when (eq message-mail-alias-type 'abbrev) @@ -1939,7 +1939,7 @@ in the current mail buffer, and appends the current user-mail-address. If the optional argument `include-cc' is non-nil, the addresses in the Cc: header are also put into the MFT." - + (interactive) (message-remove-header "Mail-Followup-To") (let* ((cc (and include-cc (message-fetch-field "Cc"))) @@ -2376,8 +2376,8 @@ However, if `message-yank-prefix' is non-nil, insert that prefix on each line." (while (< (point) (mark t)) (if (or (looking-at ">") (looking-at "^$")) (insert message-yank-cited-prefix) - (insert message-yank-prefix)) - (forward-line 1)))) + (insert message-yank-prefix)) + (forward-line 1)))) (goto-char start))) (defun message-yank-original (&optional arg) @@ -3044,7 +3044,7 @@ Otherwise, generate and save a value for `canlock-password' first." ;; -- Per Abrahamsen 2001-10-08. (group-field-charset (gnus-group-name-charset method newsgroups-field)) - (followup-field-charset + (followup-field-charset (gnus-group-name-charset method (or followup-field ""))) (rfc2047-header-encoding-alist (append (when group-field-charset @@ -3264,7 +3264,7 @@ Otherwise, generate and save a value for `canlock-password' first." ;; KLUDGE to handle nnvirtual groups. Doing this right ;; would probably involve a new nnoo function. ;; -- Per Abrahamsen , 2001-10-17. - (method (if (and (consp post-method) + (method (if (and (consp post-method) (eq (car post-method) 'nnvirtual) gnus-message-group-art) (let ((group (car (nnvirtual-find-group-art @@ -3274,7 +3274,7 @@ Otherwise, generate and save a value for `canlock-password' first." post-method)) (known-groups (mapcar (lambda (n) - (gnus-group-name-decode + (gnus-group-name-decode (gnus-group-real-name n) (gnus-group-name-charset method n))) (gnus-groups-from-server method))) @@ -4385,9 +4385,9 @@ than 988 characters long, and if they are not, trim them until they are." (setq message-draft-article (nndraft-request-associate-buffer "drafts")) (setq buffer-file-name (expand-file-name - (if (memq system-type - '(ms-dos ms-windows windows-nt - cygwin32 win32 w32 + (if (memq system-type + '(ms-dos ms-windows windows-nt + cygwin32 win32 w32 mswindows)) "message" "*message*") @@ -5061,7 +5061,7 @@ Optional DIGEST will use digest to forward." "Let RMAIL uses message to forward." (interactive) (setq rmail-enable-mime-composing t) - (setq rmail-insert-mime-forwarded-message-function + (setq rmail-insert-mime-forwarded-message-function 'message-forward-rmail-make-body)) ;;;###autoload diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 2949b1c6d..2caef4a60 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -662,11 +662,11 @@ external if displayed external." (mm-insert-part handle) (let* ((dir (make-temp-name (expand-file-name "emm." mm-tmp-directory))) - (filename (or + (filename (or (mail-content-type-get (mm-handle-disposition handle) 'filename) - (mail-content-type-get - (mm-handle-type handle) 'name))) + (mail-content-type-get + (mm-handle-type handle) 'name))) (mime-info (mailcap-mime-info (mm-handle-media-type handle) t)) (needsterm (or (assoc "needsterm" mime-info) @@ -1145,7 +1145,7 @@ be determined." ;; Avoid testing `make-glyph' since W3 may define ;; a bogus version of it. (if (fboundp 'create-image) - (create-image (buffer-string) + (create-image (buffer-string) (or (mm-image-type-from-buffer) (intern type)) 'data-p) @@ -1171,11 +1171,11 @@ be determined." (delete-file file))))) (t (make-glyph - (vector + (vector (or (mm-image-type-from-buffer) (intern type)) :data (buffer-string)))))) - + (defun mm-image-fit-p (handle) "Say whether the image in HANDLE will fit the current window." (let ((image (mm-get-image handle))) diff --git a/lisp/mm-partial.el b/lisp/mm-partial.el index 55bc4cf56..b24bfda7e 100644 --- a/lisp/mm-partial.el +++ b/lisp/mm-partial.el @@ -42,7 +42,7 @@ (gnus-request-article-this-buffer (aref header 0) gnus-newsgroup-name) (when (search-forward id nil t) - (let ((nhandles (mm-dissect-buffer + (let ((nhandles (mm-dissect-buffer nil gnus-article-loose-mime)) nid) (if (consp (car nhandles)) (mm-destroy-parts nhandles) diff --git a/lisp/mm-url.el b/lisp/mm-url.el index 9c9d8c712..3e140ec6b 100644 --- a/lisp/mm-url.el +++ b/lisp/mm-url.el @@ -54,7 +54,7 @@ (lynx "lynx" "-source") (curl "curl"))) -(defcustom mm-url-program +(defcustom mm-url-program (cond ((executable-find "wget") 'wget) ((executable-find "w3m") 'w3m) @@ -62,7 +62,7 @@ ((executable-find "curl") 'curl) (t "GET")) "The url grab program." - :type '(choice + :type '(choice (symbol :tag "wget" wget) (symbol :tag "w3m" w3m) (symbol :tag "lynx" lynx) diff --git a/lisp/mm-util.el b/lisp/mm-util.el index 8738f6a3f..24635b875 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -121,7 +121,7 @@ '((iso-8859-15 . iso-8859-1))) ;; Windows-1252 is actually a superset of Latin-1. See also ;; `gnus-article-dumbquotes-map'. - ,@(unless (mm-coding-system-p 'windows-1252) + ,@(unless (mm-coding-system-p 'windows-1252) (if (mm-coding-system-p 'cp1252) '((windows-1252 . cp1252)) '((windows-1252 . iso-8859-1)))) @@ -245,7 +245,7 @@ Valid elements include: `iso-2022-jp-2' convert ISO-2022-jp to ISO-2022-jp-2 if ISO-2022-jp-2 exists." ) -(defvar mm-iso-8859-15-compatible +(defvar mm-iso-8859-15-compatible '((iso-8859-1 "\xA4\xA6\xA8\xB4\xB8\xBC\xBD\xBE") (iso-8859-9 "\xA4\xA6\xA8\xB4\xB8\xBC\xBD\xBE\xD0\xDD\xDE\xF0\xFD\xFE")) "ISO-8859-15 exchangeable coding systems and inconvertible characters.") @@ -253,16 +253,16 @@ Valid elements include: (defvar mm-iso-8859-x-to-15-table (and (fboundp 'coding-system-p) (mm-coding-system-p 'iso-8859-15) - (mapcar + (mapcar (lambda (cs) (if (mm-coding-system-p (car cs)) - (let ((c (string-to-char + (let ((c (string-to-char (decode-coding-string "\341" (car cs))))) (cons (char-charset c) (cons - (- (string-to-char + (- (string-to-char (decode-coding-string "\341" 'iso-8859-15)) c) - (string-to-list (decode-coding-string (car (cdr cs)) + (string-to-list (decode-coding-string (car (cdr cs)) (car cs)))))) '(gnus-charset 0))) mm-iso-8859-15-compatible)) @@ -361,7 +361,7 @@ used as the line break code type of the coding system." default-enable-multibyte-characters (fboundp 'set-buffer-multibyte)) "Emacs mule.") - + (defvar mm-mule4-p (and mm-emacs-mule (fboundp 'charsetp) (not (charsetp 'eight-bit-control))) @@ -388,7 +388,7 @@ This is a no-op in XEmacs." Only used in Emacs Mule 4." (set-buffer-multibyte t)) (defalias 'mm-enable-multibyte-mule4 'ignore)) - + (if mm-mule4-p (defun mm-disable-multibyte-mule4 () "Disable multibyte in the current buffer. @@ -481,15 +481,15 @@ If the charset is `composition', return the actual one." (goto-char (point-min)) (skip-chars-forward "\0-\177") (while (not (eobp)) - (cond - ((not (setq item (assq (char-charset (setq c (char-after))) + (cond + ((not (setq item (assq (char-charset (setq c (char-after))) mm-iso-8859-x-to-15-table))) (forward-char)) ((memq c (cdr (cdr item))) (setq inconvertible t) (forward-char)) (t - (insert-before-markers (prog1 (+ c (car (cdr item))) + (insert-before-markers (prog1 (+ c (car (cdr item))) (delete-char 1)))) (skip-chars-forward "\0-\177")))) (not inconvertible)))) @@ -510,7 +510,7 @@ charset, and a longer list means no appropriate charset." ;; system that has one. (let ((systems (find-coding-systems-region b e))) (when mm-coding-system-priorities - (setq systems + (setq systems (sort systems 'mm-sort-coding-systems-predicate))) ;; Fixme: The `mime-charset' (`x-ctext') of `compound-text' ;; is not in the IANA list. @@ -524,7 +524,7 @@ charset, and a longer list means no appropriate charset." charsets)) ;; Otherwise we're not multibyte, XEmacs or a single coding ;; system won't cover it. - (setq charsets + (setq charsets (mm-delete-duplicates (mapcar 'mm-mime-charset (delq 'ascii @@ -553,8 +553,8 @@ Also bind `default-enable-multibyte-characters' to nil. Equivalent to `progn' in XEmacs" (let ((multibyte (make-symbol "multibyte")) (buffer (make-symbol "buffer"))) - `(if mm-emacs-mule - (let ((,multibyte enable-multibyte-characters) + `(if mm-emacs-mule + (let ((,multibyte enable-multibyte-characters) (,buffer (current-buffer))) (unwind-protect (let (default-enable-multibyte-characters) @@ -573,7 +573,7 @@ Mule4 only." (let ((multibyte (make-symbol "multibyte")) (buffer (make-symbol "buffer"))) `(if mm-mule4-p - (let ((,multibyte enable-multibyte-characters) + (let ((,multibyte enable-multibyte-characters) (,buffer (current-buffer))) (unwind-protect (let (default-enable-multibyte-characters) diff --git a/lisp/mm-view.el b/lisp/mm-view.el index d6d9d6c12..e2c732ed9 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -40,7 +40,7 @@ (defvar mm-text-html-renderer-alist '((w3 . mm-inline-text-html-render-with-w3) (w3m . mm-inline-text-html-render-with-w3m) - (links mm-inline-render-with-file + (links mm-inline-render-with-file mm-links-remove-leading-blank "links" "-dump" file) (lynx mm-inline-render-with-stdin nil @@ -50,7 +50,7 @@ (defvar mm-text-html-washer-alist '((w3 . gnus-article-wash-html-with-w3) (w3m . gnus-article-wash-html-with-w3m) - (links mm-inline-wash-with-file + (links mm-inline-wash-with-file mm-links-remove-leading-blank "links" "-dump" file) (lynx mm-inline-wash-with-stdin nil @@ -108,7 +108,7 @@ (let ((text (mm-get-part handle)) (b (point)) (url-standalone-mode t) - (url-gateway-unplugged t) + (url-gateway-unplugged t) (w3-honor-stylesheets nil) (url-current-object (url-generic-parse-url (format "cid:%s" (mm-handle-id handle)))) @@ -308,7 +308,7 @@ will not be substituted.") (delete-region (match-beginning 0) (match-end 0)))) (defun mm-inline-wash-with-file (post-func cmd &rest args) - (let ((file (make-temp-name + (let ((file (make-temp-name (expand-file-name "mm" mm-tmp-directory)))) (let ((coding-system-for-write 'binary)) (write-region (point-min) (point-max) file nil 'silent)) @@ -335,8 +335,8 @@ will not be substituted.") (defun mm-inline-render-with-stdin (handle post-func cmd &rest args) (let ((source (mm-get-part handle))) - (mm-insert-inline - handle + (mm-insert-inline + handle (mm-with-unibyte-buffer (insert source) (apply 'mm-inline-wash-with-stdin post-func cmd args) @@ -344,8 +344,8 @@ will not be substituted.") (defun mm-inline-render-with-function (handle func &rest args) (let ((source (mm-get-part handle))) - (mm-insert-inline - handle + (mm-insert-inline + handle (mm-with-unibyte-buffer (insert source) (apply func args) @@ -431,7 +431,7 @@ will not be substituted.") (defun mm-w3-prepare-buffer () (require 'w3) (let ((url-standalone-mode t) - (url-gateway-unplugged t) + (url-gateway-unplugged t) (w3-honor-stylesheets nil)) (w3-prepare-buffer))) @@ -544,7 +544,7 @@ will not be substituted.") ?\x7c ?\x82 ?\x2e ?\x2e ?\x5c ?\x7c ?\x83 ?\x2e ?\x2e ?\x2e ?\x5c ?\x29 ?\x06 ?\x09 ?\x5c ?\x2a ?\x86 ?\x48 ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x02))))) - + ;; id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) ;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 } (defvar mm-pkcs7-enveloped-magic @@ -555,7 +555,7 @@ will not be substituted.") ?\x7c ?\x82 ?\x2e ?\x2e ?\x5c ?\x7c ?\x83 ?\x2e ?\x2e ?\x2e ?\x5c ?\x29 ?\x06 ?\x09 ?\x5c ?\x2a ?\x86 ?\x48 ?\x86 ?\xf7 ?\x0d ?\x01 ?\x07 ?\x03))))) - + (defun mm-view-pkcs7-get-type (handle) (mm-with-unibyte-buffer (mm-insert-part handle) diff --git a/lisp/mml.el b/lisp/mml.el index bd746102d..7f036ac1e 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -65,7 +65,7 @@ NAME is a string containing the name of the TWEAK parameter in the MML handle. FUNCTION is a Lisp function which is called with the MML handle to tweak the part.") -(defvar mml-tweak-sexp-alist +(defvar mml-tweak-sexp-alist '((mml-externalize-attachments . mml-tweak-externalize-attachments)) "A list of (SEXP . FUNCTION) for tweaking MML parts. SEXP is a s-expression. If the evaluation of SEXP is non-nil, FUNCTION @@ -191,7 +191,7 @@ one charsets.") (list (intern (downcase (cdr (assq 'charset tag)))))) (t - (mm-find-mime-charset-region point (point) + (mm-find-mime-charset-region point (point) mm-hack-charsets)))) (when (and (not raw) (memq nil charsets)) (if (or (memq 'unknown-encoding mml-confirmation-set) @@ -1046,7 +1046,7 @@ If RAW, don't highlight the article." (defun mml-tweak-externalize-attachments (cont) "Tweak attached files as external parts." (let (filename-cons) - (when (and (eq (car cont) 'part) + (when (and (eq (car cont) 'part) (not (cdr (assq 'buffer cont))) (and (setq filename-cons (assq 'filename cont)) (not (equal (cdr (assq 'nofile cont)) "yes")))) diff --git a/lisp/mml1991.el b/lisp/mml1991.el index ef13ffcbd..a449e5ccc 100644 --- a/lisp/mml1991.el +++ b/lisp/mml1991.el @@ -24,7 +24,7 @@ ;;; Commentary: -;; RCS: $Id: mml1991.el,v 6.4 2001/12/18 06:26:40 zsh Exp $ +;; RCS: $Id: mml1991.el,v 6.5 2001/12/18 16:14:19 huber Exp $ ;;; Code: @@ -48,15 +48,15 @@ (defun mml1991-mailcrypt-sign (cont) (let ((text (current-buffer)) - headers signature - (result-buffer (get-buffer-create "*GPG Result*"))) + headers signature + (result-buffer (get-buffer-create "*GPG Result*"))) ;; Save MIME Content[^ ]+: headers from signing (goto-char (point-min)) (while (looking-at "^Content[^ ]+:") (forward-line)) (if (> (point) (point-min)) - (progn - (setq headers (buffer-substring (point-min) (point))) - (kill-region (point-min) (point)))) + (progn + (setq headers (buffer-substring (point-min) (point))) + (kill-region (point-min) (point)))) (goto-char (point-max)) (unless (bolp) (insert "\n")) @@ -83,13 +83,13 @@ (defun mml1991-mailcrypt-encrypt (cont) (let ((text (current-buffer)) cipher - (result-buffer (get-buffer-create "*GPG Result*"))) + (result-buffer (get-buffer-create "*GPG Result*"))) ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED (goto-char (point-min)) (while (looking-at "^Content[^ ]+:") (forward-line)) (if (> (point) (point-min)) - (progn - (kill-region (point-min) (point)))) + (progn + (kill-region (point-min) (point)))) (mm-with-unibyte-current-buffer-mule4 (with-temp-buffer (setq cipher (current-buffer)) @@ -110,10 +110,10 @@ (while (re-search-forward "\r+$" nil t) (replace-match "" t t)) (set-buffer text) - (kill-region (point-min) (point-max)) + (kill-region (point-min) (point-max)) ;;(insert "Content-Type: application/pgp-encrypted\n\n") ;;(insert "Version: 1\n\n") - (insert "\n") + (insert "\n") (insert-buffer cipher) (goto-char (point-max)))))) @@ -124,24 +124,24 @@ (defun mml1991-gpg-sign (cont) (let ((text (current-buffer)) - headers signature - (result-buffer (get-buffer-create "*GPG Result*"))) + headers signature + (result-buffer (get-buffer-create "*GPG Result*"))) ;; Save MIME Content[^ ]+: headers from signing (goto-char (point-min)) (while (looking-at "^Content[^ ]+:") (forward-line)) (if (> (point) (point-min)) - (progn - (setq headers (buffer-substring (point-min) (point))) - (kill-region (point-min) (point)))) + (progn + (setq headers (buffer-substring (point-min) (point))) + (kill-region (point-min) (point)))) (goto-char (point-max)) (unless (bolp) (insert "\n")) (quoted-printable-decode-region (point-min) (point-max)) (with-temp-buffer (unless (gpg-sign-cleartext text (setq signature (current-buffer)) - result-buffer - nil - (message-options-get 'message-sender)) + result-buffer + nil + (message-options-get 'message-sender)) (unless (> (point-max) (point-min)) (pop-to-buffer result-buffer) (error "Sign error"))) @@ -159,13 +159,13 @@ (defun mml1991-gpg-encrypt (cont) (let ((text (current-buffer)) cipher - (result-buffer (get-buffer-create "*GPG Result*"))) + (result-buffer (get-buffer-create "*GPG Result*"))) ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED (goto-char (point-min)) (while (looking-at "^Content[^ ]+:") (forward-line)) (if (> (point) (point-min)) - (progn - (kill-region (point-min) (point)))) + (progn + (kill-region (point-min) (point)))) (mm-with-unibyte-current-buffer-mule4 (with-temp-buffer (unless (gpg-sign-encrypt @@ -187,10 +187,10 @@ (while (re-search-forward "\r+$" nil t) (replace-match "" t t)) (set-buffer text) - (kill-region (point-min) (point-max)) + (kill-region (point-min) (point-max)) ;;(insert "Content-Type: application/pgp-encrypted\n\n") ;;(insert "Version: 1\n\n") - (insert "\n") + (insert "\n") (insert-buffer cipher) (goto-char (point-max)))))) diff --git a/lisp/mml2015.el b/lisp/mml2015.el index 79cc9ca3e..5e3fa2d05 100644 --- a/lisp/mml2015.el +++ b/lisp/mml2015.el @@ -394,9 +394,9 @@ by you.") (defun mml2015-gpg-pretty-print-fpr (fingerprint) (let* ((result "") - (fpr-length (string-width fingerprint)) - (n-slice 0) - slice) + (fpr-length (string-width fingerprint)) + (n-slice 0) + slice) (setq fingerprint (string-to-list fingerprint)) (while fingerprint (setq fpr-length (- fpr-length 4)) @@ -404,13 +404,13 @@ by you.") (setq fingerprint (nthcdr 4 fingerprint)) (setq n-slice (1+ n-slice)) (setq result - (concat - result - (case n-slice - (1 slice) - (otherwise (concat " " slice)))))) + (concat + result + (case n-slice + (1 slice) + (otherwise (concat " " slice)))))) result)) - + (defun mml2015-gpg-extract-signature-details () (goto-char (point-min)) (if (boundp 'gpg-unabbrev-trust-alist) @@ -418,15 +418,17 @@ by you.") "^\\[GNUPG:\\] GOODSIG [0-9A-Za-z]* \\(.*\\)$" nil t) (match-string 1))) - (fprint (and (re-search-forward - "^\\[GNUPG:\\] VALIDSIG \\([0-9a-zA-Z]*\\) " - nil t) - (match-string 1))) - (trust (and (re-search-forward "^\\[GNUPG:\\] \\(TRUST_.*\\)$" nil t) - (match-string 1))) - (trust-good-enough-p - (cdr (assoc (cdr (assoc trust gpg-unabbrev-trust-alist)) - mml2015-trust-boundaries-alist)))) + (fprint (and (re-search-forward + "^\\[GNUPG:\\] VALIDSIG \\([0-9a-zA-Z]*\\) " + nil t) + (match-string 1))) + (trust (and (re-search-forward + "^\\[GNUPG:\\] \\(TRUST_.*\\)$" + nil t) + (match-string 1))) + (trust-good-enough-p + (cdr (assoc (cdr (assoc trust gpg-unabbrev-trust-alist)) + mml2015-trust-boundaries-alist)))) (if (and signer trust fprint) (concat signer (unless trust-good-enough-p @@ -479,20 +481,20 @@ by you.") (error (mm-set-handle-multipart-parameter mm-security-handle 'gnus-details (mml2015-format-error err)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Error.") - (setq info-is-set-p t) + (mm-set-handle-multipart-parameter + mm-security-handle 'gnus-info "Error.") + (setq info-is-set-p t) nil) (quit (mm-set-handle-multipart-parameter mm-security-handle 'gnus-details "Quit.") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Quit.") - (setq info-is-set-p t) + (mm-set-handle-multipart-parameter + mm-security-handle 'gnus-info "Quit.") + (setq info-is-set-p t) nil)) - (unless info-is-set-p - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed")) + (unless info-is-set-p + (mm-set-handle-multipart-parameter + mm-security-handle 'gnus-info "Failed")) (throw 'error handle))) (mm-set-handle-multipart-parameter mm-security-handle 'gnus-info diff --git a/lisp/nnagent.el b/lisp/nnagent.el index a65bbfdb9..c97a78448 100644 --- a/lisp/nnagent.el +++ b/lisp/nnagent.el @@ -133,7 +133,7 @@ arts n) (save-excursion (gnus-agent-load-alist group) - (setq arts (gnus-sorted-difference + (setq arts (gnus-sorted-difference articles (mapcar 'car gnus-agent-article-alist))) (set-buffer nntp-server-buffer) (erase-buffer) @@ -145,7 +145,7 @@ (when (> n (car arts)) (beginning-of-line)) (while (and arts (> n (car arts))) - (insert (format + (insert (format "%d\t[Undownloaded article %d]\tGnus Agent\t\t\t\n" (car arts) (car arts))) (pop arts)) diff --git a/lisp/nnbabyl.el b/lisp/nnbabyl.el index b9acfe641..e4dbed268 100644 --- a/lisp/nnbabyl.el +++ b/lisp/nnbabyl.el @@ -4,7 +4,7 @@ ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen -;; Masanobu UMEDA +;; Masanobu UMEDA ;; Keywords: news, mail ;; This file is part of GNU Emacs. diff --git a/lisp/nndoc.el b/lisp/nndoc.el index cedeb230b..843dabf89 100644 --- a/lisp/nndoc.el +++ b/lisp/nndoc.el @@ -3,7 +3,7 @@ ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen -;; Masanobu UMEDA +;; Masanobu UMEDA ;; Keywords: news ;; This file is part of GNU Emacs. @@ -234,7 +234,7 @@ from the document.") (set-buffer buffer) (erase-buffer) (when entry - (cond + (cond ((stringp article) nil) (nndoc-generate-article-function (funcall nndoc-generate-article-function article)) @@ -607,25 +607,25 @@ from the document.") (defun nndoc-generate-lanl-gov-head (article) (let ((entry (cdr (assq article nndoc-dissection-alist))) - (e-mail "no address given") - subject from) + (e-mail "no address given") + subject from) (save-excursion (set-buffer nndoc-current-buffer) (save-restriction - (narrow-to-region (car entry) (nth 1 entry)) - (goto-char (point-min)) - (when (looking-at "^Paper.*: \\([a-z-]+/[0-9]+\\)") - (setq subject (concat " (" (match-string 1) ")")) - (when (re-search-forward "^From: \\([^ ]+\\)" nil t) - (setq e-mail (match-string 1))) - (when (re-search-forward "^Title: \\([^\f]*\\)\nAuthors?: \\(.*\\)" - nil t) - (setq subject (concat (match-string 1) subject)) - (setq from (concat (match-string 2) " <" e-mail ">")))))) + (narrow-to-region (car entry) (nth 1 entry)) + (goto-char (point-min)) + (when (looking-at "^Paper.*: \\([a-z-]+/[0-9]+\\)") + (setq subject (concat " (" (match-string 1) ")")) + (when (re-search-forward "^From: \\([^ ]+\\)" nil t) + (setq e-mail (match-string 1))) + (when (re-search-forward "^Title: \\([^\f]*\\)\nAuthors?: \\(.*\\)" + nil t) + (setq subject (concat (match-string 1) subject)) + (setq from (concat (match-string 2) " <" e-mail ">")))))) (while (and from (string-match "(\[^)\]*)" from)) (setq from (replace-match "" t t from))) (insert "From: " (or from "unknown") - "\nSubject: " (or subject "(no subject)") "\n"))) + "\nSubject: " (or subject "(no subject)") "\n"))) (defun nndoc-nsmail-type-p () (when (looking-at "From - ") diff --git a/lisp/nneething.el b/lisp/nneething.el index 8b1961f6e..bf9e1c605 100644 --- a/lisp/nneething.el +++ b/lisp/nneething.el @@ -4,7 +4,7 @@ ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen -;; Masanobu UMEDA +;; Masanobu UMEDA ;; Keywords: news, mail ;; This file is part of GNU Emacs. diff --git a/lisp/nnfolder.el b/lisp/nnfolder.el index 55a6c854d..80b25aee4 100644 --- a/lisp/nnfolder.el +++ b/lisp/nnfolder.el @@ -6,7 +6,7 @@ ;; ShengHuo Zhu (adding NOV) ;; Scott Byer ;; Lars Magne Ingebrigtsen -;; Masanobu UMEDA +;; Masanobu UMEDA ;; Keywords: mail ;; This file is part of GNU Emacs. @@ -1214,7 +1214,7 @@ This command does not work if you use short group names." (if (file-exists-p file) (condition-case err (with-temp-buffer - (gnus-sethash file (nth 5 (file-attributes file)) + (gnus-sethash file (nth 5 (file-attributes file)) nnfolder-marks-modtime) (nnheader-insert-file-contents file) (setq nnfolder-marks (read (current-buffer))) diff --git a/lisp/nnheader.el b/lisp/nnheader.el index 3e7ffedda..ee93eecbb 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -5,7 +5,7 @@ ;; Free Software Foundation, Inc. ;; Author: Masanobu UMEDA -;; Lars Magne Ingebrigtsen +;; Lars Magne Ingebrigtsen ;; Keywords: news ;; This file is part of GNU Emacs. diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 0d9fd9b19..092641461 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -172,7 +172,7 @@ group/function elements." (nnimap-strict-function :tag "User-defined function")) (repeat :menu-tag "Multi-server (extended)" :tag "Multi-server list" - (list (regexp :tag "Server regexp") + (list (regexp :tag "Server regexp") (list (regexp :tag "Incoming Mailbox regexp") (repeat :tag "Rules for matching server(s) and mailbox(es)" (list (string :tag "Destination mailbox") @@ -936,7 +936,7 @@ function is generally only called when Gnus is shutting down." (or (member "\\NoSelect" (imap-mailbox-get 'list-flags group nnimap-server-buffer)) (let ((info (nnimap-find-minmax-uid group 'examine))) - (when (> (or (imap-mailbox-get 'recent group + (when (> (or (imap-mailbox-get 'recent group nnimap-server-buffer) 0) 0) (push (list (cons group 0)) nnmail-split-history)) diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 69fa9f7b4..88e1e5ab2 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -189,7 +189,7 @@ The return value should be `delete' or a group name (a string)." (function :format "%v" nnmail-) string)) -(defcustom nnmail-fancy-expiry-targets nil +(defcustom nnmail-fancy-expiry-targets nil "Determine expiry target based on articles using fancy techniques. This is a list of (\"HEADER\" \"REGEXP\" \"TARGET\") entries. If @@ -219,8 +219,8 @@ everything else will be expired to \"nnfolder:Archive-YYYY\"." :type '(repeat (list (choice :tag "Match against" (string :tag "Header") (const to-from)) - regexp - (string :tag "Target group format string")))) + regexp + (string :tag "Target group format string")))) (defcustom nnmail-cache-accepted-message-ids nil "If non-nil, put Message-IDs of Gcc'd articles into the duplicate cache. @@ -381,8 +381,8 @@ GROUP: Mail will be stored in GROUP (a string). junk: Mail will be deleted. Use with care! Do not submerge in water! Example: (setq nnmail-split-fancy - '(| (\"Subject\" \"MAKE MONEY FAST\" junk) - ...other.rules.omitted...)) + '(| (\"Subject\" \"MAKE MONEY FAST\" junk) + ...other.rules.omitted...)) FIELD must match a complete field name. VALUE must match a complete word according to the `nnmail-split-fancy-syntax-table' syntax table. diff --git a/lisp/nnmaildir.el b/lisp/nnmaildir.el index 1290c9af4..1f58d1666 100644 --- a/lisp/nnmaildir.el +++ b/lisp/nnmaildir.el @@ -194,8 +194,8 @@ by nnmaildir-request-article.") `(if ,list (nnmaildir--art-get-num (car ,list)) 0)) (defmacro nnmaildir--nlist-art (list num) `(and ,list - (>= (nnmaildir--art-get-num (car ,list)) ,num) - (nth (- (nnmaildir--art-get-num (car ,list)) ,num) ,list))) + (>= (nnmaildir--art-get-num (car ,list)) ,num) + (nth (- (nnmaildir--art-get-num (car ,list)) ,num) ,list))) (defmacro nnmaildir--flist-art (list file) `(symbol-value (intern-soft ,file ,list))) (defmacro nnmaildir--mlist-art (list msgid) @@ -230,8 +230,8 @@ by nnmaildir-request-article.") (defun nnmaildir--param (prefixed-group-name param) (setq param - (gnus-group-find-parameter prefixed-group-name param 'allow-list) - param (if (vectorp param) (aref param 0) param)) + (gnus-group-find-parameter prefixed-group-name param 'allow-list) + param (if (vectorp param) (aref param 0) param)) (eval param)) (defmacro nnmaildir--unlink (file) @@ -247,11 +247,11 @@ by nnmaildir-request-article.") (let ((tmp (nnmaildir--lists-get-tmpart lists))) (when tmp (set (intern (nnmaildir--art-get-prefix tmp) - (nnmaildir--lists-get-flist lists)) - tmp) + (nnmaildir--lists-get-flist lists)) + tmp) (set (intern (nnmaildir--art-get-msgid tmp) - (nnmaildir--lists-get-mlist lists)) - tmp) + (nnmaildir--lists-get-mlist lists)) + tmp) (nnmaildir--lists-set-tmpart lists nil)))) (defun nnmaildir--prepare (server group) @@ -259,180 +259,180 @@ by nnmaildir-request-article.") (catch 'return (setq x nnmaildir--tmp-server) (when x - (set (intern (nnmaildir--srv-get-name x) nnmaildir--servers) x) - (setq nnmaildir--tmp-server nil)) + (set (intern (nnmaildir--srv-get-name x) nnmaildir--servers) x) + (setq nnmaildir--tmp-server nil)) (if (null server) - (or (setq server nnmaildir--cur-server) - (throw 'return nil)) - (or (setq server (intern-soft server nnmaildir--servers)) - (throw 'return nil)) - (setq server (symbol-value server) - nnmaildir--cur-server server)) + (or (setq server nnmaildir--cur-server) + (throw 'return nil)) + (or (setq server (intern-soft server nnmaildir--servers)) + (throw 'return nil)) + (setq server (symbol-value server) + nnmaildir--cur-server server)) (setq groups (nnmaildir--srv-get-groups server)) (if groups nil (throw 'return nil)) (if (nnmaildir--srv-get-method server) nil - (setq x (concat "nnmaildir:" (nnmaildir--srv-get-name server)) - x (gnus-server-to-method x)) - (if x nil (throw 'return nil)) - (nnmaildir--srv-set-method server x)) + (setq x (concat "nnmaildir:" (nnmaildir--srv-get-name server)) + x (gnus-server-to-method x)) + (if x nil (throw 'return nil)) + (nnmaildir--srv-set-method server x)) (setq x (nnmaildir--srv-get-tmpgrp server)) (when x - (set (intern (nnmaildir--grp-get-name x) groups) x) - (nnmaildir--srv-set-tmpgrp server nil)) + (set (intern (nnmaildir--grp-get-name x) groups) x) + (nnmaildir--srv-set-tmpgrp server nil)) (if (null group) - (or (setq group (nnmaildir--srv-get-curgrp server)) - (throw 'return nil)) - (setq group (intern-soft group groups)) - (if group nil (throw 'return nil)) - (setq group (symbol-value group))) + (or (setq group (nnmaildir--srv-get-curgrp server)) + (throw 'return nil)) + (setq group (intern-soft group groups)) + (if group nil (throw 'return nil)) + (setq group (symbol-value group))) (nnmaildir--lists-fix (nnmaildir--grp-get-lists group)) group))) (defun nnmaildir--update-nov (srv-dir group article) (let ((nnheader-file-coding-system 'binary) - dir gname pgname msgdir prefix suffix file attr mtime novdir novfile - nov msgid nov-beg nov-mid nov-end field pos extra val old-neh new-neh - deactivate-mark) + dir gname pgname msgdir prefix suffix file attr mtime novdir novfile + nov msgid nov-beg nov-mid nov-end field pos extra val old-neh new-neh + deactivate-mark) (catch 'return (setq suffix (nnmaildir--art-get-suffix article)) (if (stringp suffix) nil - (nnmaildir--art-set-nov article nil) - (throw 'return nil)) + (nnmaildir--art-set-nov article nil) + (throw 'return nil)) (setq gname (nnmaildir--grp-get-name group) - pgname (nnmaildir--grp-get-pname group) - dir (nnmaildir--srv-grp-dir srv-dir gname) - msgdir (if (nnmaildir--param pgname 'read-only) - (nnmaildir--new dir) (nnmaildir--cur dir)) - prefix (nnmaildir--art-get-prefix article) - file (concat msgdir prefix suffix) - attr (file-attributes file)) + pgname (nnmaildir--grp-get-pname group) + dir (nnmaildir--srv-grp-dir srv-dir gname) + msgdir (if (nnmaildir--param pgname 'read-only) + (nnmaildir--new dir) (nnmaildir--cur dir)) + prefix (nnmaildir--art-get-prefix article) + file (concat msgdir prefix suffix) + attr (file-attributes file)) (if attr nil - (nnmaildir--art-set-suffix article 'expire) - (nnmaildir--art-set-nov article nil) - (throw 'return nil)) + (nnmaildir--art-set-suffix article 'expire) + (nnmaildir--art-set-nov article nil) + (throw 'return nil)) (setq mtime (nth 5 attr) - attr (nth 7 attr) - nov (nnmaildir--art-get-nov article) - novdir (concat (nnmaildir--nndir dir) "nov") - novdir (file-name-as-directory novdir) - novfile (concat novdir prefix)) + attr (nth 7 attr) + nov (nnmaildir--art-get-nov article) + novdir (concat (nnmaildir--nndir dir) "nov") + novdir (file-name-as-directory novdir) + novfile (concat novdir prefix)) (save-excursion - (set-buffer (get-buffer-create " *nnmaildir nov*")) - (when (file-exists-p novfile) ;; If not, force reparsing the message. - (if nov nil ;; It's already in memory. - ;; Else read the data from the NOV file. - (erase-buffer) - (nnheader-insert-file-contents novfile) - (setq nov (read (current-buffer))) - (nnmaildir--art-set-msgid article (car nov)) - (setq nov (cadr nov))) - ;; If the NOV's modtime matches the file's current modtime, - ;; and it has the right length (i.e., it wasn't produced by - ;; a too-much older version of nnmaildir), then we may use - ;; this NOV data rather than parsing the message file, - ;; unless nnmail-extra-headers has been augmented since this - ;; data was last parsed. - (when (and (equal mtime (nnmaildir--nov-get-mtime nov)) - (= (length nov) (length (nnmaildir--nov-new)))) - ;; This NOV data is potentially up-to-date. - (setq old-neh (nnmaildir--nov-get-neh nov) - new-neh nnmail-extra-headers) - (if (equal new-neh old-neh) (throw 'return nov)) ;; Common case. - ;; They're not equal, but maybe the new is a subset of the old... - (if (null new-neh) (throw 'return nov)) - (while new-neh - (if (memq (car new-neh) old-neh) - (progn - (setq new-neh (cdr new-neh)) - (if new-neh nil (throw 'return nov))) - (setq new-neh nil))))) - ;; Parse the NOV data out of the message. - (erase-buffer) - (nnheader-insert-file-contents file) - (insert "\n") - (goto-char (point-min)) - (save-restriction - (if (search-forward "\n\n" nil 'noerror) - (progn - (setq nov-mid (count-lines (point) (point-max))) - (narrow-to-region (point-min) (1- (point)))) - (setq nov-mid 0)) - (goto-char (point-min)) - (delete-char 1) - (nnheader-fold-continuation-lines) - (setq nov (nnheader-parse-head 'naked) - field (or (mail-header-lines nov) 0))) - (if (or (zerop field) (nnmaildir--param pgname 'distrust-Lines:)) nil - (setq nov-mid field)) - (setq nov-mid (number-to-string nov-mid) - nov-mid (concat (number-to-string attr) "\t" nov-mid) - field (or (mail-header-references nov) "") - pos 0) - (save-match-data - (while (string-match "\t" field pos) - (aset field (match-beginning 0) ? ) - (setq pos (match-end 0))) - (setq nov-mid (concat field "\t" nov-mid) - extra (mail-header-extra nov) - nov-end "") - (while extra - (setq field (car extra) extra (cdr extra) - val (cdr field) field (symbol-name (car field)) - pos 0) - (while (string-match "\t" field pos) - (aset field (match-beginning 0) ? ) - (setq pos (match-end 0))) - (setq pos 0) - (while (string-match "\t" val pos) - (aset val (match-beginning 0) ? ) - (setq pos (match-end 0))) - (setq nov-end (concat nov-end "\t" field ": " val))) - (setq nov-end (if (zerop (length nov-end)) "" (substring nov-end 1)) - field (or (mail-header-subject nov) "") - pos 0) - (while (string-match "\t" field pos) - (aset field (match-beginning 0) ? ) - (setq pos (match-end 0))) - (setq nov-beg field - field (or (mail-header-from nov) "") - pos 0) - (while (string-match "\t" field pos) - (aset field (match-beginning 0) ? ) - (setq pos (match-end 0))) - (setq nov-beg (concat nov-beg "\t" field) - field (or (mail-header-date nov) "") - pos 0) - (while (string-match "\t" field pos) - (aset field (match-beginning 0) ? ) - (setq pos (match-end 0))) - (setq nov-beg (concat nov-beg "\t" field) - field (mail-header-id nov) - pos 0) - (while (string-match "\t" field pos) - (aset field (match-beginning 0) ? ) - (setq pos (match-end 0))) - (setq msgid field)) - (if (or (null msgid) (nnheader-fake-message-id-p msgid)) - (setq msgid (concat "<" prefix "@nnmaildir>"))) - (erase-buffer) - (setq nov (nnmaildir--nov-new)) - (nnmaildir--nov-set-beg nov nov-beg) - (nnmaildir--nov-set-mid nov nov-mid) - (nnmaildir--nov-set-end nov nov-end) - (nnmaildir--nov-set-mtime nov mtime) - (nnmaildir--nov-set-neh nov (copy-sequence nnmail-extra-headers)) - (prin1 (list msgid nov) (current-buffer)) - (setq file (concat novfile ":")) - (nnmaildir--unlink file) - (write-region (point-min) (point-max) file nil 'no-message)) + (set-buffer (get-buffer-create " *nnmaildir nov*")) + (when (file-exists-p novfile) ;; If not, force reparsing the message. + (if nov nil ;; It's already in memory. + ;; Else read the data from the NOV file. + (erase-buffer) + (nnheader-insert-file-contents novfile) + (setq nov (read (current-buffer))) + (nnmaildir--art-set-msgid article (car nov)) + (setq nov (cadr nov))) + ;; If the NOV's modtime matches the file's current modtime, + ;; and it has the right length (i.e., it wasn't produced by + ;; a too-much older version of nnmaildir), then we may use + ;; this NOV data rather than parsing the message file, + ;; unless nnmail-extra-headers has been augmented since this + ;; data was last parsed. + (when (and (equal mtime (nnmaildir--nov-get-mtime nov)) + (= (length nov) (length (nnmaildir--nov-new)))) + ;; This NOV data is potentially up-to-date. + (setq old-neh (nnmaildir--nov-get-neh nov) + new-neh nnmail-extra-headers) + (if (equal new-neh old-neh) (throw 'return nov)) ;; Common case. + ;; They're not equal, but maybe the new is a subset of the old... + (if (null new-neh) (throw 'return nov)) + (while new-neh + (if (memq (car new-neh) old-neh) + (progn + (setq new-neh (cdr new-neh)) + (if new-neh nil (throw 'return nov))) + (setq new-neh nil))))) + ;; Parse the NOV data out of the message. + (erase-buffer) + (nnheader-insert-file-contents file) + (insert "\n") + (goto-char (point-min)) + (save-restriction + (if (search-forward "\n\n" nil 'noerror) + (progn + (setq nov-mid (count-lines (point) (point-max))) + (narrow-to-region (point-min) (1- (point)))) + (setq nov-mid 0)) + (goto-char (point-min)) + (delete-char 1) + (nnheader-fold-continuation-lines) + (setq nov (nnheader-parse-head 'naked) + field (or (mail-header-lines nov) 0))) + (if (or (zerop field) (nnmaildir--param pgname 'distrust-Lines:)) nil + (setq nov-mid field)) + (setq nov-mid (number-to-string nov-mid) + nov-mid (concat (number-to-string attr) "\t" nov-mid) + field (or (mail-header-references nov) "") + pos 0) + (save-match-data + (while (string-match "\t" field pos) + (aset field (match-beginning 0) ? ) + (setq pos (match-end 0))) + (setq nov-mid (concat field "\t" nov-mid) + extra (mail-header-extra nov) + nov-end "") + (while extra + (setq field (car extra) extra (cdr extra) + val (cdr field) field (symbol-name (car field)) + pos 0) + (while (string-match "\t" field pos) + (aset field (match-beginning 0) ? ) + (setq pos (match-end 0))) + (setq pos 0) + (while (string-match "\t" val pos) + (aset val (match-beginning 0) ? ) + (setq pos (match-end 0))) + (setq nov-end (concat nov-end "\t" field ": " val))) + (setq nov-end (if (zerop (length nov-end)) "" (substring nov-end 1)) + field (or (mail-header-subject nov) "") + pos 0) + (while (string-match "\t" field pos) + (aset field (match-beginning 0) ? ) + (setq pos (match-end 0))) + (setq nov-beg field + field (or (mail-header-from nov) "") + pos 0) + (while (string-match "\t" field pos) + (aset field (match-beginning 0) ? ) + (setq pos (match-end 0))) + (setq nov-beg (concat nov-beg "\t" field) + field (or (mail-header-date nov) "") + pos 0) + (while (string-match "\t" field pos) + (aset field (match-beginning 0) ? ) + (setq pos (match-end 0))) + (setq nov-beg (concat nov-beg "\t" field) + field (mail-header-id nov) + pos 0) + (while (string-match "\t" field pos) + (aset field (match-beginning 0) ? ) + (setq pos (match-end 0))) + (setq msgid field)) + (if (or (null msgid) (nnheader-fake-message-id-p msgid)) + (setq msgid (concat "<" prefix "@nnmaildir>"))) + (erase-buffer) + (setq nov (nnmaildir--nov-new)) + (nnmaildir--nov-set-beg nov nov-beg) + (nnmaildir--nov-set-mid nov nov-mid) + (nnmaildir--nov-set-end nov nov-end) + (nnmaildir--nov-set-mtime nov mtime) + (nnmaildir--nov-set-neh nov (copy-sequence nnmail-extra-headers)) + (prin1 (list msgid nov) (current-buffer)) + (setq file (concat novfile ":")) + (nnmaildir--unlink file) + (write-region (point-min) (point-max) file nil 'no-message)) (rename-file file novfile 'replace) (nnmaildir--art-set-msgid article msgid) nov))) (defun nnmaildir--cache-nov (group article nov) (let ((cache (nnmaildir--grp-get-cache group)) - (index (nnmaildir--grp-get-index group)) - goner) + (index (nnmaildir--grp-get-index group)) + goner) (if (nnmaildir--art-get-nov article) nil (setq goner (aref cache index)) (if goner (nnmaildir--art-set-nov goner nil)) @@ -442,16 +442,16 @@ by nnmaildir-request-article.") (defun nnmaildir--grp-add-art (srv-dir group article) (let ((nov (nnmaildir--update-nov srv-dir group article)) - old-lists new-lists) + old-lists new-lists) (when nov (setq old-lists (nnmaildir--grp-get-lists group) - new-lists (nnmaildir--lists-new)) + new-lists (nnmaildir--lists-new)) (nnmaildir--lists-set-nlist - new-lists (cons article (nnmaildir--lists-get-nlist old-lists))) + new-lists (cons article (nnmaildir--lists-get-nlist old-lists))) (nnmaildir--lists-set-flist new-lists - (nnmaildir--lists-get-flist old-lists)) + (nnmaildir--lists-get-flist old-lists)) (nnmaildir--lists-set-mlist new-lists - (nnmaildir--lists-get-mlist old-lists)) + (nnmaildir--lists-get-mlist old-lists)) (nnmaildir--lists-set-tmpart new-lists article) (nnmaildir--grp-set-lists group new-lists) (nnmaildir--lists-fix new-lists) @@ -464,46 +464,46 @@ by nnmaildir-request-article.") (defun nnmaildir--article-count (group) (let ((ct 0) - (min 1)) + (min 1)) (setq group (nnmaildir--grp-get-lists group) - group (nnmaildir--lists-get-nlist group)) + group (nnmaildir--lists-get-nlist group)) (while group (if (stringp (nnmaildir--art-get-suffix (car group))) - (setq ct (1+ ct) - min (nnmaildir--art-get-num (car group)))) + (setq ct (1+ ct) + min (nnmaildir--art-get-num (car group)))) (setq group (cdr group))) (cons ct min))) (defun nnmaildir-article-number-to-file-name - (number group-name server-address-string) + (number group-name server-address-string) (let ((group (nnmaildir--prepare server-address-string group-name)) - list article suffix dir filename) + list article suffix dir filename) (catch 'return (if (null group) - ;; The given group or server does not exist. - (throw 'return nil)) + ;; The given group or server does not exist. + (throw 'return nil)) (setq list (nnmaildir--grp-get-lists group) - list (nnmaildir--lists-get-nlist list) - article (nnmaildir--nlist-art list number)) + list (nnmaildir--lists-get-nlist list) + article (nnmaildir--nlist-art list number)) (if (null article) - ;; The given article number does not exist in this group. - (throw 'return nil)) + ;; The given article number does not exist in this group. + (throw 'return nil)) (setq suffix (nnmaildir--art-get-suffix article)) (if (not (stringp suffix)) - ;; The article has expired. - (throw 'return nil)) + ;; The article has expired. + (throw 'return nil)) (setq dir (nnmaildir--srv-get-dir nnmaildir--cur-server) - dir (nnmaildir--srv-grp-dir dir group-name) - group (if (nnmaildir--param (nnmaildir--grp-get-pname group) - 'read-only) - (nnmaildir--new dir) (nnmaildir--cur dir)) - filename (concat group (nnmaildir--art-get-prefix article) suffix)) + dir (nnmaildir--srv-grp-dir dir group-name) + group (if (nnmaildir--param (nnmaildir--grp-get-pname group) + 'read-only) + (nnmaildir--new dir) (nnmaildir--cur dir)) + filename (concat group (nnmaildir--art-get-prefix article) suffix)) (if (file-exists-p filename) - filename - ;; The article disappeared out from under us. - (nnmaildir--art-set-suffix article 'expire) - (nnmaildir--art-set-nov article nil) - nil)))) + filename + ;; The article disappeared out from under us. + (nnmaildir--art-set-suffix article 'expire) + (nnmaildir--art-set-nov article nil) + nil)))) (defun nnmaildir-request-type (group &optional article) 'mail) @@ -515,91 +515,91 @@ by nnmaildir-request-article.") (defun nnmaildir-server-opened (&optional server) (and nnmaildir--cur-server (if server - (string-equal server - (nnmaildir--srv-get-name nnmaildir--cur-server)) - t) + (string-equal server + (nnmaildir--srv-get-name nnmaildir--cur-server)) + t) (nnmaildir--srv-get-groups nnmaildir--cur-server) t)) (defun nnmaildir-open-server (server &optional defs) (let ((x server) - dir size) + dir size) (catch 'return (setq server (intern-soft x nnmaildir--servers)) (if server - (and (setq server (symbol-value server)) - (nnmaildir--srv-get-groups server) - (setq nnmaildir--cur-server server) - (throw 'return t)) - (setq server (nnmaildir--srv-new)) - (nnmaildir--srv-set-name server x) - (setq nnmaildir--tmp-server server) - (set (intern x nnmaildir--servers) server) - (setq nnmaildir--tmp-server nil)) + (and (setq server (symbol-value server)) + (nnmaildir--srv-get-groups server) + (setq nnmaildir--cur-server server) + (throw 'return t)) + (setq server (nnmaildir--srv-new)) + (nnmaildir--srv-set-name server x) + (setq nnmaildir--tmp-server server) + (set (intern x nnmaildir--servers) server) + (setq nnmaildir--tmp-server nil)) (setq dir (assq 'directory defs)) (if dir nil - (nnmaildir--srv-set-error - server "You must set \"directory\" in the select method") - (throw 'return nil)) + (nnmaildir--srv-set-error + server "You must set \"directory\" in the select method") + (throw 'return nil)) (setq dir (cadr dir) - dir (eval dir) - dir (expand-file-name dir) - dir (file-name-as-directory dir)) + dir (eval dir) + dir (expand-file-name dir) + dir (file-name-as-directory dir)) (if (file-exists-p dir) nil - (nnmaildir--srv-set-error server (concat "No such directory: " dir)) - (throw 'return nil)) + (nnmaildir--srv-set-error server (concat "No such directory: " dir)) + (throw 'return nil)) (nnmaildir--srv-set-dir server dir) (setq x (assq 'directory-files defs)) (if (null x) - (setq x (symbol-function (if nnheader-directory-files-is-safe - 'directory-files - 'nnheader-directory-files-safe))) - (setq x (cadr x)) - (if (functionp x) nil - (nnmaildir--srv-set-error - server (concat "Not a function: " (prin1-to-string x))) - (throw 'return nil))) + (setq x (symbol-function (if nnheader-directory-files-is-safe + 'directory-files + 'nnheader-directory-files-safe))) + (setq x (cadr x)) + (if (functionp x) nil + (nnmaildir--srv-set-error + server (concat "Not a function: " (prin1-to-string x))) + (throw 'return nil))) (nnmaildir--srv-set-ls server x) (setq x (funcall x dir nil "\\`[^.]" 'nosort) - x (length x) - size 1) + x (length x) + size 1) (while (<= size x) (setq size (* 2 size))) (if (/= size 1) (setq size (1- size))) (and (setq x (assq 'get-new-mail defs)) - (setq x (cdr x)) - (car x) - (nnmaildir--srv-set-gnm server t) - (require 'nnmail)) + (setq x (cdr x)) + (car x) + (nnmaildir--srv-set-gnm server t) + (require 'nnmail)) (setq x (assq 'create-directory defs)) (when x - (setq x (cadr x) - x (eval x)) - (nnmaildir--srv-set-create-dir server x)) + (setq x (cadr x) + x (eval x)) + (nnmaildir--srv-set-create-dir server x)) (nnmaildir--srv-set-groups server (make-vector size 0)) (setq nnmaildir--cur-server server) t))) (defun nnmaildir--parse-filename (file) (let ((prefix (car file)) - timestamp len) + timestamp len) (if (string-match - "\\`\\([0-9]+\\)\\.\\([0-9]+\\)\\(_\\([0-9]+\\)\\)?\\(\\..*\\)\\'" - prefix) - (progn - (setq timestamp (concat "0000" (match-string 1 prefix)) - len (- (length timestamp) 4)) - (vector (string-to-number (substring timestamp 0 len)) - (string-to-number (substring timestamp len)) - (string-to-number (match-string 2 prefix)) - (string-to-number (or (match-string 4 prefix) "-1")) - (match-string 5 prefix) - file)) + "\\`\\([0-9]+\\)\\.\\([0-9]+\\)\\(_\\([0-9]+\\)\\)?\\(\\..*\\)\\'" + prefix) + (progn + (setq timestamp (concat "0000" (match-string 1 prefix)) + len (- (length timestamp) 4)) + (vector (string-to-number (substring timestamp 0 len)) + (string-to-number (substring timestamp len)) + (string-to-number (match-string 2 prefix)) + (string-to-number (or (match-string 4 prefix) "-1")) + (match-string 5 prefix) + file)) file))) (defun nnmaildir--sort-files (a b) (catch 'return (if (consp a) - (throw 'return (and (consp b) (string-lessp (car a) (car b))))) + (throw 'return (and (consp b) (string-lessp (car a) (car b))))) (if (consp b) (throw 'return t)) (if (< (aref a 0) (aref b 0)) (throw 'return t)) (if (> (aref a 0) (aref b 0)) (throw 'return nil)) @@ -614,181 +614,181 @@ by nnmaildir-request-article.") (defun nnmaildir--scan (gname scan-msgs groups method srv-dir srv-ls) (catch 'return (let ((36h-ago (- (car (current-time)) 2)) - absdir nndir tdir ndir cdir nattr cattr isnew pgname read-only ls - files file num dir flist group x) + absdir nndir tdir ndir cdir nattr cattr isnew pgname read-only ls + files file num dir flist group x) (setq absdir (file-name-as-directory (concat srv-dir gname)) - nndir (nnmaildir--nndir absdir)) + nndir (nnmaildir--nndir absdir)) (if (file-attributes absdir) nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "No such directory: " absdir)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "No such directory: " absdir)) + (throw 'return nil)) (setq tdir (nnmaildir--tmp absdir) - ndir (nnmaildir--new absdir) - cdir (nnmaildir--cur absdir) - nattr (file-attributes ndir) - cattr (file-attributes cdir)) + ndir (nnmaildir--new absdir) + cdir (nnmaildir--cur absdir) + nattr (file-attributes ndir) + cattr (file-attributes cdir)) (if (and (file-exists-p tdir) nattr cattr) nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "Not a maildir: " absdir)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "Not a maildir: " absdir)) + (throw 'return nil)) (setq group (nnmaildir--prepare nil gname)) (if group - (setq isnew nil - pgname (nnmaildir--grp-get-pname group)) - (setq isnew t - group (nnmaildir--grp-new) - pgname (gnus-group-prefixed-name gname method)) - (nnmaildir--grp-set-name group gname) - (nnmaildir--grp-set-pname group pgname) - (nnmaildir--grp-set-lists group (nnmaildir--lists-new)) - (nnmaildir--grp-set-index group 0) - (nnmaildir--mkdir nndir) - (nnmaildir--mkdir (concat nndir "nov")) - (nnmaildir--mkdir (concat nndir "marks")) - (write-region "" nil (concat nndir "markfile") nil 'no-message)) + (setq isnew nil + pgname (nnmaildir--grp-get-pname group)) + (setq isnew t + group (nnmaildir--grp-new) + pgname (gnus-group-prefixed-name gname method)) + (nnmaildir--grp-set-name group gname) + (nnmaildir--grp-set-pname group pgname) + (nnmaildir--grp-set-lists group (nnmaildir--lists-new)) + (nnmaildir--grp-set-index group 0) + (nnmaildir--mkdir nndir) + (nnmaildir--mkdir (concat nndir "nov")) + (nnmaildir--mkdir (concat nndir "marks")) + (write-region "" nil (concat nndir "markfile") nil 'no-message)) (setq read-only (nnmaildir--param pgname 'read-only) - ls (or (nnmaildir--param pgname 'directory-files) srv-ls)) + ls (or (nnmaildir--param pgname 'directory-files) srv-ls)) (if read-only nil - (setq x (nth 11 (file-attributes tdir))) - (if (and (= x (nth 11 nattr)) (= x (nth 11 cattr))) nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "Maildir spans filesystems: " - absdir)) - (throw 'return nil)) - (setq files (funcall ls tdir 'full "\\`[^.]" 'nosort)) - (while files - (setq file (car files) files (cdr files) - x (file-attributes file)) - (if (or (< 1 (cadr x)) (> 36h-ago (car (nth 4 x)))) - (delete-file file)))) + (setq x (nth 11 (file-attributes tdir))) + (if (and (= x (nth 11 nattr)) (= x (nth 11 cattr))) nil + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "Maildir spans filesystems: " + absdir)) + (throw 'return nil)) + (setq files (funcall ls tdir 'full "\\`[^.]" 'nosort)) + (while files + (setq file (car files) files (cdr files) + x (file-attributes file)) + (if (or (< 1 (cadr x)) (> 36h-ago (car (nth 4 x)))) + (delete-file file)))) (or scan-msgs - isnew - (throw 'return t)) + isnew + (throw 'return t)) (setq nattr (nth 5 nattr)) (if (equal nattr (nnmaildir--grp-get-new group)) - (setq nattr nil)) + (setq nattr nil)) (if read-only (setq dir (and (or isnew nattr) ndir)) - (when (or isnew nattr) - (setq files (funcall ls ndir nil "\\`[^.]" 'nosort)) - (while files - (setq file (car files) files (cdr files)) - (rename-file (concat ndir file) (concat cdir file ":2,"))) - (nnmaildir--grp-set-new group nattr)) - (setq cattr (file-attributes cdir) - cattr (nth 5 cattr)) - (if (equal cattr (nnmaildir--grp-get-cur group)) - (setq cattr nil)) - (setq dir (and (or isnew cattr) cdir))) + (when (or isnew nattr) + (setq files (funcall ls ndir nil "\\`[^.]" 'nosort)) + (while files + (setq file (car files) files (cdr files)) + (rename-file (concat ndir file) (concat cdir file ":2,"))) + (nnmaildir--grp-set-new group nattr)) + (setq cattr (file-attributes cdir) + cattr (nth 5 cattr)) + (if (equal cattr (nnmaildir--grp-get-cur group)) + (setq cattr nil)) + (setq dir (and (or isnew cattr) cdir))) (if dir nil (throw 'return t)) (setq files (funcall ls dir nil "\\`[^.]" 'nosort)) (when isnew - (setq x (length files) - num 1) - (while (<= num x) (setq num (* 2 num))) - (if (/= num 1) (setq num (1- num))) - (setq x (nnmaildir--grp-get-lists group)) - (nnmaildir--lists-set-flist x (make-vector num 0)) - (nnmaildir--lists-set-mlist x (make-vector num 0)) - (nnmaildir--grp-set-mmth group (make-vector 1 0)) - (setq num (nnmaildir--param pgname 'nov-cache-size)) - (if (numberp num) (if (< num 1) (setq num 1)) - (setq x files - num 16 - cdir (file-name-as-directory (concat nndir "marks")) - ndir (file-name-as-directory (concat cdir "tick")) - cdir (file-name-as-directory (concat cdir "read"))) - (while x - (setq file (car x) x (cdr x)) - (string-match "\\`\\([^:]*\\)\\(\\(:.*\\)?\\)\\'" file) - (setq file (match-string 1 file)) - (if (or (not (file-exists-p (concat cdir file))) - (file-exists-p (concat ndir file))) - (setq num (1+ num))))) - (nnmaildir--grp-set-cache group (make-vector num nil)) - (nnmaildir--srv-set-tmpgrp nnmaildir--cur-server group) - (set (intern gname groups) group) - (nnmaildir--srv-set-tmpgrp nnmaildir--cur-server nil) - (or scan-msgs (throw 'return t))) + (setq x (length files) + num 1) + (while (<= num x) (setq num (* 2 num))) + (if (/= num 1) (setq num (1- num))) + (setq x (nnmaildir--grp-get-lists group)) + (nnmaildir--lists-set-flist x (make-vector num 0)) + (nnmaildir--lists-set-mlist x (make-vector num 0)) + (nnmaildir--grp-set-mmth group (make-vector 1 0)) + (setq num (nnmaildir--param pgname 'nov-cache-size)) + (if (numberp num) (if (< num 1) (setq num 1)) + (setq x files + num 16 + cdir (file-name-as-directory (concat nndir "marks")) + ndir (file-name-as-directory (concat cdir "tick")) + cdir (file-name-as-directory (concat cdir "read"))) + (while x + (setq file (car x) x (cdr x)) + (string-match "\\`\\([^:]*\\)\\(\\(:.*\\)?\\)\\'" file) + (setq file (match-string 1 file)) + (if (or (not (file-exists-p (concat cdir file))) + (file-exists-p (concat ndir file))) + (setq num (1+ num))))) + (nnmaildir--grp-set-cache group (make-vector num nil)) + (nnmaildir--srv-set-tmpgrp nnmaildir--cur-server group) + (set (intern gname groups) group) + (nnmaildir--srv-set-tmpgrp nnmaildir--cur-server nil) + (or scan-msgs (throw 'return t))) (setq flist (nnmaildir--grp-get-lists group) - num (nnmaildir--lists-get-nlist flist) - flist (nnmaildir--lists-get-flist flist) - num (nnmaildir--nlist-last-num num) - x files - files nil) + num (nnmaildir--lists-get-nlist flist) + flist (nnmaildir--lists-get-flist flist) + num (nnmaildir--nlist-last-num num) + x files + files nil) (while x - (setq file (car x) x (cdr x)) - (string-match "\\`\\([^:]*\\)\\(\\(:.*\\)?\\)\\'" file) - (setq file (cons (match-string 1 file) (match-string 2 file))) - (if (nnmaildir--flist-art flist (car file)) nil - (setq files (cons file files)))) + (setq file (car x) x (cdr x)) + (string-match "\\`\\([^:]*\\)\\(\\(:.*\\)?\\)\\'" file) + (setq file (cons (match-string 1 file) (match-string 2 file))) + (if (nnmaildir--flist-art flist (car file)) nil + (setq files (cons file files)))) (setq files (mapcar 'nnmaildir--parse-filename files) - files (sort files 'nnmaildir--sort-files)) + files (sort files 'nnmaildir--sort-files)) (while files - (setq file (car files) files (cdr files) - file (if (consp file) file (aref file 5)) - x (nnmaildir--art-new)) - (nnmaildir--art-set-prefix x (car file)) - (nnmaildir--art-set-suffix x (cdr file)) - (nnmaildir--art-set-num x (1+ num)) - (if (nnmaildir--grp-add-art srv-dir group x) - (setq num (1+ num)))) + (setq file (car files) files (cdr files) + file (if (consp file) file (aref file 5)) + x (nnmaildir--art-new)) + (nnmaildir--art-set-prefix x (car file)) + (nnmaildir--art-set-suffix x (cdr file)) + (nnmaildir--art-set-num x (1+ num)) + (if (nnmaildir--grp-add-art srv-dir group x) + (setq num (1+ num)))) (if read-only (nnmaildir--grp-set-new group nattr) - (nnmaildir--grp-set-cur group cattr))) + (nnmaildir--grp-set-cur group cattr))) t)) (defun nnmaildir-request-scan (&optional scan-group server) (let ((coding-system-for-write nnheader-file-coding-system) - (buffer-file-coding-system nil) - (file-coding-system-alist nil) - (nnmaildir-get-new-mail t) - (nnmaildir-group-alist nil) - (nnmaildir-active-file nil) - x srv-ls srv-dir method groups group dirs grp-dir seen deactivate-mark) + (buffer-file-coding-system nil) + (file-coding-system-alist nil) + (nnmaildir-get-new-mail t) + (nnmaildir-group-alist nil) + (nnmaildir-active-file nil) + x srv-ls srv-dir method groups group dirs grp-dir seen deactivate-mark) (nnmaildir--prepare server nil) (setq srv-ls (nnmaildir--srv-get-ls nnmaildir--cur-server) - srv-dir (nnmaildir--srv-get-dir nnmaildir--cur-server) - method (nnmaildir--srv-get-method nnmaildir--cur-server) - groups (nnmaildir--srv-get-groups nnmaildir--cur-server)) + srv-dir (nnmaildir--srv-get-dir nnmaildir--cur-server) + method (nnmaildir--srv-get-method nnmaildir--cur-server) + groups (nnmaildir--srv-get-groups nnmaildir--cur-server)) (save-excursion (set-buffer (get-buffer-create " *nnmaildir work*")) (save-match-data - (if (stringp scan-group) - (if (nnmaildir--scan scan-group t groups method srv-dir srv-ls) - (if (nnmaildir--srv-get-gnm nnmaildir--cur-server) - (nnmail-get-new-mail 'nnmaildir nil nil scan-group)) - (unintern scan-group groups)) - (setq x (nth 5 (file-attributes srv-dir))) - (if (equal x (nnmaildir--srv-get-mtime nnmaildir--cur-server)) - (if scan-group nil - (mapatoms (lambda (sym) - (nnmaildir--scan (symbol-name sym) t groups - method srv-dir srv-ls)) - groups)) - (setq dirs (funcall srv-ls srv-dir nil "\\`[^.]" 'nosort) - x (length dirs) - seen 1) - (while (<= seen x) (setq seen (* 2 seen))) - (if (/= seen 1) (setq seen (1- seen))) - (setq seen (make-vector seen 0) - scan-group (null scan-group)) - (while dirs - (setq grp-dir (car dirs) dirs (cdr dirs)) - (if (nnmaildir--scan grp-dir scan-group groups method srv-dir - srv-ls) - (intern grp-dir seen))) - (setq x nil) - (mapatoms (lambda (group) - (setq group (symbol-name group)) - (if (intern-soft group seen) nil - (setq x (cons group x)))) - groups) - (while x - (unintern (car x) groups) - (setq x (cdr x))) - (nnmaildir--srv-set-mtime nnmaildir--cur-server - (nth 5 (file-attributes srv-dir)))) - (if (nnmaildir--srv-get-gnm nnmaildir--cur-server) - (nnmail-get-new-mail 'nnmaildir nil nil)))))) + (if (stringp scan-group) + (if (nnmaildir--scan scan-group t groups method srv-dir srv-ls) + (if (nnmaildir--srv-get-gnm nnmaildir--cur-server) + (nnmail-get-new-mail 'nnmaildir nil nil scan-group)) + (unintern scan-group groups)) + (setq x (nth 5 (file-attributes srv-dir))) + (if (equal x (nnmaildir--srv-get-mtime nnmaildir--cur-server)) + (if scan-group nil + (mapatoms (lambda (sym) + (nnmaildir--scan (symbol-name sym) t groups + method srv-dir srv-ls)) + groups)) + (setq dirs (funcall srv-ls srv-dir nil "\\`[^.]" 'nosort) + x (length dirs) + seen 1) + (while (<= seen x) (setq seen (* 2 seen))) + (if (/= seen 1) (setq seen (1- seen))) + (setq seen (make-vector seen 0) + scan-group (null scan-group)) + (while dirs + (setq grp-dir (car dirs) dirs (cdr dirs)) + (if (nnmaildir--scan grp-dir scan-group groups method srv-dir + srv-ls) + (intern grp-dir seen))) + (setq x nil) + (mapatoms (lambda (group) + (setq group (symbol-name group)) + (if (intern-soft group seen) nil + (setq x (cons group x)))) + groups) + (while x + (unintern (car x) groups) + (setq x (cdr x))) + (nnmaildir--srv-set-mtime nnmaildir--cur-server + (nth 5 (file-attributes srv-dir)))) + (if (nnmaildir--srv-get-gnm nnmaildir--cur-server) + (nnmail-get-new-mail 'nnmaildir nil nil)))))) t) (defun nnmaildir-request-list (&optional server) @@ -799,16 +799,16 @@ by nnmaildir-request-article.") (set-buffer nntp-server-buffer) (erase-buffer) (mapatoms (lambda (group) - (setq group (symbol-value group) - ro (nnmaildir--param (nnmaildir--grp-get-pname group) - 'read-only) - ct-min (nnmaildir--article-count group)) - (insert (nnmaildir--grp-get-name group) " ") - (princ (car ct-min) nntp-server-buffer) - (insert " ") - (princ (cdr ct-min) nntp-server-buffer) - (insert " " (if ro "n" "y") "\n")) - (nnmaildir--srv-get-groups nnmaildir--cur-server)))) + (setq group (symbol-value group) + ro (nnmaildir--param (nnmaildir--grp-get-pname group) + 'read-only) + ct-min (nnmaildir--article-count group)) + (insert (nnmaildir--grp-get-name group) " ") + (princ (car ct-min) nntp-server-buffer) + (insert " ") + (princ (cdr ct-min) nntp-server-buffer) + (insert " " (if ro "n" "y") "\n")) + (nnmaildir--srv-get-groups nnmaildir--cur-server)))) t) (defun nnmaildir-request-newgroups (date &optional server) @@ -821,90 +821,90 @@ by nnmaildir-request-article.") (set-buffer nntp-server-buffer) (erase-buffer) (while groups - (setq gname (car groups) groups (cdr groups)) - (nnmaildir-request-scan gname server) - (setq group (nnmaildir--prepare nil gname)) - (if (null group) (insert "411 no such news group\n") - (setq ct-min (nnmaildir--article-count group)) - (insert "211 ") - (princ (car ct-min) nntp-server-buffer) - (insert " ") - (princ (cdr ct-min) nntp-server-buffer) - (insert " ") - (princ (nnmaildir--nlist-last-num - (nnmaildir--lists-get-nlist - (nnmaildir--grp-get-lists group))) - nntp-server-buffer) - (insert " " gname "\n"))))) + (setq gname (car groups) groups (cdr groups)) + (nnmaildir-request-scan gname server) + (setq group (nnmaildir--prepare nil gname)) + (if (null group) (insert "411 no such news group\n") + (setq ct-min (nnmaildir--article-count group)) + (insert "211 ") + (princ (car ct-min) nntp-server-buffer) + (insert " ") + (princ (cdr ct-min) nntp-server-buffer) + (insert " ") + (princ (nnmaildir--nlist-last-num + (nnmaildir--lists-get-nlist + (nnmaildir--grp-get-lists group))) + nntp-server-buffer) + (insert " " gname "\n"))))) 'group) (defun nnmaildir-request-update-info (gname info &optional server) (nnmaildir-request-scan gname server) (let ((group (nnmaildir--prepare server gname)) - srv-ls pgname nlist flist last always-marks never-marks old-marks - dotfile num dir markdirs marks mark ranges articles article read end - new-marks ls old-mmth new-mmth mtime mark-sym deactivate-mark) + srv-ls pgname nlist flist last always-marks never-marks old-marks + dotfile num dir markdirs marks mark ranges articles article read end + new-marks ls old-mmth new-mmth mtime mark-sym deactivate-mark) (catch 'return (if group nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "No such group: " gname)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "No such group: " gname)) + (throw 'return nil)) (setq srv-ls (nnmaildir--srv-get-ls nnmaildir--cur-server) - gname (nnmaildir--grp-get-name group) - pgname (nnmaildir--grp-get-pname group) - nlist (nnmaildir--grp-get-lists group) - flist (nnmaildir--lists-get-flist nlist) - nlist (nnmaildir--lists-get-nlist nlist)) + gname (nnmaildir--grp-get-name group) + pgname (nnmaildir--grp-get-pname group) + nlist (nnmaildir--grp-get-lists group) + flist (nnmaildir--lists-get-flist nlist) + nlist (nnmaildir--lists-get-nlist nlist)) (if nlist nil - (gnus-info-set-read info nil) - (gnus-info-set-marks info nil 'extend) - (throw 'return info)) + (gnus-info-set-read info nil) + (gnus-info-set-marks info nil 'extend) + (throw 'return info)) (setq old-marks (cons 'read (gnus-info-read info)) - old-marks (cons old-marks (gnus-info-marks info)) - last (nnmaildir--nlist-last-num nlist) - always-marks (nnmaildir--param pgname 'always-marks) - never-marks (nnmaildir--param pgname 'never-marks) - dir (nnmaildir--srv-get-dir nnmaildir--cur-server) - dir (nnmaildir--srv-grp-dir dir gname) - dir (nnmaildir--nndir dir) - dir (concat dir "marks") - dir (file-name-as-directory dir) - ls (nnmaildir--param pgname 'directory-files) - ls (or ls srv-ls) - markdirs (funcall ls dir nil "\\`[^.]" 'nosort) - num (length markdirs) - new-mmth 1) + old-marks (cons old-marks (gnus-info-marks info)) + last (nnmaildir--nlist-last-num nlist) + always-marks (nnmaildir--param pgname 'always-marks) + never-marks (nnmaildir--param pgname 'never-marks) + dir (nnmaildir--srv-get-dir nnmaildir--cur-server) + dir (nnmaildir--srv-grp-dir dir gname) + dir (nnmaildir--nndir dir) + dir (concat dir "marks") + dir (file-name-as-directory dir) + ls (nnmaildir--param pgname 'directory-files) + ls (or ls srv-ls) + markdirs (funcall ls dir nil "\\`[^.]" 'nosort) + num (length markdirs) + new-mmth 1) (while (<= new-mmth num) (setq new-mmth (* 2 new-mmth))) (if (/= new-mmth 1) (setq new-mmth (1- new-mmth))) (setq new-mmth (make-vector new-mmth 0) - old-mmth (nnmaildir--grp-get-mmth group)) + old-mmth (nnmaildir--grp-get-mmth group)) (while markdirs - (setq mark (car markdirs) markdirs (cdr markdirs) - articles (concat dir mark) - articles (file-name-as-directory articles) - mark-sym (intern mark) - ranges nil) - (catch 'got-ranges - (if (memq mark-sym never-marks) (throw 'got-ranges nil)) - (when (memq mark-sym always-marks) - (setq ranges (list (cons 1 last))) - (throw 'got-ranges nil)) - (setq mtime (file-attributes articles) - mtime (nth 5 mtime)) - (set (intern mark new-mmth) mtime) - (when (equal mtime (symbol-value (intern-soft mark old-mmth))) - (setq ranges (assq mark-sym old-marks)) - (if ranges (setq ranges (cdr ranges))) - (throw 'got-ranges nil)) - (setq articles (funcall ls articles nil "\\`[^.]" 'nosort)) - (while articles - (setq article (car articles) articles (cdr articles) - article (nnmaildir--flist-art flist article)) - (if article - (setq num (nnmaildir--art-get-num article) - ranges (gnus-add-to-range ranges (list num)))))) - (if (eq mark-sym 'read) (setq read ranges) - (if ranges (setq marks (cons (cons mark-sym ranges) marks))))) + (setq mark (car markdirs) markdirs (cdr markdirs) + articles (concat dir mark) + articles (file-name-as-directory articles) + mark-sym (intern mark) + ranges nil) + (catch 'got-ranges + (if (memq mark-sym never-marks) (throw 'got-ranges nil)) + (when (memq mark-sym always-marks) + (setq ranges (list (cons 1 last))) + (throw 'got-ranges nil)) + (setq mtime (file-attributes articles) + mtime (nth 5 mtime)) + (set (intern mark new-mmth) mtime) + (when (equal mtime (symbol-value (intern-soft mark old-mmth))) + (setq ranges (assq mark-sym old-marks)) + (if ranges (setq ranges (cdr ranges))) + (throw 'got-ranges nil)) + (setq articles (funcall ls articles nil "\\`[^.]" 'nosort)) + (while articles + (setq article (car articles) articles (cdr articles) + article (nnmaildir--flist-art flist article)) + (if article + (setq num (nnmaildir--art-get-num article) + ranges (gnus-add-to-range ranges (list num)))))) + (if (eq mark-sym 'read) (setq read ranges) + (if ranges (setq marks (cons (cons mark-sym ranges) marks))))) (gnus-info-set-read info read) (gnus-info-set-marks info marks 'extend) (nnmaildir--grp-set-mmth group new-mmth) @@ -913,62 +913,62 @@ by nnmaildir-request-article.") (defun nnmaildir-request-group (gname &optional server fast) (nnmaildir-request-scan gname server) (let ((group (nnmaildir--prepare server gname)) - ct-min deactivate-mark) + ct-min deactivate-mark) (save-excursion (set-buffer nntp-server-buffer) (erase-buffer) (catch 'return - (if group nil - (insert "411 no such news group\n") - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "No such group: " gname)) - (throw 'return nil)) - (nnmaildir--srv-set-curgrp nnmaildir--cur-server group) - (if fast (throw 'return t)) - (setq ct-min (nnmaildir--article-count group)) - (insert "211 ") - (princ (car ct-min) nntp-server-buffer) - (insert " ") - (princ (cdr ct-min) nntp-server-buffer) - (insert " ") - (princ (nnmaildir--nlist-last-num - (nnmaildir--lists-get-nlist - (nnmaildir--grp-get-lists group))) - nntp-server-buffer) - (insert " " gname "\n") - t)))) + (if group nil + (insert "411 no such news group\n") + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "No such group: " gname)) + (throw 'return nil)) + (nnmaildir--srv-set-curgrp nnmaildir--cur-server group) + (if fast (throw 'return t)) + (setq ct-min (nnmaildir--article-count group)) + (insert "211 ") + (princ (car ct-min) nntp-server-buffer) + (insert " ") + (princ (cdr ct-min) nntp-server-buffer) + (insert " ") + (princ (nnmaildir--nlist-last-num + (nnmaildir--lists-get-nlist + (nnmaildir--grp-get-lists group))) + nntp-server-buffer) + (insert " " gname "\n") + t)))) (defun nnmaildir-request-create-group (gname &optional server args) (nnmaildir--prepare server nil) (catch 'return (let ((create-dir (nnmaildir--srv-get-create-dir nnmaildir--cur-server)) - srv-dir dir groups) + srv-dir dir groups) (when (zerop (length gname)) - (nnmaildir--srv-set-error nnmaildir--cur-server - "Invalid (empty) group name") - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + "Invalid (empty) group name") + (throw 'return nil)) (when (eq (aref "." 0) (aref gname 0)) - (nnmaildir--srv-set-error nnmaildir--cur-server - "Group names may not start with \".\"") - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + "Group names may not start with \".\"") + (throw 'return nil)) (when (save-match-data (string-match "[\0/\t]" gname)) - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "Illegal characters (null, tab, or /) in group name: " - gname)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "Illegal characters (null, tab, or /) in group name: " + gname)) + (throw 'return nil)) (setq groups (nnmaildir--srv-get-groups nnmaildir--cur-server)) (when (intern-soft gname groups) - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "Group already exists: " gname)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "Group already exists: " gname)) + (throw 'return nil)) (setq srv-dir (nnmaildir--srv-get-dir nnmaildir--cur-server)) (if (file-name-absolute-p create-dir) - (setq dir (expand-file-name create-dir)) - (setq dir srv-dir - dir (file-truename dir) - dir (concat dir create-dir))) + (setq dir (expand-file-name create-dir)) + (setq dir srv-dir + dir (file-truename dir) + dir (concat dir create-dir))) (setq dir (file-name-as-directory dir) - dir (concat dir gname)) + dir (concat dir gname)) (nnmaildir--mkdir dir) (setq dir (file-name-as-directory dir)) (nnmaildir--mkdir (concat dir "tmp")) @@ -980,50 +980,50 @@ by nnmaildir-request-article.") (defun nnmaildir-request-rename-group (gname new-name &optional server) (let ((group (nnmaildir--prepare server gname)) - (coding-system-for-write nnheader-file-coding-system) - (buffer-file-coding-system nil) - (file-coding-system-alist nil) - srv-dir x groups) + (coding-system-for-write nnheader-file-coding-system) + (buffer-file-coding-system nil) + (file-coding-system-alist nil) + srv-dir x groups) (catch 'return (if group nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "No such group: " gname)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "No such group: " gname)) + (throw 'return nil)) (when (zerop (length new-name)) - (nnmaildir--srv-set-error nnmaildir--cur-server - "Invalid (empty) group name") - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + "Invalid (empty) group name") + (throw 'return nil)) (when (eq (aref "." 0) (aref new-name 0)) - (nnmaildir--srv-set-error nnmaildir--cur-server - "Group names may not start with \".\"") - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + "Group names may not start with \".\"") + (throw 'return nil)) (when (save-match-data (string-match "[\0/\t]" new-name)) - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "Illegal characters (null, tab, or /) in group name: " - new-name)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "Illegal characters (null, tab, or /) in group name: " + new-name)) + (throw 'return nil)) (if (string-equal gname new-name) (throw 'return t)) (when (intern-soft new-name - (nnmaildir--srv-get-groups nnmaildir--cur-server)) - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "Group already exists: " new-name)) - (throw 'return nil)) + (nnmaildir--srv-get-groups nnmaildir--cur-server)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "Group already exists: " new-name)) + (throw 'return nil)) (setq srv-dir (nnmaildir--srv-get-dir nnmaildir--cur-server)) (condition-case err - (rename-file (concat srv-dir gname) - (concat srv-dir new-name)) - (error - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "Error renaming link: " - (prin1-to-string err))) - (throw 'return nil))) + (rename-file (concat srv-dir gname) + (concat srv-dir new-name)) + (error + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "Error renaming link: " + (prin1-to-string err))) + (throw 'return nil))) (setq x (nnmaildir--srv-get-groups nnmaildir--cur-server) - groups (make-vector (length x) 0)) + groups (make-vector (length x) 0)) (mapatoms (lambda (sym) - (if (eq (symbol-value sym) group) nil - (set (intern (symbol-name sym) groups) - (symbol-value sym)))) - x) + (if (eq (symbol-value sym) group) nil + (set (intern (symbol-name sym) groups) + (symbol-value sym)))) + x) (setq group (copy-sequence group)) (nnmaildir--grp-set-name group new-name) (set (intern new-name groups) group) @@ -1032,215 +1032,215 @@ by nnmaildir-request-article.") (defun nnmaildir-request-delete-group (gname force &optional server) (let ((group (nnmaildir--prepare server gname)) - pgname grp-dir dir dirs files ls deactivate-mark) + pgname grp-dir dir dirs files ls deactivate-mark) (catch 'return (if group nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "No such group: " gname)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "No such group: " gname)) + (throw 'return nil)) (if (eq group (nnmaildir--srv-get-curgrp nnmaildir--cur-server)) - (nnmaildir--srv-set-curgrp nnmaildir--cur-server nil)) + (nnmaildir--srv-set-curgrp nnmaildir--cur-server nil)) (setq gname (nnmaildir--grp-get-name group) - pgname (nnmaildir--grp-get-pname group)) + pgname (nnmaildir--grp-get-pname group)) (unintern gname (nnmaildir--srv-get-groups nnmaildir--cur-server)) (setq grp-dir (nnmaildir--srv-get-dir nnmaildir--cur-server) - grp-dir (nnmaildir--srv-grp-dir grp-dir gname)) + grp-dir (nnmaildir--srv-grp-dir grp-dir gname)) (if (not force) (setq grp-dir (directory-file-name grp-dir)) - (if (nnmaildir--param pgname 'read-only) - (progn (delete-directory (nnmaildir--tmp grp-dir)) - (nnmaildir--unlink (nnmaildir--new grp-dir)) - (delete-directory (nnmaildir--cur grp-dir))) - (save-excursion - (set-buffer (get-buffer-create " *nnmaildir work*")) - (erase-buffer) - (setq ls (or (nnmaildir--param pgname 'directory-files) - (nnmaildir--srv-get-ls nnmaildir--cur-server)) - files (funcall ls (nnmaildir--tmp grp-dir) 'full "\\`[^.]" - 'nosort)) - (while files - (delete-file (car files)) - (setq files (cdr files))) - (delete-directory (concat grp-dir "tmp")) - (setq files (funcall ls (nnmaildir--new grp-dir) 'full "\\`[^.]" - 'nosort)) - (while files - (delete-file (car files)) - (setq files (cdr files))) - (delete-directory (concat grp-dir "new")) - (setq files (funcall ls (nnmaildir--cur grp-dir) 'full "\\`[^.]" - 'nosort)) - (while files - (delete-file (car files)) - (setq files (cdr files))) - (delete-directory (concat grp-dir "cur")))) - (setq dir (nnmaildir--nndir grp-dir) - dirs (cons (concat dir "nov") - (funcall ls (concat dir "marks") 'full "\\`[^.]" - 'nosort))) - (while dirs - (setq dir (car dirs) dirs (cdr dirs) - files (funcall ls dir 'full "\\`[^.]" 'nosort)) - (while files - (delete-file (car files)) - (setq files (cdr files))) - (delete-directory dir)) - (setq dir (nnmaildir--nndir grp-dir) - files (concat dir "markfile")) - (nnmaildir--unlink files) - (delete-directory (concat dir "marks")) - (delete-directory dir) - (setq grp-dir (directory-file-name grp-dir) - dir (car (file-attributes grp-dir))) - (if (eq (aref "/" 0) (aref dir 0)) nil - (setq dir (concat (file-truename - (nnmaildir--srv-get-dir nnmaildir--cur-server)) - dir))) - (delete-directory dir)) + (if (nnmaildir--param pgname 'read-only) + (progn (delete-directory (nnmaildir--tmp grp-dir)) + (nnmaildir--unlink (nnmaildir--new grp-dir)) + (delete-directory (nnmaildir--cur grp-dir))) + (save-excursion + (set-buffer (get-buffer-create " *nnmaildir work*")) + (erase-buffer) + (setq ls (or (nnmaildir--param pgname 'directory-files) + (nnmaildir--srv-get-ls nnmaildir--cur-server)) + files (funcall ls (nnmaildir--tmp grp-dir) 'full "\\`[^.]" + 'nosort)) + (while files + (delete-file (car files)) + (setq files (cdr files))) + (delete-directory (concat grp-dir "tmp")) + (setq files (funcall ls (nnmaildir--new grp-dir) 'full "\\`[^.]" + 'nosort)) + (while files + (delete-file (car files)) + (setq files (cdr files))) + (delete-directory (concat grp-dir "new")) + (setq files (funcall ls (nnmaildir--cur grp-dir) 'full "\\`[^.]" + 'nosort)) + (while files + (delete-file (car files)) + (setq files (cdr files))) + (delete-directory (concat grp-dir "cur")))) + (setq dir (nnmaildir--nndir grp-dir) + dirs (cons (concat dir "nov") + (funcall ls (concat dir "marks") 'full "\\`[^.]" + 'nosort))) + (while dirs + (setq dir (car dirs) dirs (cdr dirs) + files (funcall ls dir 'full "\\`[^.]" 'nosort)) + (while files + (delete-file (car files)) + (setq files (cdr files))) + (delete-directory dir)) + (setq dir (nnmaildir--nndir grp-dir) + files (concat dir "markfile")) + (nnmaildir--unlink files) + (delete-directory (concat dir "marks")) + (delete-directory dir) + (setq grp-dir (directory-file-name grp-dir) + dir (car (file-attributes grp-dir))) + (if (eq (aref "/" 0) (aref dir 0)) nil + (setq dir (concat (file-truename + (nnmaildir--srv-get-dir nnmaildir--cur-server)) + dir))) + (delete-directory dir)) (nnmaildir--unlink grp-dir) t))) (defun nnmaildir-retrieve-headers (articles &optional gname server fetch-old) (let ((group (nnmaildir--prepare server gname)) - srv-dir dir nlist mlist article num stop nov nlist2 deactivate-mark) + srv-dir dir nlist mlist article num stop nov nlist2 deactivate-mark) (catch 'return (if group nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (if gname (concat "No such group: " gname) - "No current group")) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (if gname (concat "No such group: " gname) + "No current group")) + (throw 'return nil)) (save-excursion - (set-buffer nntp-server-buffer) - (erase-buffer) - (setq nlist (nnmaildir--grp-get-lists group) - mlist (nnmaildir--lists-get-mlist nlist) - nlist (nnmaildir--lists-get-nlist nlist) - gname (nnmaildir--grp-get-name group) - srv-dir (nnmaildir--srv-get-dir nnmaildir--cur-server) - dir (nnmaildir--srv-grp-dir srv-dir gname)) - (cond - ((null nlist)) - ((and fetch-old (not (numberp fetch-old))) - (while nlist - (setq article (car nlist) nlist (cdr nlist) - nov (nnmaildir--update-nov srv-dir group article)) - (when nov - (nnmaildir--cache-nov group article nov) - (setq num (nnmaildir--art-get-num article)) - (princ num nntp-server-buffer) - (insert "\t" (nnmaildir--nov-get-beg nov) "\t" - (nnmaildir--art-get-msgid article) "\t" - (nnmaildir--nov-get-mid nov) "\tXref: nnmaildir " gname - ":") - (princ num nntp-server-buffer) - (insert "\t" (nnmaildir--nov-get-end nov) "\n") - (goto-char (point-min))))) - ((null articles)) - ((stringp (car articles)) - (while articles - (setq article (car articles) articles (cdr articles) - article (nnmaildir--mlist-art mlist article)) - (when (and article - (setq nov (nnmaildir--update-nov srv-dir group - article))) - (nnmaildir--cache-nov group article nov) - (setq num (nnmaildir--art-get-num article)) - (princ num nntp-server-buffer) - (insert "\t" (nnmaildir--nov-get-beg nov) "\t" - (nnmaildir--art-get-msgid article) "\t" - (nnmaildir--nov-get-mid nov) "\tXref: nnmaildir " gname - ":") - (princ num nntp-server-buffer) - (insert "\t" (nnmaildir--nov-get-end nov) "\n")))) - (t - (if fetch-old - ;; Assume the article range is sorted ascending - (setq stop (car articles) - num (car (last articles)) - stop (if (numberp stop) stop (car stop)) - num (if (numberp num) num (cdr num)) - stop (- stop fetch-old) - stop (if (< stop 1) 1 stop) - articles (list (cons stop num)))) - (while articles - (setq stop (car articles) articles (cdr articles)) - (while (eq stop (car articles)) - (setq articles (cdr articles))) - (if (numberp stop) (setq num stop) - (setq num (cdr stop) stop (car stop))) - (setq nlist2 (nthcdr (- (nnmaildir--art-get-num (car nlist)) num) - nlist)) - (while (and nlist2 - (setq article (car nlist2) - num (nnmaildir--art-get-num article)) - (>= num stop)) - (setq nlist2 (cdr nlist2) - nov (nnmaildir--update-nov srv-dir group article)) - (when nov - (nnmaildir--cache-nov group article nov) - (princ num nntp-server-buffer) - (insert "\t" (nnmaildir--nov-get-beg nov) "\t" - (nnmaildir--art-get-msgid article) "\t" - (nnmaildir--nov-get-mid nov) "\tXref: nnmaildir " gname - ":") - (princ num nntp-server-buffer) - (insert "\t" (nnmaildir--nov-get-end nov) "\n") - (goto-char (point-min))))))) - (sort-numeric-fields 1 (point-min) (point-max)) - 'nov)))) + (set-buffer nntp-server-buffer) + (erase-buffer) + (setq nlist (nnmaildir--grp-get-lists group) + mlist (nnmaildir--lists-get-mlist nlist) + nlist (nnmaildir--lists-get-nlist nlist) + gname (nnmaildir--grp-get-name group) + srv-dir (nnmaildir--srv-get-dir nnmaildir--cur-server) + dir (nnmaildir--srv-grp-dir srv-dir gname)) + (cond + ((null nlist)) + ((and fetch-old (not (numberp fetch-old))) + (while nlist + (setq article (car nlist) nlist (cdr nlist) + nov (nnmaildir--update-nov srv-dir group article)) + (when nov + (nnmaildir--cache-nov group article nov) + (setq num (nnmaildir--art-get-num article)) + (princ num nntp-server-buffer) + (insert "\t" (nnmaildir--nov-get-beg nov) "\t" + (nnmaildir--art-get-msgid article) "\t" + (nnmaildir--nov-get-mid nov) "\tXref: nnmaildir " gname + ":") + (princ num nntp-server-buffer) + (insert "\t" (nnmaildir--nov-get-end nov) "\n") + (goto-char (point-min))))) + ((null articles)) + ((stringp (car articles)) + (while articles + (setq article (car articles) articles (cdr articles) + article (nnmaildir--mlist-art mlist article)) + (when (and article + (setq nov (nnmaildir--update-nov srv-dir group + article))) + (nnmaildir--cache-nov group article nov) + (setq num (nnmaildir--art-get-num article)) + (princ num nntp-server-buffer) + (insert "\t" (nnmaildir--nov-get-beg nov) "\t" + (nnmaildir--art-get-msgid article) "\t" + (nnmaildir--nov-get-mid nov) "\tXref: nnmaildir " gname + ":") + (princ num nntp-server-buffer) + (insert "\t" (nnmaildir--nov-get-end nov) "\n")))) + (t + (if fetch-old + ;; Assume the article range is sorted ascending + (setq stop (car articles) + num (car (last articles)) + stop (if (numberp stop) stop (car stop)) + num (if (numberp num) num (cdr num)) + stop (- stop fetch-old) + stop (if (< stop 1) 1 stop) + articles (list (cons stop num)))) + (while articles + (setq stop (car articles) articles (cdr articles)) + (while (eq stop (car articles)) + (setq articles (cdr articles))) + (if (numberp stop) (setq num stop) + (setq num (cdr stop) stop (car stop))) + (setq nlist2 (nthcdr (- (nnmaildir--art-get-num (car nlist)) num) + nlist)) + (while (and nlist2 + (setq article (car nlist2) + num (nnmaildir--art-get-num article)) + (>= num stop)) + (setq nlist2 (cdr nlist2) + nov (nnmaildir--update-nov srv-dir group article)) + (when nov + (nnmaildir--cache-nov group article nov) + (princ num nntp-server-buffer) + (insert "\t" (nnmaildir--nov-get-beg nov) "\t" + (nnmaildir--art-get-msgid article) "\t" + (nnmaildir--nov-get-mid nov) "\tXref: nnmaildir " gname + ":") + (princ num nntp-server-buffer) + (insert "\t" (nnmaildir--nov-get-end nov) "\n") + (goto-char (point-min))))))) + (sort-numeric-fields 1 (point-min) (point-max)) + 'nov)))) (defun nnmaildir-request-article (num-msgid &optional gname server to-buffer) (let ((group (nnmaildir--prepare server gname)) - (case-fold-search t) - list article suffix dir deactivate-mark) + (case-fold-search t) + list article suffix dir deactivate-mark) (catch 'return (if group nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (if gname (concat "No such group: " gname) - "No current group")) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (if gname (concat "No such group: " gname) + "No current group")) + (throw 'return nil)) (setq list (nnmaildir--grp-get-lists group)) (if (numberp num-msgid) - (setq list (nnmaildir--lists-get-nlist list) - article (nnmaildir--nlist-art list num-msgid)) - (setq list (nnmaildir--lists-get-mlist list) - article (nnmaildir--mlist-art list num-msgid)) - (if article (setq num-msgid (nnmaildir--art-get-num article)) - (catch 'found - (mapatoms - (lambda (grp) - (setq group (symbol-value grp) - list (nnmaildir--grp-get-lists group) - list (nnmaildir--lists-get-mlist list) - article (nnmaildir--mlist-art list num-msgid)) - (when article - (setq num-msgid (nnmaildir--art-get-num article)) - (throw 'found nil))) - (nnmaildir--srv-get-groups nnmaildir--cur-server))))) + (setq list (nnmaildir--lists-get-nlist list) + article (nnmaildir--nlist-art list num-msgid)) + (setq list (nnmaildir--lists-get-mlist list) + article (nnmaildir--mlist-art list num-msgid)) + (if article (setq num-msgid (nnmaildir--art-get-num article)) + (catch 'found + (mapatoms + (lambda (grp) + (setq group (symbol-value grp) + list (nnmaildir--grp-get-lists group) + list (nnmaildir--lists-get-mlist list) + article (nnmaildir--mlist-art list num-msgid)) + (when article + (setq num-msgid (nnmaildir--art-get-num article)) + (throw 'found nil))) + (nnmaildir--srv-get-groups nnmaildir--cur-server))))) (if article nil - (nnmaildir--srv-set-error nnmaildir--cur-server "No such article") - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server "No such article") + (throw 'return nil)) (if (stringp (setq suffix (nnmaildir--art-get-suffix article))) nil - (nnmaildir--srv-set-error nnmaildir--cur-server "Article has expired") - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server "Article has expired") + (throw 'return nil)) (setq gname (nnmaildir--grp-get-name group) - dir (nnmaildir--srv-get-dir nnmaildir--cur-server) - dir (nnmaildir--srv-grp-dir dir gname) - group (if (nnmaildir--param (nnmaildir--grp-get-pname group) - 'read-only) - (nnmaildir--new dir) (nnmaildir--cur dir)) - nnmaildir-article-file-name (concat group - (nnmaildir--art-get-prefix - article) - suffix)) + dir (nnmaildir--srv-get-dir nnmaildir--cur-server) + dir (nnmaildir--srv-grp-dir dir gname) + group (if (nnmaildir--param (nnmaildir--grp-get-pname group) + 'read-only) + (nnmaildir--new dir) (nnmaildir--cur dir)) + nnmaildir-article-file-name (concat group + (nnmaildir--art-get-prefix + article) + suffix)) (if (file-exists-p nnmaildir-article-file-name) nil - (nnmaildir--art-set-suffix article 'expire) - (nnmaildir--art-set-nov article nil) - (nnmaildir--srv-set-error nnmaildir--cur-server "Article has expired") - (throw 'return nil)) + (nnmaildir--art-set-suffix article 'expire) + (nnmaildir--art-set-nov article nil) + (nnmaildir--srv-set-error nnmaildir--cur-server "Article has expired") + (throw 'return nil)) (save-excursion - (set-buffer (or to-buffer nntp-server-buffer)) - (erase-buffer) - (nnheader-insert-file-contents nnmaildir-article-file-name)) + (set-buffer (or to-buffer nntp-server-buffer)) + (erase-buffer) + (nnheader-insert-file-contents nnmaildir-article-file-name)) (cons gname num-msgid)))) (defun nnmaildir-request-post (&optional server) @@ -1249,153 +1249,153 @@ by nnmaildir-request-article.") (defun nnmaildir-request-replace-article (article gname buffer) (let ((group (nnmaildir--prepare nil gname)) - (coding-system-for-write nnheader-file-coding-system) - (buffer-file-coding-system nil) - (file-coding-system-alist nil) - file dir suffix tmpfile deactivate-mark) + (coding-system-for-write nnheader-file-coding-system) + (buffer-file-coding-system nil) + (file-coding-system-alist nil) + file dir suffix tmpfile deactivate-mark) (catch 'return (if group nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "No such group: " gname)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "No such group: " gname)) + (throw 'return nil)) (when (nnmaildir--param (nnmaildir--grp-get-pname group) 'read-only) - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "Read-only group: " group)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "Read-only group: " group)) + (throw 'return nil)) (setq dir (nnmaildir--srv-get-dir nnmaildir--cur-server) - dir (nnmaildir--srv-grp-dir dir gname) - file (nnmaildir--grp-get-lists group) - file (nnmaildir--lists-get-nlist file) - file (nnmaildir--nlist-art file article)) + dir (nnmaildir--srv-grp-dir dir gname) + file (nnmaildir--grp-get-lists group) + file (nnmaildir--lists-get-nlist file) + file (nnmaildir--nlist-art file article)) (if (and file (stringp (setq suffix (nnmaildir--art-get-suffix file)))) - nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (format "No such article: %d" article)) - (throw 'return nil)) + nil + (nnmaildir--srv-set-error nnmaildir--cur-server + (format "No such article: %d" article)) + (throw 'return nil)) (save-excursion - (set-buffer buffer) - (setq article file - file (nnmaildir--art-get-prefix article) - tmpfile (concat (nnmaildir--tmp dir) file)) - (when (file-exists-p tmpfile) - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "File exists: " tmpfile)) - (throw 'return nil)) - (write-region (point-min) (point-max) tmpfile nil 'no-message nil - 'confirm-overwrite)) ;; error would be preferred :( + (set-buffer buffer) + (setq article file + file (nnmaildir--art-get-prefix article) + tmpfile (concat (nnmaildir--tmp dir) file)) + (when (file-exists-p tmpfile) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "File exists: " tmpfile)) + (throw 'return nil)) + (write-region (point-min) (point-max) tmpfile nil 'no-message nil + 'confirm-overwrite)) ;; error would be preferred :( (unix-sync) ;; no fsync :( (rename-file tmpfile (concat (nnmaildir--cur dir) file suffix) 'replace) t))) (defun nnmaildir-request-move-article (article gname server accept-form - &optional last) + &optional last) (let ((group (nnmaildir--prepare server gname)) - pgname list suffix result nnmaildir--file deactivate-mark) + pgname list suffix result nnmaildir--file deactivate-mark) (catch 'return (if group nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "No such group: " gname)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "No such group: " gname)) + (throw 'return nil)) (setq gname (nnmaildir--grp-get-name group) - pgname (nnmaildir--grp-get-pname group) - list (nnmaildir--grp-get-lists group) - list (nnmaildir--lists-get-nlist list) - article (nnmaildir--nlist-art list article)) + pgname (nnmaildir--grp-get-pname group) + list (nnmaildir--grp-get-lists group) + list (nnmaildir--lists-get-nlist list) + article (nnmaildir--nlist-art list article)) (if article nil - (nnmaildir--srv-set-error nnmaildir--cur-server "No such article") - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server "No such article") + (throw 'return nil)) (if (stringp (setq suffix (nnmaildir--art-get-suffix article))) nil - (nnmaildir--srv-set-error nnmaildir--cur-server "Article has expired") - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server "Article has expired") + (throw 'return nil)) (setq nnmaildir--file (nnmaildir--srv-get-dir nnmaildir--cur-server) - nnmaildir--file (nnmaildir--srv-grp-dir nnmaildir--file gname) - nnmaildir--file (if (nnmaildir--param pgname 'read-only) - (nnmaildir--new nnmaildir--file) - (nnmaildir--cur nnmaildir--file)) - nnmaildir--file (concat nnmaildir--file - (nnmaildir--art-get-prefix article) - suffix)) + nnmaildir--file (nnmaildir--srv-grp-dir nnmaildir--file gname) + nnmaildir--file (if (nnmaildir--param pgname 'read-only) + (nnmaildir--new nnmaildir--file) + (nnmaildir--cur nnmaildir--file)) + nnmaildir--file (concat nnmaildir--file + (nnmaildir--art-get-prefix article) + suffix)) (if (file-exists-p nnmaildir--file) nil - (nnmaildir--art-set-suffix article 'expire) - (nnmaildir--art-set-nov article nil) - (nnmaildir--srv-set-error nnmaildir--cur-server "Article has expired") - (throw 'return nil)) + (nnmaildir--art-set-suffix article 'expire) + (nnmaildir--art-set-nov article nil) + (nnmaildir--srv-set-error nnmaildir--cur-server "Article has expired") + (throw 'return nil)) (save-excursion - (set-buffer (get-buffer-create " *nnmaildir move*")) - (erase-buffer) - (nnheader-insert-file-contents nnmaildir--file) - (setq result (eval accept-form))) + (set-buffer (get-buffer-create " *nnmaildir move*")) + (erase-buffer) + (nnheader-insert-file-contents nnmaildir--file) + (setq result (eval accept-form))) (if (or (null result) (nnmaildir--param pgname 'read-only)) nil - (nnmaildir--unlink nnmaildir--file) - (nnmaildir--art-set-suffix article 'expire) - (nnmaildir--art-set-nov article nil)) + (nnmaildir--unlink nnmaildir--file) + (nnmaildir--art-set-suffix article 'expire) + (nnmaildir--art-set-nov article nil)) result))) (defun nnmaildir-request-accept-article (gname &optional server last) (let ((group (nnmaildir--prepare server gname)) - (coding-system-for-write nnheader-file-coding-system) - (buffer-file-coding-system nil) - (file-coding-system-alist nil) - srv-dir dir file tmpfile curfile 24h num article) + (coding-system-for-write nnheader-file-coding-system) + (buffer-file-coding-system nil) + (file-coding-system-alist nil) + srv-dir dir file tmpfile curfile 24h num article) (catch 'return (if group nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "No such group: " gname)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "No such group: " gname)) + (throw 'return nil)) (setq gname (nnmaildir--grp-get-name group)) (when (nnmaildir--param (nnmaildir--grp-get-pname group) 'read-only) - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "Read-only group: " gname)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "Read-only group: " gname)) + (throw 'return nil)) (setq srv-dir (nnmaildir--srv-get-dir nnmaildir--cur-server) - dir (nnmaildir--srv-grp-dir srv-dir gname) - file (format-time-string "%s" nil)) + dir (nnmaildir--srv-grp-dir srv-dir gname) + file (format-time-string "%s" nil)) (if (string= nnmaildir--delivery-time file) nil - (setq nnmaildir--delivery-time file - nnmaildir--delivery-ct 0)) + (setq nnmaildir--delivery-time file + nnmaildir--delivery-ct 0)) (setq file (concat file "." nnmaildir--delivery-pid)) (if (zerop nnmaildir--delivery-ct) nil - (setq file (concat file "_" - (number-to-string nnmaildir--delivery-ct)))) + (setq file (concat file "_" + (number-to-string nnmaildir--delivery-ct)))) (setq file (concat file "." (system-name)) - tmpfile (concat (nnmaildir--tmp dir) file) - curfile (concat (nnmaildir--cur dir) file ":2,")) + tmpfile (concat (nnmaildir--tmp dir) file) + curfile (concat (nnmaildir--cur dir) file ":2,")) (when (file-exists-p tmpfile) - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "File exists: " tmpfile)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "File exists: " tmpfile)) + (throw 'return nil)) (when (file-exists-p curfile) - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "File exists: " curfile)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "File exists: " curfile)) + (throw 'return nil)) (setq nnmaildir--delivery-ct (1+ nnmaildir--delivery-ct) - 24h (run-with-timer 86400 nil - (lambda () - (nnmaildir--unlink tmpfile) - (nnmaildir--srv-set-error - nnmaildir--cur-server - "24-hour timer expired") - (throw 'return nil)))) + 24h (run-with-timer 86400 nil + (lambda () + (nnmaildir--unlink tmpfile) + (nnmaildir--srv-set-error + nnmaildir--cur-server + "24-hour timer expired") + (throw 'return nil)))) (condition-case nil - (add-name-to-file nnmaildir--file tmpfile) - (error - (write-region (point-min) (point-max) tmpfile nil 'no-message nil - 'confirm-overwrite) ;; error would be preferred :( - (unix-sync))) ;; no fsync :( + (add-name-to-file nnmaildir--file tmpfile) + (error + (write-region (point-min) (point-max) tmpfile nil 'no-message nil + 'confirm-overwrite) ;; error would be preferred :( + (unix-sync))) ;; no fsync :( (cancel-timer 24h) (condition-case err - (add-name-to-file tmpfile curfile) - (error - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "Error linking: " - (prin1-to-string err))) - (nnmaildir--unlink tmpfile) - (throw 'return nil))) + (add-name-to-file tmpfile curfile) + (error + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "Error linking: " + (prin1-to-string err))) + (nnmaildir--unlink tmpfile) + (throw 'return nil))) (nnmaildir--unlink tmpfile) (setq article (nnmaildir--art-new) - num (nnmaildir--grp-get-lists group) - num (nnmaildir--lists-get-nlist num) - num (1+ (nnmaildir--nlist-last-num num))) + num (nnmaildir--grp-get-lists group) + num (nnmaildir--lists-get-nlist num) + num (1+ (nnmaildir--nlist-last-num num))) (nnmaildir--art-set-prefix article file) (nnmaildir--art-set-suffix article ":2,") (nnmaildir--art-set-num article num) @@ -1406,247 +1406,247 @@ by nnmaildir-request-article.") (if group-art nil (throw 'return nil)) (let ((ret group-art) - ga gname x groups nnmaildir--file deactivate-mark) + ga gname x groups nnmaildir--file deactivate-mark) (save-excursion - (goto-char (point-min)) - (save-match-data - (while (looking-at "From ") - (replace-match "X-From-Line: ") - (forward-line 1)))) + (goto-char (point-min)) + (save-match-data + (while (looking-at "From ") + (replace-match "X-From-Line: ") + (forward-line 1)))) (setq groups (nnmaildir--srv-get-groups nnmaildir--cur-server) - ga (car group-art) group-art (cdr group-art) - gname (car ga)) + ga (car group-art) group-art (cdr group-art) + gname (car ga)) (or (intern-soft gname groups) - (nnmaildir-request-create-group gname) - (throw 'return nil)) ;; not that nnmail bothers to check :( + (nnmaildir-request-create-group gname) + (throw 'return nil)) ;; not that nnmail bothers to check :( (if (nnmaildir-request-accept-article gname) nil - (throw 'return nil)) + (throw 'return nil)) (setq x (nnmaildir--prepare nil gname) - nnmaildir--file (nnmaildir--srv-get-dir nnmaildir--cur-server) - nnmaildir--file (concat nnmaildir--file - (nnmaildir--grp-get-name x)) - nnmaildir--file (file-name-as-directory nnmaildir--file) - x (nnmaildir--grp-get-lists x) - x (nnmaildir--lists-get-nlist x) - x (car x) - nnmaildir--file (concat nnmaildir--file - (nnmaildir--art-get-prefix x) - (nnmaildir--art-get-suffix x))) + nnmaildir--file (nnmaildir--srv-get-dir nnmaildir--cur-server) + nnmaildir--file (concat nnmaildir--file + (nnmaildir--grp-get-name x)) + nnmaildir--file (file-name-as-directory nnmaildir--file) + x (nnmaildir--grp-get-lists x) + x (nnmaildir--lists-get-nlist x) + x (car x) + nnmaildir--file (concat nnmaildir--file + (nnmaildir--art-get-prefix x) + (nnmaildir--art-get-suffix x))) (while group-art - (setq ga (car group-art) group-art (cdr group-art) - gname (car ga)) - (if (and (or (intern-soft gname groups) - (nnmaildir-request-create-group gname)) - (nnmaildir-request-accept-article gname)) nil - (setq ret (delq ga ret)))) ;; We'll still try the other groups + (setq ga (car group-art) group-art (cdr group-art) + gname (car ga)) + (if (and (or (intern-soft gname groups) + (nnmaildir-request-create-group gname)) + (nnmaildir-request-accept-article gname)) nil + (setq ret (delq ga ret)))) ;; We'll still try the other groups ret))) (defun nnmaildir-active-number (group) (let ((x (nnmaildir--prepare nil group))) (catch 'return (if x nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "No such group: " group)) - (throw 'return nil)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "No such group: " group)) + (throw 'return nil)) (setq x (nnmaildir--grp-get-lists x) - x (nnmaildir--lists-get-nlist x)) + x (nnmaildir--lists-get-nlist x)) (if x - (setq x (car x) - x (nnmaildir--art-get-num x) - x (1+ x)) - 1)))) + (setq x (car x) + x (nnmaildir--art-get-num x) + x (1+ x)) + 1)))) (defun nnmaildir-request-expire-articles (ranges &optional gname server force) (let ((no-force (not force)) - (group (nnmaildir--prepare server gname)) - pgname time boundary time-iter bound-iter high low target dir nlist - stop number article didnt suffix nnmaildir--file - nnmaildir-article-file-name deactivate-mark) + (group (nnmaildir--prepare server gname)) + pgname time boundary time-iter bound-iter high low target dir nlist + stop number article didnt suffix nnmaildir--file + nnmaildir-article-file-name deactivate-mark) (catch 'return (if group nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (if gname (concat "No such group: " gname) - "No current group")) - (throw 'return (gnus-uncompress-range ranges))) + (nnmaildir--srv-set-error nnmaildir--cur-server + (if gname (concat "No such group: " gname) + "No current group")) + (throw 'return (gnus-uncompress-range ranges))) (setq gname (nnmaildir--grp-get-name group) - pgname (nnmaildir--grp-get-pname group)) + pgname (nnmaildir--grp-get-pname group)) (if (nnmaildir--param pgname 'read-only) - (throw 'return (gnus-uncompress-range ranges))) + (throw 'return (gnus-uncompress-range ranges))) (setq time (or (nnmaildir--param pgname 'expire-age) 604800)) (if (or force (integerp time)) nil - (throw 'return (gnus-uncompress-range ranges))) + (throw 'return (gnus-uncompress-range ranges))) (setq boundary (current-time) - high (- (car boundary) (/ time 65536)) - low (- (cadr boundary) (% time 65536))) + high (- (car boundary) (/ time 65536)) + low (- (cadr boundary) (% time 65536))) (if (< low 0) - (setq low (+ low 65536) - high (1- high))) + (setq low (+ low 65536) + high (1- high))) (setcar (cdr boundary) low) (setcar boundary high) (setq dir (nnmaildir--srv-get-dir nnmaildir--cur-server) - dir (nnmaildir--srv-grp-dir dir gname) - dir (nnmaildir--cur dir) - nlist (nnmaildir--grp-get-lists group) - nlist (nnmaildir--lists-get-nlist nlist) - ranges (reverse ranges)) + dir (nnmaildir--srv-grp-dir dir gname) + dir (nnmaildir--cur dir) + nlist (nnmaildir--grp-get-lists group) + nlist (nnmaildir--lists-get-nlist nlist) + ranges (reverse ranges)) (save-excursion - (set-buffer (get-buffer-create " *nnmaildir move*")) - (while ranges - (setq number (car ranges) ranges (cdr ranges)) - (while (eq number (car ranges)) - (setq ranges (cdr ranges))) - (if (numberp number) (setq stop number) - (setq stop (car number) number (cdr number))) - (setq nlist (nthcdr (- (nnmaildir--art-get-num (car nlist)) number) - nlist)) - (while (and nlist - (setq article (car nlist) - number (nnmaildir--art-get-num article)) - (>= number stop)) - (setq nlist (cdr nlist) - suffix (nnmaildir--art-get-suffix article)) - (catch 'continue - (if (stringp suffix) nil - (nnmaildir--art-set-suffix article 'expire) - (nnmaildir--art-set-nov article nil) - (throw 'continue nil)) - (setq nnmaildir--file (nnmaildir--art-get-prefix article) - nnmaildir--file (concat dir nnmaildir--file suffix) - time (file-attributes nnmaildir--file)) - (if time nil - (nnmaildir--art-set-suffix article 'expire) - (nnmaildir--art-set-nov article nil) - (throw 'continue nil)) - (setq time (nth 5 time) - time-iter time - bound-iter boundary) - (if (and no-force - (progn - (while (and bound-iter time-iter - (= (car bound-iter) (car time-iter))) - (setq bound-iter (cdr bound-iter) - time-iter (cdr time-iter))) - (and bound-iter time-iter - (car-less-than-car bound-iter time-iter)))) - (setq didnt (cons number didnt)) - (save-excursion - (setq nnmaildir-article-file-name nnmaildir--file - target (nnmaildir--param pgname 'expire-group))) - (when (and (stringp target) - (not (string-equal target pgname))) ;; Move it. - (erase-buffer) - (nnheader-insert-file-contents nnmaildir--file) - (gnus-request-accept-article target nil nil 'no-encode)) - (if (equal target pgname) - (setq didnt (cons number didnt)) ;; Leave it here. - (nnmaildir--unlink nnmaildir--file) - (nnmaildir--art-set-suffix article 'expire) - (nnmaildir--art-set-nov article nil)))))) - (erase-buffer)) + (set-buffer (get-buffer-create " *nnmaildir move*")) + (while ranges + (setq number (car ranges) ranges (cdr ranges)) + (while (eq number (car ranges)) + (setq ranges (cdr ranges))) + (if (numberp number) (setq stop number) + (setq stop (car number) number (cdr number))) + (setq nlist (nthcdr (- (nnmaildir--art-get-num (car nlist)) number) + nlist)) + (while (and nlist + (setq article (car nlist) + number (nnmaildir--art-get-num article)) + (>= number stop)) + (setq nlist (cdr nlist) + suffix (nnmaildir--art-get-suffix article)) + (catch 'continue + (if (stringp suffix) nil + (nnmaildir--art-set-suffix article 'expire) + (nnmaildir--art-set-nov article nil) + (throw 'continue nil)) + (setq nnmaildir--file (nnmaildir--art-get-prefix article) + nnmaildir--file (concat dir nnmaildir--file suffix) + time (file-attributes nnmaildir--file)) + (if time nil + (nnmaildir--art-set-suffix article 'expire) + (nnmaildir--art-set-nov article nil) + (throw 'continue nil)) + (setq time (nth 5 time) + time-iter time + bound-iter boundary) + (if (and no-force + (progn + (while (and bound-iter time-iter + (= (car bound-iter) (car time-iter))) + (setq bound-iter (cdr bound-iter) + time-iter (cdr time-iter))) + (and bound-iter time-iter + (car-less-than-car bound-iter time-iter)))) + (setq didnt (cons number didnt)) + (save-excursion + (setq nnmaildir-article-file-name nnmaildir--file + target (nnmaildir--param pgname 'expire-group))) + (when (and (stringp target) + (not (string-equal target pgname))) ;; Move it. + (erase-buffer) + (nnheader-insert-file-contents nnmaildir--file) + (gnus-request-accept-article target nil nil 'no-encode)) + (if (equal target pgname) + (setq didnt (cons number didnt)) ;; Leave it here. + (nnmaildir--unlink nnmaildir--file) + (nnmaildir--art-set-suffix article 'expire) + (nnmaildir--art-set-nov article nil)))))) + (erase-buffer)) didnt))) (defun nnmaildir-request-set-mark (gname actions &optional server) (let ((group (nnmaildir--prepare server gname)) - (coding-system-for-write nnheader-file-coding-system) - (buffer-file-coding-system nil) - (file-coding-system-alist nil) - del-mark add-marks marksdir markfile action group-nlist nlist ranges - begin end article all-marks todo-marks did-marks marks form mdir mfile - deactivate-mark) + (coding-system-for-write nnheader-file-coding-system) + (buffer-file-coding-system nil) + (file-coding-system-alist nil) + del-mark add-marks marksdir markfile action group-nlist nlist ranges + begin end article all-marks todo-marks did-marks marks form mdir mfile + deactivate-mark) (setq del-mark - (lambda () - (setq mfile (car marks) - mfile (symbol-name mfile) - mfile (concat marksdir mfile) - mfile (file-name-as-directory mfile) - mfile (concat mfile (nnmaildir--art-get-prefix article))) - (nnmaildir--unlink mfile)) - add-marks - (lambda () - (while marks - (setq mdir (concat marksdir (symbol-name (car marks))) - mfile (concat (file-name-as-directory mdir) - (nnmaildir--art-get-prefix article))) - (if (memq (car marks) did-marks) nil - (nnmaildir--mkdir mdir) - (setq did-marks (cons (car marks) did-marks))) - (if (file-exists-p mfile) nil - (condition-case nil - (add-name-to-file markfile mfile) - (file-error ;; too many links, probably - (if (file-exists-p mfile) nil - (nnmaildir--unlink markfile) - (write-region "" nil markfile nil 'no-message) - (add-name-to-file markfile mfile - 'ok-if-already-exists))))) - (setq marks (cdr marks))))) + (lambda () + (setq mfile (car marks) + mfile (symbol-name mfile) + mfile (concat marksdir mfile) + mfile (file-name-as-directory mfile) + mfile (concat mfile (nnmaildir--art-get-prefix article))) + (nnmaildir--unlink mfile)) + add-marks + (lambda () + (while marks + (setq mdir (concat marksdir (symbol-name (car marks))) + mfile (concat (file-name-as-directory mdir) + (nnmaildir--art-get-prefix article))) + (if (memq (car marks) did-marks) nil + (nnmaildir--mkdir mdir) + (setq did-marks (cons (car marks) did-marks))) + (if (file-exists-p mfile) nil + (condition-case nil + (add-name-to-file markfile mfile) + (file-error ;; too many links, probably + (if (file-exists-p mfile) nil + (nnmaildir--unlink markfile) + (write-region "" nil markfile nil 'no-message) + (add-name-to-file markfile mfile + 'ok-if-already-exists))))) + (setq marks (cdr marks))))) (catch 'return (if group nil - (nnmaildir--srv-set-error nnmaildir--cur-server - (concat "No such group: " gname)) - (while actions - (setq ranges (gnus-range-add ranges (caar actions)) - actions (cdr actions))) - (throw 'return ranges)) + (nnmaildir--srv-set-error nnmaildir--cur-server + (concat "No such group: " gname)) + (while actions + (setq ranges (gnus-range-add ranges (caar actions)) + actions (cdr actions))) + (throw 'return ranges)) (setq group-nlist (nnmaildir--grp-get-lists group) - group-nlist (nnmaildir--lists-get-nlist group-nlist) - marksdir (nnmaildir--srv-get-dir nnmaildir--cur-server) - marksdir (nnmaildir--srv-grp-dir marksdir gname) - marksdir (nnmaildir--nndir marksdir) - markfile (concat marksdir "markfile") - marksdir (concat marksdir "marks") - marksdir (file-name-as-directory marksdir) - gname (nnmaildir--grp-get-name group) - all-marks (nnmaildir--grp-get-pname group) - all-marks (or (nnmaildir--param all-marks 'directory-files) - (nnmaildir--srv-get-ls nnmaildir--cur-server)) - all-marks (funcall all-marks marksdir nil "\\`[^.]" 'nosort) - marks all-marks) + group-nlist (nnmaildir--lists-get-nlist group-nlist) + marksdir (nnmaildir--srv-get-dir nnmaildir--cur-server) + marksdir (nnmaildir--srv-grp-dir marksdir gname) + marksdir (nnmaildir--nndir marksdir) + markfile (concat marksdir "markfile") + marksdir (concat marksdir "marks") + marksdir (file-name-as-directory marksdir) + gname (nnmaildir--grp-get-name group) + all-marks (nnmaildir--grp-get-pname group) + all-marks (or (nnmaildir--param all-marks 'directory-files) + (nnmaildir--srv-get-ls nnmaildir--cur-server)) + all-marks (funcall all-marks marksdir nil "\\`[^.]" 'nosort) + marks all-marks) (while marks - (setcar marks (intern (car marks))) - (setq marks (cdr marks))) + (setcar marks (intern (car marks))) + (setq marks (cdr marks))) (while actions - (setq action (car actions) actions (cdr actions) - nlist group-nlist - ranges (car action) - todo-marks (caddr action) - marks todo-marks) - (while marks - (if (memq (car marks) all-marks) nil - (setq all-marks (cons (car marks) all-marks))) - (setq marks (cdr marks))) - (setq form - (cond - ((eq 'del (cadr action)) - '(while marks - (funcall del-mark) - (setq marks (cdr marks)))) - ((eq 'add (cadr action)) '(funcall add-marks)) - (t - '(progn - (funcall add-marks) - (setq marks all-marks) - (while marks - (if (memq (car marks) todo-marks) nil - (funcall del-mark)) - (setq marks (cdr marks))))))) - (if (numberp (cdr ranges)) (setq ranges (list ranges)) - (setq ranges (reverse ranges))) - (while ranges - (setq begin (car ranges) ranges (cdr ranges)) - (while (eq begin (car ranges)) - (setq ranges (cdr ranges))) - (if (numberp begin) (setq end begin) - (setq end (cdr begin) begin (car begin))) - (setq nlist (nthcdr (- (nnmaildir--art-get-num (car nlist)) end) - nlist)) - (while (and nlist - (setq article (car nlist)) - (>= (nnmaildir--art-get-num article) begin)) - (setq nlist (cdr nlist)) - (when (stringp (nnmaildir--art-get-suffix article)) - (setq marks todo-marks) - (eval form))))) + (setq action (car actions) actions (cdr actions) + nlist group-nlist + ranges (car action) + todo-marks (caddr action) + marks todo-marks) + (while marks + (if (memq (car marks) all-marks) nil + (setq all-marks (cons (car marks) all-marks))) + (setq marks (cdr marks))) + (setq form + (cond + ((eq 'del (cadr action)) + '(while marks + (funcall del-mark) + (setq marks (cdr marks)))) + ((eq 'add (cadr action)) '(funcall add-marks)) + (t + '(progn + (funcall add-marks) + (setq marks all-marks) + (while marks + (if (memq (car marks) todo-marks) nil + (funcall del-mark)) + (setq marks (cdr marks))))))) + (if (numberp (cdr ranges)) (setq ranges (list ranges)) + (setq ranges (reverse ranges))) + (while ranges + (setq begin (car ranges) ranges (cdr ranges)) + (while (eq begin (car ranges)) + (setq ranges (cdr ranges))) + (if (numberp begin) (setq end begin) + (setq end (cdr begin) begin (car begin))) + (setq nlist (nthcdr (- (nnmaildir--art-get-num (car nlist)) end) + nlist)) + (while (and nlist + (setq article (car nlist)) + (>= (nnmaildir--art-get-num article) begin)) + (setq nlist (cdr nlist)) + (when (stringp (nnmaildir--art-get-suffix article)) + (setq marks todo-marks) + (eval form))))) nil))) (defun nnmaildir-close-group (group &optional server) @@ -1658,51 +1658,51 @@ by nnmaildir-request-article.") (setq server nnmaildir--cur-server) (when server (setq nnmaildir--cur-server nil - srv-ls (nnmaildir--srv-get-ls server)) + srv-ls (nnmaildir--srv-get-ls server)) (save-match-data - (mapatoms - (lambda (group) - (setq group (symbol-value group) - x (nnmaildir--grp-get-pname group) - ls (nnmaildir--param x 'directory-files) - ls (or ls srv-ls) - dir (nnmaildir--srv-get-dir server) - dir (nnmaildir--srv-grp-dir - dir (nnmaildir--grp-get-name group)) - x (nnmaildir--param x 'read-only) - x (if x (nnmaildir--new dir) (nnmaildir--cur dir)) - files (funcall ls x nil "\\`[^.]" 'nosort) - x (length files) - flist 1) - (while (<= flist x) (setq flist (* 2 flist))) - (if (/= flist 1) (setq flist (1- flist))) - (setq flist (make-vector flist 0)) - (while files - (setq file (car files) files (cdr files)) - (string-match "\\`\\([^:]*\\)\\(:.*\\)?\\'" file) - (intern (match-string 1 file) flist)) - (setq dir (nnmaildir--nndir dir) - dirs (cons (concat dir "nov") - (funcall ls (concat dir "marks") 'full "\\`[^.]" - 'nosort))) - (while dirs - (setq dir (car dirs) dirs (cdr dirs) - files (funcall ls dir nil "\\`[^.]" 'nosort) - dir (file-name-as-directory dir)) - (while files - (setq file (car files) files (cdr files)) - (if (intern-soft file flist) nil - (setq file (concat dir file)) - (delete-file file))))) - (nnmaildir--srv-get-groups server))) + (mapatoms + (lambda (group) + (setq group (symbol-value group) + x (nnmaildir--grp-get-pname group) + ls (nnmaildir--param x 'directory-files) + ls (or ls srv-ls) + dir (nnmaildir--srv-get-dir server) + dir (nnmaildir--srv-grp-dir + dir (nnmaildir--grp-get-name group)) + x (nnmaildir--param x 'read-only) + x (if x (nnmaildir--new dir) (nnmaildir--cur dir)) + files (funcall ls x nil "\\`[^.]" 'nosort) + x (length files) + flist 1) + (while (<= flist x) (setq flist (* 2 flist))) + (if (/= flist 1) (setq flist (1- flist))) + (setq flist (make-vector flist 0)) + (while files + (setq file (car files) files (cdr files)) + (string-match "\\`\\([^:]*\\)\\(:.*\\)?\\'" file) + (intern (match-string 1 file) flist)) + (setq dir (nnmaildir--nndir dir) + dirs (cons (concat dir "nov") + (funcall ls (concat dir "marks") 'full "\\`[^.]" + 'nosort))) + (while dirs + (setq dir (car dirs) dirs (cdr dirs) + files (funcall ls dir nil "\\`[^.]" 'nosort) + dir (file-name-as-directory dir)) + (while files + (setq file (car files) files (cdr files)) + (if (intern-soft file flist) nil + (setq file (concat dir file)) + (delete-file file))))) + (nnmaildir--srv-get-groups server))) (unintern (nnmaildir--srv-get-name server) nnmaildir--servers))) t) (defun nnmaildir-request-close () (let (servers buffer) (mapatoms (lambda (server) - (setq servers (cons (symbol-name server) servers))) - nnmaildir--servers) + (setq servers (cons (symbol-name server) servers))) + nnmaildir--servers) (while servers (nnmaildir-close-server (car servers)) (setq servers (cdr servers))) diff --git a/lisp/nnmbox.el b/lisp/nnmbox.el index 72e144f3b..857adc597 100644 --- a/lisp/nnmbox.el +++ b/lisp/nnmbox.el @@ -4,7 +4,7 @@ ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen -;; Masanobu UMEDA +;; Masanobu UMEDA ;; Keywords: news, mail ;; This file is part of GNU Emacs. diff --git a/lisp/nnmh.el b/lisp/nnmh.el index d3f164ab2..0ab876739 100644 --- a/lisp/nnmh.el +++ b/lisp/nnmh.el @@ -4,7 +4,7 @@ ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen -;; Masanobu UMEDA +;; Masanobu UMEDA ;; Keywords: news, mail ;; This file is part of GNU Emacs. diff --git a/lisp/nnml.el b/lisp/nnml.el index 976b75a6e..b19bbf574 100644 --- a/lisp/nnml.el +++ b/lisp/nnml.el @@ -4,7 +4,7 @@ ;; Author: Simon Josefsson (adding MARKS) ;; Lars Magne Ingebrigtsen -;; Masanobu UMEDA +;; Masanobu UMEDA ;; Keywords: news, mail ;; This file is part of GNU Emacs. @@ -522,7 +522,7 @@ marks file will be regenerated properly by Gnus.") (expand-file-name file nnml-current-directory) (when (not nnheader-directory-files-is-safe) ;; Just to make sure nothing went wrong when reading over NFS -- - ;; check once more. + ;; check once more. (when (file-exists-p (setq file (expand-file-name (number-to-string article) nnml-current-directory))) @@ -893,7 +893,7 @@ Use the nov database for that directory if available." (defun nnml-current-group-article-to-file-alist () "Return an alist of article/file pairs in the current group. Use the nov database for the current group if available." - (if (or gnus-nov-is-evil + (if (or gnus-nov-is-evil nnml-nov-is-evil (not (file-exists-p (expand-file-name nnml-nov-file-name @@ -985,8 +985,8 @@ Use the nov database for the current group if available." (error "Cannot write to %s (%s)" err)))))) (defun nnml-open-marks (group server) - (let ((file (expand-file-name - nnml-marks-file-name + (let ((file (expand-file-name + nnml-marks-file-name (nnmail-group-pathname group nnml-directory)))) (if (file-exists-p file) (condition-case err diff --git a/lisp/nnoo.el b/lisp/nnoo.el index 8a360d9e1..028af25ea 100644 --- a/lisp/nnoo.el +++ b/lisp/nnoo.el @@ -201,8 +201,8 @@ (while (setq def (pop defs)) (unless (assq (car def) bvariables) (nconc bvariables - (list (cons (car def) (and (boundp (car def)) - (symbol-value (car def))))))) + (list (cons (car def) (and (boundp (car def)) + (symbol-value (car def))))))) (if (equal server "*internal-non-initialized-backend*") (set (car def) (symbol-value (cadr def))) (set (car def) (cadr def))))) diff --git a/lisp/nnrss.el b/lisp/nnrss.el index a0c29b91c..c8adc3600 100644 --- a/lisp/nnrss.el +++ b/lisp/nnrss.el @@ -176,7 +176,7 @@ To use the description in headers, put this name into `nnmail-extra-headers'.") (defvar nnrss-content-function nil "A function which is called in `nnrss-request-article'. The arguments are (ENTRY GROUP ARTICLE). -ENTRY is the record of the current headline. GROUP is the group name. +ENTRY is the record of the current headline. GROUP is the group name. ARTICLE is the article number of the current headline.") (nnoo-define-basics nnrss) @@ -271,7 +271,7 @@ ARTICLE is the article number of the current headline.") (fill-region point (point)))) (if (nth 2 e) (insert (nth 2 e) "\n")) - (if nnrss-content-function + (if nnrss-content-function (funcall nnrss-content-function e group article))))) (cond (err diff --git a/lisp/nnslashdot.el b/lisp/nnslashdot.el index 21156e968..6c160b8a9 100644 --- a/lisp/nnslashdot.el +++ b/lisp/nnslashdot.el @@ -91,7 +91,7 @@ (entry (assoc group nnslashdot-groups)) (sid (nth 2 entry)) (first-comments t) - headers article subject score from date lines parent point cid + headers article subject score from date lines parent point cid s startats changed) (save-excursion (set-buffer nnslashdot-buffer) @@ -189,7 +189,7 @@ (while (and articles (<= (car articles) article)) (pop articles)) (setq article (1+ article))) - (if nnslashdot-threaded + (if nnslashdot-threaded (progn (setq start (pop startats)) (if start (setq start (+ start 2)))) @@ -244,7 +244,7 @@ (when (numberp article) (if (= article 1) (progn - (re-search-forward + (re-search-forward "Posted by") (search-forward "
") (setq contents @@ -254,7 +254,7 @@ (re-search-forward "< [ \t\r\n]*" cid)) (setq contents diff --git a/lisp/nnsoup.el b/lisp/nnsoup.el index 306235bbd..f8d9b3811 100644 --- a/lisp/nnsoup.el +++ b/lisp/nnsoup.el @@ -4,7 +4,7 @@ ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen -;; Masanobu UMEDA +;; Masanobu UMEDA ;; Keywords: news, mail ;; This file is part of GNU Emacs. diff --git a/lisp/nnspool.el b/lisp/nnspool.el index e20d35527..d8709ec5e 100644 --- a/lisp/nnspool.el +++ b/lisp/nnspool.el @@ -1,11 +1,11 @@ ;;; nnspool.el --- spool access for GNU Emacs ;; Copyright (C) 1988, 1989, 1990, 1993, 1994, 1995, 1996, 1997, 1998, -;; 2000, 2002 +;; 2000, 2002 ;; Free Software Foundation, Inc. ;; Author: Masanobu UMEDA -;; Lars Magne Ingebrigtsen +;; Lars Magne Ingebrigtsen ;; Keywords: news ;; This file is part of GNU Emacs. @@ -364,7 +364,7 @@ there.") (let ((nov (nnheader-group-pathname nnspool-current-group nnspool-nov-directory ".overview")) (arts articles) - (nnheader-file-coding-system nnspool-file-coding-system) + (nnheader-file-coding-system nnspool-file-coding-system) last) (if (not (file-exists-p nov)) () diff --git a/lisp/nntp.el b/lisp/nntp.el index 3e0da85b6..92560b678 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -395,7 +395,7 @@ noticing asynchronous data.") (if process (prog1 (nntp-retrieve-data command - nntp-address nntp-port-number + nntp-address nntp-port-number nntp-server-buffer wait-for nnheader-callback-function) ;; If nothing to wait for, still remove possibly echo'ed commands @@ -420,7 +420,7 @@ noticing asynchronous data.") (if process (prog1 (nntp-retrieve-data command - nntp-address nntp-port-number + nntp-address nntp-port-number nntp-server-buffer wait-for nnheader-callback-function) ;; If nothing to wait for, still remove possibly echo'ed commands @@ -450,7 +450,7 @@ noticing asynchronous data.") (if process (prog1 (nntp-retrieve-data command - nntp-address nntp-port-number + nntp-address nntp-port-number nntp-server-buffer wait-for nnheader-callback-function t) ;; If nothing to wait for, still remove possibly echo'ed commands @@ -1412,7 +1412,7 @@ password contained in '~/.nntp-authinfo'." ;; If there is only one group in the Newsgroups ;; header, then it seems quite likely that this ;; article comes from that group, I'd say. - ((and (setq newsgroups + ((and (setq newsgroups (mail-fetch-field "newsgroups")) (not (string-match "," newsgroups))) newsgroups) @@ -1426,20 +1426,20 @@ password contained in '~/.nntp-authinfo'." ;; life. ((and (setq xref (mail-fetch-field "xref")) number - (string-match + (string-match (format "\\([^ :]+\\):%d" number) xref)) (match-string 1 xref)) (t ""))) (cond ((and (setq xref (mail-fetch-field "xref")) - (string-match + (string-match (if group (concat "\\(" (regexp-quote group) "\\):\\([0-9]+\\)") "\\([^ :]+\\):\\([0-9]+\\)") xref)) (setq group (match-string 1 xref) number (string-to-int (match-string 2 xref)))) - ((and (setq newsgroups + ((and (setq newsgroups (mail-fetch-field "newsgroups")) (not (string-match "," newsgroups))) (setq group newsgroups)) diff --git a/lisp/nnvirtual.el b/lisp/nnvirtual.el index 046c47071..60999379d 100644 --- a/lisp/nnvirtual.el +++ b/lisp/nnvirtual.el @@ -4,7 +4,7 @@ ;; Author: David Moore ;; Lars Magne Ingebrigtsen -;; Masanobu UMEDA +;; Masanobu UMEDA ;; Keywords: news ;; This file is part of GNU Emacs. diff --git a/lisp/nnweb.el b/lisp/nnweb.el index 34062eaa3..f747ab408 100644 --- a/lisp/nnweb.el +++ b/lisp/nnweb.el @@ -734,7 +734,7 @@ and `altavista'.") (while (re-search-forward "a href=/groups\\(\\?[^ \">]*selm=\\([^ &\">]+\\)\\)" nil t) (setq mid (match-string 2) - url (format + url (format "http://groups.google.com/groups?selm=%s&output=gplain" mid)) (narrow-to-region (search-forward ">" nil t) (search-forward "" nil t)) diff --git a/lisp/nnwfm.el b/lisp/nnwfm.el index ccabdfadb..318cb88a6 100644 --- a/lisp/nnwfm.el +++ b/lisp/nnwfm.el @@ -297,7 +297,7 @@ (when (re-search-forward "href=\"\\(Thread.*DateLast=\\([^\"]+\\)\\)" nil t) (setq url (match-string 1) - time (nnwfm-date-to-time (gnus-url-unhex-string + time (nnwfm-date-to-time (gnus-url-unhex-string (match-string 2)))) (when (and (nnwfm-new-threads-p group time) (not (member diff --git a/lisp/pop3.el b/lisp/pop3.el index 8b473cdf4..5f0ef71b0 100644 --- a/lisp/pop3.el +++ b/lisp/pop3.el @@ -259,7 +259,7 @@ If NOW, use that time instead." ;; Tue Jul 9 09:04:21 1996 (setq date (cond ((not date) - "Tue Jan 1 00:00:0 1900") + "Tue Jan 1 00:00:0 1900") ((string-match "[A-Z]" (nth 0 date)) (format "%s %s %s %s %s" (nth 0 date) (nth 2 date) (nth 1 date) diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index fa03c4068..1947b9e2a 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -184,7 +184,7 @@ Should be called narrowed to the head of the message." ;; left the old code commented out below. ;; -- Per Abrahamsen Date: 2001-10-07. ((null method) - (when (delq 'ascii + (when (delq 'ascii (mm-find-charset-region (point-min) (point-max))) (rfc2047-encode-region (point-min) (point-max)))) ;;; ((null method) @@ -540,7 +540,7 @@ The buffer may be narrowed." (inline (rfc2047-decode-region (point-min) (point-max))) (buffer-string)) - (if (and m + (if (and m mail-parse-charset (not (eq mail-parse-charset 'us-ascii)) (not (eq mail-parse-charset 'gnus-decoded))) diff --git a/lisp/sha1-el.el b/lisp/sha1-el.el index 0c94c2d0b..4e2da434b 100644 --- a/lisp/sha1-el.el +++ b/lisp/sha1-el.el @@ -71,7 +71,7 @@ If this variable is set to nil, use internal function only.") "*Name of program to compute SHA1. It must be a string \(program name\) or list of strings \(name and its args\).") -(defvar sha1-use-external +(defvar sha1-use-external (executable-find (car sha1-program)) "*Use external sh1 program. If this variable is set to nil, use internal function only.") diff --git a/lisp/sieve-manage.el b/lisp/sieve-manage.el index ca77067f0..0b5772efe 100644 --- a/lisp/sieve-manage.el +++ b/lisp/sieve-manage.el @@ -65,7 +65,7 @@ ;; ;; 2001-10-31 Committed to Oort Gnus. ;; -;; $Id: sieve-manage.el,v 6.2 2001/11/01 01:18:11 zsh Exp $ +;; $Id: sieve-manage.el,v 6.3 2001/11/28 16:52:53 zsh Exp $ ;;; Code: @@ -116,7 +116,7 @@ stream.") (defcustom sieve-manage-authenticators '(cram-md5 plain) "Priority of authenticators to consider when authenticating to server.") -(defcustom sieve-manage-authenticator-alist +(defcustom sieve-manage-authenticator-alist '((cram-md5 sieve-manage-cram-md5-p sieve-manage-cram-md5-auth) (plain sieve-manage-plain-p sieve-manage-plain-auth)) "Definition of authenticators. @@ -196,13 +196,13 @@ Returns t if login was successful, nil otherwise." ;; (condition-case () (while (or (not user) (not passwd)) (setq user (or sieve-manage-username - (read-from-minibuffer + (read-from-minibuffer (concat "Managesieve username for " sieve-manage-server ": ") (or user sieve-manage-default-user)))) (setq passwd (or sieve-manage-password (sieve-manage-read-passwd - (concat "Managesieve password for " user "@" + (concat "Managesieve password for " user "@" sieve-manage-server ": ")))) (when (and user passwd) (if (funcall loginfunc user passwd) @@ -319,7 +319,7 @@ Returns t if login was successful, nil otherwise." (sieve-manage-send (concat "AUTHENTICATE \"PLAIN\" \"" (base64-encode-string (concat (char-to-string 0) - user + user (char-to-string 0) passwd)) "\"")) @@ -395,7 +395,7 @@ to work in." (if (funcall (nth 1 (assq stream sieve-manage-stream-alist)) buffer) (setq stream-changed - (not (eq (or sieve-manage-stream + (not (eq (or sieve-manage-stream sieve-manage-default-stream) stream)) sieve-manage-stream stream @@ -409,14 +409,14 @@ to work in." (if (sieve-manage-open-1 buffer) (message "sieve: Reconnecting with stream `%s'...done" sieve-manage-stream) - (message "sieve: Reconnecting with stream `%s'...failed" + (message "sieve: Reconnecting with stream `%s'...failed" sieve-manage-stream)) (setq sieve-manage-capability nil)) (if (sieve-manage-opened buffer) ;; Choose authenticator (when (and (null sieve-manage-auth) (not (eq sieve-manage-state 'auth))) - (let ((auths sieve-manage-authenticators)) + (let ((auths sieve-manage-authenticators)) (while (setq auth (pop auths)) (if (funcall (nth 1 (assq auth diff --git a/lisp/sieve-mode.el b/lisp/sieve-mode.el index 38f133e08..926ed049a 100644 --- a/lisp/sieve-mode.el +++ b/lisp/sieve-mode.el @@ -45,7 +45,7 @@ ;; added keymap and menubar to hook into sieve-manage ;; 2001-10-31 version 1.2 committed to Oort Gnus ;; -;; $Id: sieve-mode.el,v 6.1 2001/11/01 00:50:22 jas Exp $ +;; $Id: sieve-mode.el,v 6.2 2001/11/07 22:50:17 jas Exp $ ;;; Code: @@ -69,7 +69,7 @@ (defvar sieve-control-commands-face 'sieve-control-commands-face "Face name used for Sieve Control Commands.") -(defface sieve-control-commands-face +(defface sieve-control-commands-face '((((type tty) (class color)) (:foreground "blue" :weight light)) (((class grayscale) (background light)) (:foreground "LightGray" :bold t)) (((class grayscale) (background dark)) (:foreground "DimGray" :bold t)) @@ -91,7 +91,7 @@ (defvar sieve-test-commands-face 'sieve-test-commands-face "Face name used for Sieve Test Commands.") -(defface sieve-test-commands-face +(defface sieve-test-commands-face '((((type tty) (class color)) (:foreground "magenta")) (((class grayscale) (background light)) (:foreground "LightGray" :bold t :underline t)) @@ -128,7 +128,7 @@ (cons (regexp-opt '("address" "allof" "anyof" "exists" "false" "true" "header" "not" "size" "envelope")) 'sieve-test-commands-face) - (cons "\\Sw+:\\sw+" + (cons "\\Sw+:\\sw+" 'sieve-tagged-arguments-face)))) ;; Syntax table @@ -158,7 +158,7 @@ ;; Key map definition -(defvar sieve-mode-map +(defvar sieve-mode-map (let ((map (make-sparse-keymap))) (define-key map "\C-c\C-l" 'sieve-upload) (define-key map "\C-c\C-m" 'sieve-manage) @@ -188,7 +188,7 @@ Turning on Sieve mode runs `sieve-mode-hook'." (set (make-local-variable 'comment-start-skip) "#+ *") (unless (featurep 'xemacs) (set (make-local-variable 'font-lock-defaults) - '(sieve-font-lock-keywords nil nil ((?_ . "w"))))) + '(sieve-font-lock-keywords nil nil ((?_ . "w"))))) (easy-menu-add-item nil nil sieve-mode-menu)) ;; Menu diff --git a/lisp/sieve.el b/lisp/sieve.el index 3301c1f65..f16e3582b 100644 --- a/lisp/sieve.el +++ b/lisp/sieve.el @@ -34,7 +34,7 @@ ;; ;; 2001-10-31 Committed to Oort Gnus. ;; -;; $Id: sieve.el,v 6.1 2001/11/01 00:50:22 jas Exp $ +;; $Id: sieve.el,v 6.2 2001/11/01 09:45:57 jas Exp $ ;; ;; Todo: ;; @@ -144,7 +144,7 @@ require \"fileinto\"; ["Activate script" sieve-activate t] ["Deactivate script" sieve-deactivate t])) -;; This is necessary to allow correct handling of \\[cvs-mode-diff-map] +;; This is necessary to allow correct handling of \\[cvs-mode-diff-map] ;; in substitute-command-keys. ;(fset 'sieve-manage-mode-map sieve-manage-mode-map) diff --git a/lisp/smiley.el b/lisp/smiley.el index ffc3bdf5c..5edb17608 100644 --- a/lisp/smiley.el +++ b/lisp/smiley.el @@ -140,7 +140,7 @@ A list of images is returned." With arg, turn displaying on if and only if arg is positive." (interactive "P") (gnus-with-article-buffer - (if (if (numberp arg) + (if (if (numberp arg) (> arg 0) (not (memq 'smiley gnus-article-wash-types))) (smiley-region (point-min) (point-max)) diff --git a/lisp/smime.el b/lisp/smime.el index 49fabbc2b..3649badfe 100644 --- a/lisp/smime.el +++ b/lisp/smime.el @@ -459,7 +459,7 @@ in the buffer specified by `smime-details-buffer'." "Get email addresses contained in certificate between points B and E. A string or a list of strings is returned." (smime-new-details-buffer) - (when (smime-call-openssl-region + (when (smime-call-openssl-region b e smime-details-buffer "x509" "-email" "-noout") (delete-region b e) (insert-buffer-substring smime-details-buffer) diff --git a/lisp/time-date.el b/lisp/time-date.el index 3ae1a533f..e9babceb0 100644 --- a/lisp/time-date.el +++ b/lisp/time-date.el @@ -170,7 +170,7 @@ The Gregorian date Sunday, December 31, 1bce is imaginary." (month (nth 4 tim)) (day (nth 3 tim)) (year (nth 5 tim))) - (+ (time-to-day-in-year time) ; Days this year + (+ (time-to-day-in-year time) ; Days this year (* 365 (1- year)) ; + Days in prior years (/ (1- year) 4) ; + Julian leap years (- (/ (1- year) 100)) ; - century years diff --git a/lisp/uudecode.el b/lisp/uudecode.el index 8e2fd6661..8ef210a0f 100644 --- a/lisp/uudecode.el +++ b/lisp/uudecode.el @@ -48,7 +48,7 @@ input and write the converted data to its standard output." :group 'gnus-extract :type '(repeat string)) -(defcustom uudecode-use-external +(defcustom uudecode-use-external (executable-find uudecode-decoder-program) "*Use external uudecode program." :group 'gnus-extract @@ -166,8 +166,8 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." (setq counter (1+ counter) inputpos (1+ inputpos)) (cond ((= counter 4) - (setq result (cons - (concat + (setq result (cons + (concat (char-to-string (lsh bits -16)) (char-to-string (logand (lsh bits -8) 255)) (char-to-string (logand bits 255))) @@ -183,13 +183,13 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." ;;(error "uucode ends unexpectly") (setq done t)) ((= counter 3) - (setq result (cons - (concat + (setq result (cons + (concat (char-to-string (logand (lsh bits -16) 255)) (char-to-string (logand (lsh bits -8) 255))) result))) ((= counter 2) - (setq result (cons + (setq result (cons (char-to-string (logand (lsh bits -10) 255)) result)))) (skip-chars-forward non-data-chars end)) @@ -206,7 +206,7 @@ If FILE-NAME is non-nil, save the result to FILE-NAME." (defun uudecode-decode-region (start end &optional file-name) "Uudecode region between START and END. If FILE-NAME is non-nil, save the result to FILE-NAME." - (if uudecode-use-external + (if uudecode-use-external (uudecode-decode-region-external start end file-name) (uudecode-decode-region-internal start end file-name)))