+1999-12-04 01:34:31 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus.el: Fixed all the doc strings to match the FSF convetions.
+ Indent all functions. Fix all comments to match the comment
+ conventions. Double-space after full stop.
+
1999-12-04 01:14:55 YAMAMOTO Kouji <kouji@pobox.com>
* nnmail.el (nnmail-split-it): I redefined nnmail-split-fancy's
( ?w . 48) ( ?x . 49) ( ?y . 50) ( ?z . 51) ( ?0 . 52) ( ?1 . 53)
( ?2 . 54) ( ?3 . 55) ( ?4 . 56) ( ?5 . 57) ( ?6 . 58) ( ?7 . 59)
( ?8 . 60) ( ?9 . 61) ( ?+ . 62) ( ?/ . 63)
- ))
+ ))
(defvar base64-alphabet-decoding-vector
(let ((v (make-vector 123 nil))
(if base64-decoder-program
(let* ((binary-process-output t) ; any text already has CRLFs
(status (apply 'base64-run-command-on-region
- start end work-buffer
- base64-decoder-program
- base64-decoder-switches)))
+ start end work-buffer
+ base64-decoder-program
+ base64-decoder-switches)))
(if (not (eq status t))
(error "%s" (cdr status))))
(goto-char start)
(cond ((= counter 4)
(base64-insert-char (lsh bits -16) 1 nil work-buffer)
(base64-insert-char (logand (lsh bits -8) 255) 1 nil
- work-buffer)
+ work-buffer)
(base64-insert-char (logand bits 255) 1 nil
work-buffer)
(setq bits 0 counter 0))
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
;; Create Date: Oct 1, 1998
-;; $Revision: 5.5 $
+;; $Revision: 5.7 $
;; Time-stamp: <Tue Oct 6 23:48:38 EDT 1998 zsh>
;; Keywords: binhex
((= counter 2)
(binhex-push-char (logand (lsh bits -10) 255) 1 nil
work-buffer))))
- (if header-only nil
- (binhex-verify-crc work-buffer
- data-fork-start
- (+ data-fork-start (aref header 6) 2))
- (or (markerp end) (setq end (set-marker (make-marker) end)))
- (goto-char start)
- (insert-buffer-substring work-buffer
- data-fork-start (+ data-fork-start
- (aref header 6)))
- (delete-region (point) end)))
+ (if header-only nil
+ (binhex-verify-crc work-buffer
+ data-fork-start
+ (+ data-fork-start (aref header 6) 2))
+ (or (markerp end) (setq end (set-marker (make-marker) end)))
+ (goto-char start)
+ (insert-buffer-substring work-buffer
+ data-fork-start (+ data-fork-start
+ (aref header 6)))
+ (delete-region (point) end)))
(and work-buffer (kill-buffer work-buffer)))
(if header (aref header 1))))
(defun binhex-decode-region-external (start end)
- "Binhex decode region between START and END using external decoder"
+ "Binhex decode region between START and END using external decoder."
(interactive "r")
(let ((cbuf (current-buffer)) firstline work-buffer status
(file-name (concat binhex-temporary-file-directory
(if (memq system-type '(win32 w32 mswindows windows-nt))
(setq filename (downcase filename)))
(cond ((eq system-type 'vax-vms)
- (concat (substring filename 0 (string-match ";" filename)) "c"))
- ((string-match emacs-lisp-file-regexp filename)
- (concat (substring filename 0 (match-beginning 0)) ".elc"))
- (t (concat filename ".elc"))))
+ (concat (substring filename 0 (string-match ";" filename)) "c"))
+ ((string-match emacs-lisp-file-regexp filename)
+ (concat (substring filename 0 (match-beginning 0)) ".elc"))
+ (t (concat filename ".elc"))))
(require 'bytecomp)
;; Prune off articles that we have already fetched.
(while (and articles
(cdr (assq (car articles) gnus-agent-article-alist)))
- (pop articles))
+ (pop articles))
(let ((arts articles))
(while (cdr arts)
(if (cdr (assq (cadr arts) gnus-agent-article-alist))
(setcdr alist (cons (cons (cdar crosses) t) (cdr alist)))
(save-excursion
(set-buffer (gnus-get-buffer-create (format " *Gnus agent overview %s*"
- group)))
+ group)))
(when (= (point-max) (point-min))
(push (cons group (current-buffer)) gnus-agent-buffer-alist)
(ignore-errors
;; add article with marks to list of article headers we want to fetch
(dolist (arts (gnus-info-marks (gnus-get-info group)))
(setq articles (union (gnus-uncompress-sequence (cdr arts))
- articles)))
+ articles)))
(setq articles (sort articles '<))
;; remove known articles
(when (gnus-agent-load-alist group)
(setq articles (gnus-sorted-intersection
- articles
- (gnus-uncompress-range
- (cons (1+ (caar (last gnus-agent-article-alist)))
- (cdr (gnus-active group)))))))
+ articles
+ (gnus-uncompress-range
+ (cons (1+ (caar (last gnus-agent-article-alist)))
+ (cdr (gnus-active group)))))))
;; Fetch them.
(gnus-make-directory (nnheader-translate-file-chars
(file-name-directory file)))
(gnus-get-newsgroup-headers-xover articles nil nil
group)))
;; `gnus-agent-overview-buffer' may be killed for
- ;; timeout reason. If so, recreate it.
+ ;; timeout reason. If so, recreate it.
(gnus-agent-create-buffer)))
(setq category (gnus-group-category group))
(setq predicate
(gnus-get-predicate
- (or (gnus-group-find-parameter group 'agent-predicate t)
+ (or (gnus-group-find-parameter group 'agent-predicate t)
(cadr category))))
;; Do we want to download everything, or nothing?
(if (or (eq (caaddr predicate) 'gnus-agent-true)
(set-buffer overview)
(erase-buffer)
(when (file-exists-p nov-file)
- (nnheader-insert-file-contents nov-file))
+ (nnheader-insert-file-contents nov-file))
(goto-char (point-min))
(setq article 0)
(while (setq elem (pop articles))
:group 'gnus-article-signature)
(defcustom gnus-signature-limit nil
- "Provide a limit to what is considered a signature.
+ "Provide a limit to what is considered a signature.
If it is a number, no signature may not be longer (in characters) than
that number. If it is a floating point number, no signature may be
longer (in lines) than that number. If it is a function, the function
"Function called with a MIME handle as the argument.
This is meant for people who want to view first matched part.
For `undisplayed-alternative' (default), the first undisplayed
-part or alternative part is used. For `undisplayed', the first
-undisplayed part is used. For a function, the first part which
-the function return `t' is used. For `nil', the first part is
+part or alternative part is used. For `undisplayed', the first
+undisplayed part is used. For a function, the first part which
+the function return `t' is used. For `nil', the first part is
used."
:group 'gnus-article-mime
:type '(choice
(mail-content-type-get ctl 'charset))))
(mail-parse-charset gnus-newsgroup-charset)
(mail-parse-ignored-charsets
- (save-excursion (condition-case nil
- (set-buffer gnus-summary-buffer)
- (error))
+ (save-excursion (condition-case nil
+ (set-buffer gnus-summary-buffer)
+ (error))
gnus-newsgroup-ignored-charsets))
buffer-read-only)
(if (and ctl (not (string-match "/" (car ctl))))
(mm-decode-body charset)))))))
(defun article-hide-list-identifiers ()
- "Remove any list identifiers in `gnus-list-identifiers' from Subject
-header in the current article."
+ "Remove list identifies from the Subject header.
+The `gnus-list-identifiers' variable specifies what to do."
(interactive)
(save-excursion
(save-restriction
(defun article-date-ut (&optional type highlight header)
"Convert DATE date to universal time in the current article.
If TYPE is `local', convert to local time; if it is `lapsed', output
-how much time has lapsed since DATE. For `lapsed', the value of
+how much time has lapsed since DATE. For `lapsed', the value of
`gnus-article-date-lapsed-new-header' says whether the \"X-Sent:\" header
should replace the \"Date:\" one, or should be added below it."
(interactive (list 'ut t))
(concat "Date: "
(current-time-string
(let* ((e (parse-time-string date))
- (tm (apply 'encode-time e))
- (ms (car tm))
- (ls (- (cadr tm) (car (current-time-zone time)))))
+ (tm (apply 'encode-time e))
+ (ms (car tm))
+ (ls (- (cadr tm) (car (current-time-zone time)))))
(cond ((< ls 0) (list (1- ms) (+ ls 65536)))
((> ls 65535) (list (1+ ms) (- ls 65536)))
(t (list ms ls)))))
(gnus-summary-mark-article article gnus-canceled-mark)
(unless (memq article gnus-newsgroup-sparse)
(gnus-error 1
- "No such article (may have expired or been canceled)")))))
+ "No such article (may have expired or been canceled)")))))
(if (or (eq result 'pseudo)
(eq result 'nneething))
(progn
((eq condition 'undisplayed)
(not (or (mm-handle-undisplayer (cdr ihandle))
(equal (mm-handle-media-type (cdr ihandle))
- "multipart/alternative"))))
+ "multipart/alternative"))))
((eq condition 'undisplayed-alternative)
(not (mm-handle-undisplayer (cdr ihandle))))
(t t))
;; Top-level call; we clean up.
(when gnus-article-mime-handles
(mm-destroy-parts gnus-article-mime-handles)
- (setq gnus-article-mime-handle-alist nil)) ;; A trick.
+ (setq gnus-article-mime-handle-alist nil));; A trick.
(setq gnus-article-mime-handles handles)
;; We allow users to glean info from the handles.
(when gnus-article-mime-part-function
'(mail-decode-encoded-word-region)
"List of methods used to decode headers.
-This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item is
-FUNCTION, FUNCTION will be apply to all newsgroups. If item is a
+This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item
+is FUNCTION, FUNCTION will be apply to all newsgroups. If item is a
(REGEXP . FUNCTION), FUNCTION will be only apply to thes newsgroups
whose names match REGEXP.
"Possibly prefetch several articles starting with ARTICLE."
(if (not (gnus-buffer-live-p summary))
(gnus-async-with-semaphore
- (setq gnus-async-fetch-list nil))
+ (setq gnus-async-fetch-list nil))
(when (and gnus-asynchronous
(gnus-alive-p))
(when next
(gnus-async-with-semaphore
- (pop gnus-async-fetch-list)))
+ (pop gnus-async-fetch-list)))
(let ((do-fetch next)
- (do-message t)) ;(eq major-mode 'gnus-summary-mode)))
+ (do-message t)) ;(eq major-mode 'gnus-summary-mode)))
(when (and (gnus-group-asynchronous-p group)
(gnus-buffer-live-p summary)
(or (not next)
gnus-async-fetch-list))
(gnus-async-with-semaphore
- (unless next
- (setq do-fetch (not gnus-async-fetch-list))
- ;; Nix out any outstanding requests.
- (setq gnus-async-fetch-list nil)
- ;; Fill in the new list.
- (let ((n gnus-use-article-prefetch)
- (data (gnus-data-find-list article))
- d)
- (while (and (setq d (pop data))
- (if (numberp n)
- (natnump (decf n))
- n))
- (unless (or (gnus-async-prefetched-article-entry
- group (setq article (gnus-data-number d)))
- (not (natnump article))
- (not (funcall gnus-async-prefetch-article-p d)))
- ;; Not already fetched -- so we add it to the list.
- (push article gnus-async-fetch-list)))
- (setq gnus-async-fetch-list
- (nreverse gnus-async-fetch-list))))
-
- (when do-fetch
- (setq article (car gnus-async-fetch-list))))
+ (unless next
+ (setq do-fetch (not gnus-async-fetch-list))
+ ;; Nix out any outstanding requests.
+ (setq gnus-async-fetch-list nil)
+ ;; Fill in the new list.
+ (let ((n gnus-use-article-prefetch)
+ (data (gnus-data-find-list article))
+ d)
+ (while (and (setq d (pop data))
+ (if (numberp n)
+ (natnump (decf n))
+ n))
+ (unless (or (gnus-async-prefetched-article-entry
+ group (setq article (gnus-data-number d)))
+ (not (natnump article))
+ (not (funcall gnus-async-prefetch-article-p d)))
+ ;; Not already fetched -- so we add it to the list.
+ (push article gnus-async-fetch-list)))
+ (setq gnus-async-fetch-list
+ (nreverse gnus-async-fetch-list))))
+
+ (when do-fetch
+ (setq article (car gnus-async-fetch-list))))
(when (and do-fetch article)
;; We want to fetch some more articles.
(when arg
(gnus-async-set-buffer)
(gnus-async-with-semaphore
- (setq
- gnus-async-article-alist
- (cons (list (intern (format "%s-%d" group article)
- gnus-async-hashtb)
- mark (set-marker (make-marker) (point-max))
- group article)
- gnus-async-article-alist))))
+ (setq
+ gnus-async-article-alist
+ (cons (list (intern (format "%s-%d" group article)
+ gnus-async-hashtb)
+ mark (set-marker (make-marker) (point-max))
+ group article)
+ gnus-async-article-alist))))
(if (not (gnus-buffer-live-p summary))
(gnus-async-with-semaphore
- (setq gnus-async-fetch-list nil))
+ (setq gnus-async-fetch-list nil))
(gnus-async-prefetch-article group next summary t))))
(defun gnus-async-unread-p (data)
(set-marker (cadr entry) nil)
(set-marker (caddr entry) nil))
(gnus-async-with-semaphore
- (setq gnus-async-article-alist
- (delq entry gnus-async-article-alist))))
+ (setq gnus-async-article-alist
+ (delq entry gnus-async-article-alist))))
(defun gnus-async-prefetch-remove-group (group)
"Remove all articles belonging to GROUP from the prefetch buffer."
"Executable program for playing WAV files.")
;;; The following isn't implemented yet. Wait for Millennium Gnus.
-;(defvar gnus-audio-effects-enabled t
-; "When t, Gnus will use sound effects.")
-;(defvar gnus-audio-enable-hooks nil
-; "Functions run when enabling sound effects.")
-;(defvar gnus-audio-disable-hooks nil
-; "Functions run when disabling sound effects.")
-;(defvar gnus-audio-theme-song nil
-; "Theme song for Gnus.")
-;(defvar gnus-audio-enter-group nil
-; "Sound effect played when selecting a group.")
-;(defvar gnus-audio-exit-group nil
-; "Sound effect played when exiting a group.")
-;(defvar gnus-audio-score-group nil
-; "Sound effect played when scoring a group.")
-;(defvar gnus-audio-busy-sound nil
-; "Sound effect played when going into a ... sequence.")
+;;(defvar gnus-audio-effects-enabled t
+;; "When t, Gnus will use sound effects.")
+;;(defvar gnus-audio-enable-hooks nil
+;; "Functions run when enabling sound effects.")
+;;(defvar gnus-audio-disable-hooks nil
+;; "Functions run when disabling sound effects.")
+;;(defvar gnus-audio-theme-song nil
+;; "Theme song for Gnus.")
+;;(defvar gnus-audio-enter-group nil
+;; "Sound effect played when selecting a group.")
+;;(defvar gnus-audio-exit-group nil
+;; "Sound effect played when exiting a group.")
+;;(defvar gnus-audio-score-group nil
+;; "Sound effect played when scoring a group.")
+;;(defvar gnus-audio-busy-sound nil
+;; "Sound effect played when going into a ... sequence.")
;;;###autoload
- ;(defun gnus-audio-enable-sound ()
-; "Enable Sound Effects for Gnus."
-; (interactive)
-; (setq gnus-audio-effects-enabled t)
-; (gnus-run-hooks gnus-audio-enable-hooks))
+;;(defun gnus-audio-enable-sound ()
+;; "Enable Sound Effects for Gnus."
+;; (interactive)
+;; (setq gnus-audio-effects-enabled t)
+;; (gnus-run-hooks gnus-audio-enable-hooks))
;;;###autoload
;(defun gnus-audio-disable-sound ()
-; "Disable Sound Effects for Gnus."
-; (interactive)
-; (setq gnus-audio-effects-enabled nil)
-; (gnus-run-hooks gnus-audio-disable-hooks))
+;; "Disable Sound Effects for Gnus."
+;; (interactive)
+;; (setq gnus-audio-effects-enabled nil)
+;; (gnus-run-hooks gnus-audio-disable-hooks))
;;;###autoload
(defun gnus-audio-play (file)
;;; The following isn't implemented yet, wait for Red Gnus
- ;(defun gnus-audio-startrek-sounds ()
-; "Enable sounds from Star Trek the original series."
-; (interactive)
-; (setq gnus-audio-busy-sound "working.au")
-; (setq gnus-audio-enter-group "bulkhead_door.au")
-; (setq gnus-audio-exit-group "bulkhead_door.au")
-; (setq gnus-audio-score-group "ST_laser.au")
-; (setq gnus-audio-theme-song "startrek.au")
-; (add-hook 'gnus-select-group-hook 'gnus-audio-startrek-select-group)
-; (add-hook 'gnus-exit-group-hook 'gnus-audio-startrek-exit-group))
+;;(defun gnus-audio-startrek-sounds ()
+;; "Enable sounds from Star Trek the original series."
+;; (interactive)
+;; (setq gnus-audio-busy-sound "working.au")
+;; (setq gnus-audio-enter-group "bulkhead_door.au")
+;; (setq gnus-audio-exit-group "bulkhead_door.au")
+;; (setq gnus-audio-score-group "ST_laser.au")
+;; (setq gnus-audio-theme-song "startrek.au")
+;; (add-hook 'gnus-select-group-hook 'gnus-audio-startrek-select-group)
+M; (add-hook 'gnus-exit-group-hook 'gnus-audio-startrek-exit-group))
;;;***
(defvar gnus-startup-jingle "Tuxedomoon.Jingle4.au"
it's not cached."
:group 'gnus-cache
:type '(choice (const :tag "off" nil)
- regexp))
+ regexp))
(defcustom gnus-uncacheable-groups nil
"*Groups that match this regexp will not be cached.
(set-buffer cache-buf)
(erase-buffer)
(let ((coding-system-for-read
- gnus-cache-overview-coding-system))
+ gnus-cache-overview-coding-system))
(insert-file-contents
(or file (gnus-cache-file-name group ".overview"))))
(goto-char (point-min))
:type 'string)
(defcustom gnus-cite-always-check nil
- "Check article always for citations. Set it t to check all articles."
+ "Check article always for citations. Set it t to check all articles."
:group 'gnus-cite
:type '(choice (const :tag "no" nil)
- (const :tag "yes" t)))
+ (const :tag "yes" t)))
(defcustom gnus-cited-opened-text-button-line-format "%(%{[-]%}%)\n"
"Format of opened cited text buttons."
(defcustom gnus-cite-face-list
'(gnus-cite-face-1 gnus-cite-face-2 gnus-cite-face-3 gnus-cite-face-4
- gnus-cite-face-5 gnus-cite-face-6 gnus-cite-face-7 gnus-cite-face-8
- gnus-cite-face-9 gnus-cite-face-10 gnus-cite-face-11)
+ gnus-cite-face-5 gnus-cite-face-6 gnus-cite-face-7 gnus-cite-face-8
+ gnus-cite-face-9 gnus-cite-face-10 gnus-cite-face-11)
"*List of faces used for highlighting citations.
When there are citations from multiple articles in the same message,
Specify default value for GCC header.
If this symbol is present in the group parameter list and set to `t',
-new composed messages will be `Gcc''d to the current group. If it is
+new composed messages will be `Gcc''d to the current group. If it is
present and set to `none', no `Gcc:' header will be generated, if it
is present and a string, this string will be inserted literally as a
`gcc' header (this symbol takes precedence over any default `Gcc'
When to expire.
Overrides any `nnmail-expiry-wait' and `nnmail-expiry-wait-function'
-when expiring expirable messages. The value can either be a number of
+when expiring expirable messages. The value can either be a number of
days (not necessarily an integer) or the symbols `never' or
`immediate'.")
(number :tag "Group for displayed part" 0)
(symbol :tag "Face"
gnus-emphasis-highlight-words))))
- "highlight regexps.
+ "highlight regexps.
See gnus-emphasis-alist."))
"Alist of valid group or topic parameters.
group. `dummy-variable' will be set to the result of the `(ding)'
form, but who cares?"
(list :format "%v" :value (nil nil)
- (symbol :tag "Variable")
- (sexp :tag
- "Value")))
+ (symbol :tag "Variable")
+ (sexp :tag
+ "Value")))
'(repeat :inline t
:tag "Unknown entries"
(item `(const :format "" :value ,(downcase tag)))
(match '(string :tag "Match"))
(score '(choice :tag "Score"
- (const :tag "default" nil)
- (integer :format "%v"
- :hide-front-space t)))
+ (const :tag "default" nil)
+ (integer :format "%v"
+ :hide-front-space t)))
(expire '(choice :tag "Expire"
(const :tag "off" nil)
(integer :format "%v"
(item `(const :format "" :value ,(downcase tag)))
(match '(integer :tag "Match"))
(score '(choice :tag "Score"
- (const :tag "default" nil)
- (integer :format "%v"
- :hide-front-space t)))
+ (const :tag "default" nil)
+ (integer :format "%v"
+ :hide-front-space t)))
(expire '(choice :tag "Expire"
(const :tag "off" nil)
(integer :format "%v"
(item `(const :format "" :value ,(downcase tag)))
(match '(string :tag "Match"))
(score '(choice :tag "Score"
- (const :tag "default" nil)
- (integer :format "%v"
- :hide-front-space t)))
+ (const :tag "default" nil)
+ (integer :format "%v"
+ :hide-front-space t)))
(expire '(choice :tag "Expire"
(const :tag "off" nil)
(integer :format "%v"
(interactive (list gnus-current-score-file))
(let ((scores (gnus-score-load file))
(types (mapcar (lambda (entry)
- `(group :format "%v%h\n"
- :doc ,(nth 2 entry)
- (const :format "" ,(nth 0 entry))
- ,(nth 1 entry)))
- gnus-score-parameters)))
+ `(group :format "%v%h\n"
+ :doc ,(nth 2 entry)
+ (const :format "" ,(nth 0 entry))
+ ,(nth 1 entry)))
+ gnus-score-parameters)))
;; Ready.
(kill-buffer (gnus-get-buffer-create "*Gnus Customize*"))
(switch-to-buffer (gnus-get-buffer-create "*Gnus Customize*"))
thenMin
thenHour
;; If THEN is earlier than NOW, make it
- ;; same time tomorrow. Doc for encode-time
+ ;; same time tomorrow. Doc for encode-time
;; says that this is OK.
(+ (elt nowParts 3)
(if (or (< thenHour (elt nowParts 2))
(interactive "P")
(when (eq major-mode 'gnus-summary-mode)
(when (set (make-local-variable 'gnus-draft-mode)
- (if (null arg) (not gnus-draft-mode)
- (> (prefix-numeric-value arg) 0)))
+ (if (null arg) (not gnus-draft-mode)
+ (> (prefix-numeric-value arg) 0)))
;; Set up the menu.
(when (gnus-visual-p 'draft-menu 'menu)
(gnus-draft-make-menu-bar))
;;;!!!but for the time being, we'll just run this tiny function uncompiled.
(progn
-(defun gnus-draft-setup (narticle group)
- (gnus-setup-message 'forward
- (let ((article narticle))
- (message-mail)
- (erase-buffer)
- (if (not (gnus-request-restore-buffer article group))
- (error "Couldn't restore the article")
- ;; Insert the separator.
- (goto-char (point-min))
- (search-forward "\n\n")
- (forward-char -1)
- (insert mail-header-separator)
- (forward-line 1)
- (message-set-auto-save-file-name))))))
+ (defun gnus-draft-setup (narticle group)
+ (gnus-setup-message 'forward
+ (let ((article narticle))
+ (message-mail)
+ (erase-buffer)
+ (if (not (gnus-request-restore-buffer article group))
+ (error "Couldn't restore the article")
+ ;; Insert the separator.
+ (goto-char (point-min))
+ (search-forward "\n\n")
+ (forward-char -1)
+ (insert mail-header-separator)
+ (forward-line 1)
+ (message-set-auto-save-file-name))))))
(defun gnus-draft-article-sendable-p (article)
"Say whether ARTICLE is sendable."
;; [Note] Now there are three kinds of mule implementations,
;; original MULE, XEmacs/mule and beta version of Emacs including
- ;; some mule features. Unfortunately these API are different. In
+ ;; some mule features. Unfortunately these API are different. In
;; particular, Emacs (including original MULE) and XEmacs are
;; quite different.
;; Predicates to check are following:
;; (featurep 'mule) is t when every mule variants are running.
;; These implementations may be able to share between original
- ;; MULE and beta version of new Emacs. In addition, it is able to
+ ;; MULE and beta version of new Emacs. In addition, it is able to
;; detect XEmacs/mule by (featurep 'mule) and to check variable
- ;; `emacs-version'. In this case, implementation for XEmacs/mule
+ ;; `emacs-version'. In this case, implementation for XEmacs/mule
;; may be able to share between XEmacs and XEmacs/mule.
(defvar gnus-summary-display-table nil
gnus-tmp-closing-bracket)
(point))
gnus-mouse-face-prop gnus-mouse-face)
- (insert " " gnus-tmp-subject-or-nil "\n"))
- )))
+ (insert " " gnus-tmp-subject-or-nil "\n")))))
(defun gnus-region-active-p ()
"Say whether the region is active."
This pseudonym is obtained during the registration process")
(defvar grouplens-bbb-host "grouplens.cs.umn.edu"
- "Host where the bbbd is running" )
+ "Host where the bbbd is running.")
(defvar grouplens-bbb-port 9000
- "Port where the bbbd is listening" )
+ "Port where the bbbd is listening.")
(defvar grouplens-newsgroups
'("comp.groupware" "comp.human-factors" "comp.lang.c++"
;;;; Program global variables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar grouplens-bbb-token nil
- "Current session token number")
+ "Current session token number.")
(defvar grouplens-bbb-process nil
- "Process Id of current bbbd network stream process")
+ "Process Id of current bbbd network stream process.")
(defvar grouplens-bbb-buffer nil
- "Buffer associated with the BBBD process")
+ "Buffer associated with the BBBD process.")
(defvar grouplens-rating-alist nil
- "Current set of message-id rating pairs")
+ "Current set of message-id rating pairs.")
(defvar grouplens-current-hashtable nil
- "A hashtable to hold predictions from the BBB")
+ "A hashtable to hold predictions from the BBB.")
(defvar grouplens-current-group nil)
(concat "login " grouplens-pseudonym))
(if (bbb-read-response bbb-process)
(setq grouplens-bbb-token (bbb-extract-token-number))
- (gnus-message 3 "Error: GroupLens login failed")))))
+ (gnus-message 3 "Error: GroupLens login failed")))))
(gnus-message 3 "Error: you must set a pseudonym"))
grouplens-bbb-token)
pred (bbb-get-pred))
(push `(,mid ,pred nil s) resp)
(gnus-sethash mid (list pred (bbb-get-confl) (bbb-get-confh))
- grouplens-current-hashtable)
+ grouplens-current-hashtable)
(forward-line 1)
t)
((looking-at "\\(<.*>\\) :pred=\\([0-9]\.[0-9][0-9]\\)")
(unless gnus-grouplens-mode-map
(setq gnus-grouplens-mode-map (make-keymap))
(gnus-define-keys
- gnus-grouplens-mode-map
- "n" grouplens-next-unread-article
- "r" bbb-summary-rate-article
- "k" grouplens-score-thread
- "c" grouplens-summary-catchup-and-exit
- "," grouplens-best-unread-article))
+ gnus-grouplens-mode-map
+ "n" grouplens-next-unread-article
+ "r" bbb-summary-rate-article
+ "k" grouplens-score-thread
+ "c" grouplens-summary-catchup-and-exit
+ "," grouplens-best-unread-article))
(defun gnus-grouplens-make-menu-bar ()
(unless (boundp 'gnus-grouplens-menu)
((= unread 0) .
gnus-group-mail-low-empty-face)
(t .
- gnus-group-mail-low-face))
+ gnus-group-mail-low-face))
"*Controls the highlighting of group buffer lines.
Below is a list of `Form'/`Face' pairs. When deciding how a a
An access control list is a list of (identifier . rights) elements.
- The identifier string specifies the corresponding user. The
+ The identifier string specifies the corresponding user. The
identifier \"anyone\" is reserved to refer to the universal identity.
Rights is a string listing a (possibly empty) set of alphanumeric
characters, each character listing a set of operations which is being
- controlled. Letters are reserved for ``standard'' rights, listed
+ controlled. Letters are reserved for ``standard'' rights, listed
below. Digits are reserved for implementation or site defined rights.
l - lookup (mailbox is visible to LIST/LSUB commands)
;; First we make sure that we have really read the active file.
(unless (gnus-read-active-file-p)
(let ((gnus-read-active-file t)
- (gnus-agent nil)) ; Trick the agent into ignoring the active file.
+ (gnus-agent nil)) ; Trick the agent into ignoring the active file.
(gnus-read-active-file)))
;; Find all groups and sort them.
(let ((groups
(or (not info)
(and (not (setq marked (nthcdr 3 info)))
(or (null articles)
- (setcdr (nthcdr 2 info)
- (list (list (cons type (gnus-compress-sequence
- articles t)))))))
+ (setcdr (nthcdr 2 info)
+ (list (list (cons type (gnus-compress-sequence
+ articles t)))))))
(and (not (setq m (assq type (car marked))))
(or (null articles)
- (setcar marked
- (cons (cons type (gnus-compress-sequence articles t) )
- (car marked)))))
+ (setcar marked
+ (cons (cons type (gnus-compress-sequence articles t) )
+ (car marked)))))
(if force
(if (null articles)
- (setcar (nthcdr 3 info)
- (gnus-delete-alist type (car marked)))
- (setcdr m (gnus-compress-sequence articles t)))
+ (setcar (nthcdr 3 info)
+ (gnus-delete-alist type (car marked)))
+ (setcdr m (gnus-compress-sequence articles t)))
(setcdr m (gnus-compress-sequence
(sort (nconc (gnus-uncompress-range (cdr m))
(copy-sequence articles)) '<) t))))))
(defun gnus-group-timestamp-delta (group)
"Return the offset in seconds from the timestamp for GROUP to the current time, as a floating point number."
(let* ((time (or (gnus-group-timestamp group)
- (list 0 0)))
+ (list 0 0)))
(delta (subtract-time (current-time) time)))
(+ (* (nth 0 delta) 65536.0)
(nth 1 delta))))
:type 'boolean)
(defcustom gnus-winconf-kill-file nil
- "What does this do, Lars?"
+ "What does this do, Lars?
+I don't know, Per."
:group 'gnus-score-kill
:type 'sexp)
(require 'nnmail)
(defvar gnus-group-split-updated-hook nil
- "Hook called just after nnmail-split-fancy is updated by
-gnus-group-split-update")
+ "Hook called just after nnmail-split-fancy is updated by gnus-group-split-update.")
(defvar gnus-group-split-default-catch-all-group "mail.misc"
- "Group used by gnus-group-split and gnus-group-split-update as
-default catch-all group")
+ "Group used by gnus-group-split and gnus-group-split-update as default catch-all group.")
;;;###autoload
(defun gnus-group-split-setup (&optional auto-update catch-all)
- "Sets things up so that nnmail-split-fancy is used for mail
+ "Set up the split for nnmail-split-fancy.
+Sets things up so that nnmail-split-fancy is used for mail
splitting, and defines the variable nnmail-split-fancy according with
group parameters.
;;;###autoload
(defun gnus-group-split-update (&optional catch-all)
- "Computes nnmail-split-fancy from group params, by calling
-\(gnus-group-split-fancy nil nil DEFAULTGROUP)"
+ "Computes nnmail-split-fancy from group params.
+It does this by calling \(gnus-group-split-fancy nil nil DEFAULTGROUP)."
(interactive)
(setq nnmail-split-fancy
(gnus-group-split-fancy
nil nil (or catch-all gnus-group-split-default-catch-all-group)))
- (run-hooks 'gnus-group-split-updated-hook)
- )
+ (run-hooks 'gnus-group-split-updated-hook))
;;;###autoload
(defun gnus-group-split ()
- "Uses information from group parameters in order to split mail. See
-gnus-group-split-fancy for more information.
+ "Uses information from group parameters in order to split mail.
+See gnus-group-split-fancy for more information.
If no group is defined as catch-all, the value of
gnus-group-split-default-catch-all-group is used.
\"real\" newsgroups.
If not nil nor `native', the value must be a valid method as discussed
-in the documentation of `gnus-select-method'. It can also be a list of
-methods. If that is the case, the user will be queried for what select
+in the documentation of `gnus-select-method'. It can also be a list of
+methods. If that is the case, the user will be queried for what select
method to use when posting."
:group 'gnus-group-foreign
:type `(choice (const nil)
;; the default method.
((null group-method)
(or (and (null (eq gnus-post-method 'active)) gnus-post-method)
- gnus-select-method message-post-method))
+ gnus-select-method message-post-method))
;; We want the inverse of the default
((and arg (not (eq arg 0)))
(if (eq gnus-post-method 'active)
"clewis@ferret.ocunix.on.ca" ; Chris Lewis
"jem@xpat.com" ; Despammer from Korea
"snowhare@xmission.com" ; Benjamin "Snowhare" Franz
- "red@redpoll.mrfs.oh.us (Richard E. Depew)" ; ARMM! ARMM!
- )
+ "red@redpoll.mrfs.oh.us (Richard E. Depew)") ; ARMM! ARMM!
"*List of NoCeM issuers to pay attention to.
This can also be a list of `(ISSUER CONDITIONS)' elements."
(defun gnus-picons-parse-value (name)
(goto-char (point-min))
(if (re-search-forward (concat "<strong>"
- (regexp-quote name)
- "</strong> *= *<kbd> *\\([^ <][^<]*\\) *</kbd>")
+ (regexp-quote name)
+ "</strong> *= *<kbd> *\\([^ <][^<]*\\) *</kbd>")
nil t)
(buffer-substring (match-beginning 1) (match-end 1))))
(defun gnus-picons-network-search (user addrs dbs sym-ann right-p marker)
(let* ((host (mapconcat 'identity addrs "."))
(key (list (or user "unknown") host (if user
- gnus-picons-user-directories
- dbs)))
+ gnus-picons-user-directories
+ dbs)))
(cache (assoc key gnus-picons-url-alist)))
(if (null cache)
(gnus-picons-url-retrieve
out)))
(defun gnus-remove-from-range (range1 range2)
- "Return a range that has all articles from RANGE2 removed from
-RANGE1. The returned range is always a list. RANGE2 can also be a
-unsorted list of articles. RANGE1 is modified by side effects, RANGE2
-is not modified."
+ "Return a range that has all articles from RANGE2 removed from RANGE1.
+The returned range is always a list. RANGE2 can also be a unsorted
+list of articles. RANGE1 is modified by side effects, RANGE2 is not
+modified."
(if (or (null range1) (null range2))
range1
(let (out r1 r2 r1_min r1_max r2_min r2_max
- (range2 (gnus-copy-sequence range2)))
+ (range2 (gnus-copy-sequence range2)))
(setq range1 (if (listp (cdr range1)) range1 (list range1))
- range2 (sort (if (listp (cdr range2)) range2 (list range2))
- (lambda (e1 e2)
- (< (if (consp e1) (car e1) e1)
- (if (consp e2) (car e2) e2))))
+ range2 (sort (if (listp (cdr range2)) range2 (list range2))
+ (lambda (e1 e2)
+ (< (if (consp e1) (car e1) e1)
+ (if (consp e2) (car e2) e2))))
r1 (car range1)
r2 (car range2)
r1_min (if (consp r1) (car r1) r1)
r2_min (if (consp r2) (car r2) r2)
r2_max (if (consp r2) (cdr r2) r2))
(while (and range1 range2)
- (cond ((< r2_max r1_min) ; r2 < r1
+ (cond ((< r2_max r1_min) ; r2 < r1
(pop range2)
(setq r2 (car range2)
r2_min (if (consp r2) (car r2) r2)
(push r1_min out)
(push (cons r1_min (1- r2_min)) out))
(pop range2)
- (if (< r2_max r1_max) ; finished with r1?
+ (if (< r2_max r1_max) ; finished with r1?
(setq r1_min (1+ r2_max))
(pop range1)
(setq r1 (car range1)
(setq r1 (car range1)
r1_min (if (consp r1) (car r1) r1)
r1_max (if (consp r1) (cdr r1) r1)))
- ((< r1_max r2_min) ; r2 > r1
+ ((< r1_max r2_min) ; r2 > r1
(pop range1)
(if (eq r1_min r1_max)
(push r1_min out)
(error "No articles have been picked"))))
(defun gnus-pick-goto-article (arg)
- "Go to the article number indicated by ARG. If ARG is an invalid
-article number, then stay on current line."
+ "Go to the article number indicated by ARG.
+If ARG is an invalid article number, then stay on current line."
(let (pos)
(save-excursion
(goto-char (point-min))
(goto-char pos))))
(defun gnus-pick-article (&optional arg)
- "Pick the article on the current line.
+ "Pick the article on the current line.
If ARG, pick the article on that line instead."
(interactive "P")
(when arg
;; (but not outside the window where the drag started).
(let (event end end-point (end-of-range (point)))
(track-mouse
- (while (progn
- (setq event (cdr (gnus-read-event-char)))
- (or (mouse-movement-p event)
- (eq (car-safe event) 'switch-frame)))
- (if (eq (car-safe event) 'switch-frame)
- nil
- (setq end (event-end event)
- end-point (posn-point end))
-
- (cond
- ;; Are we moving within the original window?
- ((and (eq (posn-window end) start-window)
- (integer-or-marker-p end-point))
- ;; Go to START-POINT first, so that when we move to END-POINT,
- ;; if it's in the middle of intangible text,
- ;; point jumps in the direction away from START-POINT.
- (goto-char start-point)
- (goto-char end-point)
- (gnus-pick-article)
- ;; In case the user moved his mouse really fast, pick
- ;; articles on the line between this one and the last one.
- (let* ((this-line (1+ (count-lines 1 end-point)))
- (min-line (min this-line start-line))
- (max-line (max this-line start-line)))
- (while (< min-line max-line)
- (goto-line min-line)
- (gnus-pick-article)
- (setq min-line (1+ min-line)))
- (setq start-line this-line))
- (when (zerop (% click-count 3))
- (setq end-of-range (point))))
- (t
- (let ((mouse-row (cdr (cdr (mouse-position)))))
- (cond
- ((null mouse-row))
- ((< mouse-row top)
- (mouse-scroll-subr start-window (- mouse-row top)))
- ((>= mouse-row bottom)
- (mouse-scroll-subr start-window
- (1+ (- mouse-row bottom)))))))))))
+ (while (progn
+ (setq event (cdr (gnus-read-event-char)))
+ (or (mouse-movement-p event)
+ (eq (car-safe event) 'switch-frame)))
+ (if (eq (car-safe event) 'switch-frame)
+ nil
+ (setq end (event-end event)
+ end-point (posn-point end))
+
+ (cond
+ ;; Are we moving within the original window?
+ ((and (eq (posn-window end) start-window)
+ (integer-or-marker-p end-point))
+ ;; Go to START-POINT first, so that when we move to END-POINT,
+ ;; if it's in the middle of intangible text,
+ ;; point jumps in the direction away from START-POINT.
+ (goto-char start-point)
+ (goto-char end-point)
+ (gnus-pick-article)
+ ;; In case the user moved his mouse really fast, pick
+ ;; articles on the line between this one and the last one.
+ (let* ((this-line (1+ (count-lines 1 end-point)))
+ (min-line (min this-line start-line))
+ (max-line (max this-line start-line)))
+ (while (< min-line max-line)
+ (goto-line min-line)
+ (gnus-pick-article)
+ (setq min-line (1+ min-line)))
+ (setq start-line this-line))
+ (when (zerop (% click-count 3))
+ (setq end-of-range (point))))
+ (t
+ (let ((mouse-row (cdr (cdr (mouse-position)))))
+ (cond
+ ((null mouse-row))
+ ((< mouse-row top)
+ (mouse-scroll-subr start-window (- mouse-row top)))
+ ((>= mouse-row bottom)
+ (mouse-scroll-subr start-window
+ (1+ (- mouse-row bottom)))))))))))
(when (consp event)
(let ((fun (key-binding (vector (car event)))))
;; Run the binding of the terminating up-event, if possible.
(setq gnus-binary-mode-map (make-sparse-keymap))
(gnus-define-keys
- gnus-binary-mode-map
- "g" gnus-binary-show-article))
+ gnus-binary-mode-map
+ "g" gnus-binary-show-article))
(defun gnus-binary-make-menu-bar ()
(unless (boundp 'gnus-binary-menu)
(setq gnus-tree-mode-map (make-keymap))
(suppress-keymap gnus-tree-mode-map)
(gnus-define-keys
- gnus-tree-mode-map
- "\r" gnus-tree-select-article
- gnus-mouse-2 gnus-tree-pick-article
- "\C-?" gnus-tree-read-summary-keys
- "h" gnus-tree-show-summary
+ gnus-tree-mode-map
+ "\r" gnus-tree-select-article
+ gnus-mouse-2 gnus-tree-pick-article
+ "\C-?" gnus-tree-read-summary-keys
+ "h" gnus-tree-show-summary
- "\C-c\C-i" gnus-info-find-node)
+ "\C-c\C-i" gnus-info-find-node)
(substitute-key-definition
'undefined 'gnus-tree-read-summary-keys gnus-tree-mode-map))
(gnus-catchup-mark (subject -10))
(gnus-killed-mark (from -1) (subject -20))
(gnus-del-mark (from -2) (subject -15)))
-"*Alist of marks and scores."
-:group 'gnus-score-adapt
-:type '(repeat (cons (symbol :tag "Mark")
- (repeat (list (choice :tag "Header"
- (const from)
- (const subject)
- (symbol :tag "other"))
- (integer :tag "Score"))))))
+ "*Alist of marks and scores."
+ :group 'gnus-score-adapt
+ :type '(repeat (cons (symbol :tag "Mark")
+ (repeat (list (choice :tag "Header"
+ (const from)
+ (const subject)
+ (symbol :tag "other"))
+ (integer :tag "Score"))))))
(defcustom gnus-ignored-adaptive-words nil
"List of words to be ignored when doing adaptive word scoring."
(,gnus-catchup-mark . -10)
(,gnus-killed-mark . -20)
(,gnus-del-mark . -15))
-"*Alist of marks and scores."
-:group 'gnus-score-adapt
-:type '(repeat (cons (character :tag "Mark")
- (integer :tag "Score"))))
+ "*Alist of marks and scores."
+ :group 'gnus-score-adapt
+ :type '(repeat (cons (character :tag "Mark")
+ (integer :tag "Score"))))
(defcustom gnus-adaptive-word-minimum nil
"If a number, this is the minimum score value that can be assigned to a word."
;; with working on them as a group. What a hassle.
;; Just wait 'til you see what horrors we commit against `match'...
(if (= gnus-score-index 9)
- (setq this (prin1-to-string this))) ; ick.
+ (setq this (prin1-to-string this))) ; ick.
(if simplify
(setq this (gnus-map-function gnus-simplify-subject-functions this)))
(when extra
(setq match (concat "[ (](" extra " \\. \"[^)]*"
match "[^(]*\")[ )]")
- search-func 're-search-forward)) ; XXX danger?!?
+ search-func 're-search-forward)) ; XXX danger?!?
(cond
;; Fuzzy matches. We save these for later.
(cond
;; Permanent.
((null date)
+ ;; Do nothing.
)
;; Match, update date.
((and found gnus-update-score-entry-dates)
(cond
;; Permanent.
((null date)
+ ;; Do nothing.
)
;; Match, update date.
((and found gnus-update-score-entry-dates)
(cond
(bad (cons 'bad bad))
(new (cons 'new new))
- ;; or nil
- )))))
+ (t nil))))))
(provide 'gnus-score)
"Directory where Big Brother Database is found.")
(defvar gnus-use-mhe nil
- "Set this if you want to use MH-E for mail reading")
+ "Set this if you want to use MH-E for mail reading.")
(defvar gnus-use-rmail nil
- "Set this if you want to use RMAIL for mail reading")
+ "Set this if you want to use RMAIL for mail reading.")
(defvar gnus-use-sendmail t
- "Set this if you want to use SENDMAIL for mail reading")
+ "Set this if you want to use SENDMAIL for mail reading.")
(defvar gnus-use-vm nil
- "Set this if you want to use the VM package for mail reading")
+ "Set this if you want to use the VM package for mail reading.")
(defvar gnus-use-sc nil
- "Set this if you want to use Supercite")
+ "Set this if you want to use Supercite.")
(defvar gnus-use-mailcrypt t
- "Set this if you want to use Mailcrypt for dealing with PGP messages")
+ "Set this if you want to use Mailcrypt for dealing with PGP messages.")
(defvar gnus-use-bbdb nil
- "Set this if you want to use the Big Brother DataBase")
+ "Set this if you want to use the Big Brother DataBase.")
(when (and (not gnus-use-installed-gnus)
(null (member gnus-gnus-lisp-directory load-path)))
(buffer-disable-undo tmp-buf)
(save-excursion
(while articles
- ;; Put the article in a buffer.
+ ;; Put the article in a buffer.
(set-buffer tmp-buf)
(when (gnus-request-article-this-buffer
(car articles) gnus-newsgroup-name)
(gnus-tmp-where (nth 1 method))
(elem (assoc method gnus-opened-servers))
(gnus-tmp-status (cond ((eq (nth 1 elem) 'denied)
- "(denied)")
- ((or (gnus-server-opened method)
- (eq (nth 1 elem) 'ok))
- "(opened)")
- (t
- "(closed)"))))
+ "(denied)")
+ ((or (gnus-server-opened method)
+ (eq (nth 1 elem) 'ok))
+ "(opened)")
+ (t
+ "(closed)"))))
(beginning-of-line)
(gnus-add-text-properties
(point)
(suppress-keymap gnus-browse-mode-map)
(gnus-define-keys
- gnus-browse-mode-map
- " " gnus-browse-read-group
- "=" gnus-browse-select-group
- "n" gnus-browse-next-group
- "p" gnus-browse-prev-group
- "\177" gnus-browse-prev-group
- [delete] gnus-browse-prev-group
- "N" gnus-browse-next-group
- "P" gnus-browse-prev-group
- "\M-n" gnus-browse-next-group
- "\M-p" gnus-browse-prev-group
- "\r" gnus-browse-select-group
- "u" gnus-browse-unsubscribe-current-group
- "l" gnus-browse-exit
- "L" gnus-browse-exit
- "q" gnus-browse-exit
- "Q" gnus-browse-exit
- "\C-c\C-c" gnus-browse-exit
- "?" gnus-browse-describe-briefly
-
- "\C-c\C-i" gnus-info-find-node
- "\C-c\C-b" gnus-bug))
+ gnus-browse-mode-map
+ " " gnus-browse-read-group
+ "=" gnus-browse-select-group
+ "n" gnus-browse-next-group
+ "p" gnus-browse-prev-group
+ "\177" gnus-browse-prev-group
+ [delete] gnus-browse-prev-group
+ "N" gnus-browse-next-group
+ "P" gnus-browse-prev-group
+ "\M-n" gnus-browse-next-group
+ "\M-p" gnus-browse-prev-group
+ "\r" gnus-browse-select-group
+ "u" gnus-browse-unsubscribe-current-group
+ "l" gnus-browse-exit
+ "L" gnus-browse-exit
+ "q" gnus-browse-exit
+ "Q" gnus-browse-exit
+ "\C-c\C-c" gnus-browse-exit
+ "?" gnus-browse-describe-briefly
+
+ "\C-c\C-i" gnus-info-find-node
+ "\C-c\C-b" gnus-bug))
(defun gnus-browse-make-menu-bar ()
(gnus-turn-off-edit-menu 'browse)
:type 'boolean)
(defcustom gnus-ignored-newsgroups
- (mapconcat 'identity
- '("^to\\." ; not "real" groups
- "^[0-9. \t]+ " ; all digits in name
- "^[\"][]\"[#'()]" ; bogus characters
- )
- "\\|")
+ (mapconcat 'identity
+ '("^to\\." ; not "real" groups
+ "^[0-9. \t]+ " ; all digits in name
+ "^[\"][]\"[#'()]" ; bogus characters
+ )
+ "\\|")
"*A regexp to match uninteresting newsgroups in the active file.
Any lines in the active file matching this regular expression are
removed from the newsgroup list before anything else is done to it,
(let* ((gnus-subscribe-newsgroup-method
gnus-subscribe-newsgroup-method)
(check (cond
- ((or (and (= (or arg 1) 4)
- (not (listp gnus-check-new-newsgroups)))
- (null gnus-read-active-file)
- (eq gnus-read-active-file 'some))
- 'ask-server)
- ((= (or arg 1) 16)
- (setq gnus-subscribe-newsgroup-method
- 'gnus-subscribe-zombies)
- t)
- (t gnus-check-new-newsgroups))))
+ ((or (and (= (or arg 1) 4)
+ (not (listp gnus-check-new-newsgroups)))
+ (null gnus-read-active-file)
+ (eq gnus-read-active-file 'some))
+ 'ask-server)
+ ((= (or arg 1) 16)
+ (setq gnus-subscribe-newsgroup-method
+ 'gnus-subscribe-zombies)
+ t)
+ (t gnus-check-new-newsgroups))))
(unless (gnus-check-first-time-used)
(if (or (consp check)
(eq check 'ask-server))
hashtb))
(when new-newsgroups
(gnus-subscribe-hierarchical-interactive new-newsgroups)))
- (if (> groups 0)
- (gnus-message 5 "%d new newsgroup%s arrived"
- groups (if (> groups 1) "s have" " has"))
- (gnus-message 5 "No new newsgroups"))
+ (if (> groups 0)
+ (gnus-message 5 "%d new newsgroup%s arrived"
+ groups (if (> groups 1) "s have" " has"))
+ (gnus-message 5 "No new newsgroups"))
(when got-new
(setq gnus-newsrc-last-checked-date new-date))
got-new))
(setq active (gnus-active group))
(setq num
(if active (- (1+ (cdr active)) (car active)) t))
- ;; Shorten the select method if possible, if we need to
- ;; store it at all (native groups).
- (let ((method (gnus-method-simplify
- (or gnus-override-subscribe-method
- (gnus-group-method group)))))
- (if method
- (setq info (list group level nil nil method))
- (setq info (list group level nil)))))
+ ;; Shorten the select method if possible, if we need to
+ ;; store it at all (native groups).
+ (let ((method (gnus-method-simplify
+ (or gnus-override-subscribe-method
+ (gnus-group-method group)))))
+ (if method
+ (setq info (list group level nil nil method))
+ (setq info (list group level nil)))))
(unless previous
(setq previous
(let ((p gnus-newsrc-alist))
t)
(condition-case ()
(inline (gnus-request-group group dont-check method))
- ;(error nil)
+ ;;(error nil)
(quit nil))
(setq active (gnus-parse-active))
;; If there are no articles in the group, the GROUP
(cons :value ("" "") regexp (repeat string))
(sexp :value nil))))
-(defcustom gnus-unread-mark ? ;Whitespace
+(defcustom gnus-unread-mark ? ;Whitespace
"*Mark used for unread articles."
:group 'gnus-summary-marks
:type 'character)
:group 'gnus-summary-marks
:type 'character)
-(defcustom gnus-empty-thread-mark ? ;Whitespace
+(defcustom gnus-empty-thread-mark ? ;Whitespace
"*There is no thread under the article."
:group 'gnus-summary-marks
:type 'character)
(defvar gnus-thread-indent-array nil)
(defvar gnus-thread-indent-array-level gnus-thread-indent-level)
(defvar gnus-sort-gathered-threads-function 'gnus-thread-sort-by-number
- "Function called to sort the articles within a thread after it has
-been gathered together.")
+ "Function called to sort the articles within a thread after it has been gathered together.")
;; Avoid highlighting in kill files.
(defvar gnus-summary-inhibit-highlight nil)
'(mail-decode-encoded-word-string)
"List of methods used to decode encoded words.
-This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item is
-FUNCTION, FUNCTION will be apply to all newsgroups. If item is a
+This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item is
+FUNCTION, FUNCTION will be apply to all newsgroups. If item is a
(REGEXP . FUNCTION), FUNCTION will be only apply to thes newsgroups
whose names match REGEXP.
(defsubst gnus-simplify-buffer-fuzzy-step (regexp &optional newtext)
(goto-char (point-min))
(while (re-search-forward regexp nil t)
- (replace-match (or newtext ""))))
+ (replace-match (or newtext ""))))
(defun gnus-simplify-buffer-fuzzy ()
"Simplify string in the buffer fuzzily.
"c" gnus-article-copy-part
"e" gnus-article-externalize-part
"i" gnus-article-inline-part
- "|" gnus-article-pipe-part)
- )
+ "|" gnus-article-pipe-part))
(defun gnus-summary-make-menu-bar ()
(gnus-turn-off-edit-menu 'summary)
["Mark thread as read" gnus-summary-kill-thread t]
["Lower thread score" gnus-summary-lower-thread t]
["Raise thread score" gnus-summary-raise-thread t]
- ["Rethread current" gnus-summary-rethread-current t]
- ))
+ ["Rethread current" gnus-summary-rethread-current t]))
(easy-menu-define
gnus-summary-post-menu gnus-summary-mode-map ""
(if (or (null gnus-summary-default-score)
(<= (abs (- gnus-tmp-score gnus-summary-default-score))
gnus-summary-zcore-fuzz))
- ? ;Whitespace
+ ? ;Whitespace
(if (< gnus-tmp-score gnus-summary-default-score)
gnus-score-below-mark gnus-score-over-mark)))
(gnus-tmp-replied
(if (or (null gnus-summary-default-score)
(<= (abs (- score gnus-summary-default-score))
gnus-summary-zcore-fuzz))
- ? ;Whitespace
+ ? ;Whitespace
(if (< score gnus-summary-default-score)
gnus-score-below-mark gnus-score-over-mark))
'score))
(setq header
(make-full-mail-header
- number ; number
+ number ; number
(funcall gnus-decode-encoded-word-function
(nnheader-nov-field)) ; subject
(funcall gnus-decode-encoded-word-function
(nnheader-nov-field)) ; from
- (nnheader-nov-field) ; date
+ (nnheader-nov-field) ; date
(nnheader-nov-read-message-id) ; id
- (nnheader-nov-field) ; refs
- (nnheader-nov-read-integer) ; chars
- (nnheader-nov-read-integer) ; lines
+ (nnheader-nov-field) ; refs
+ (nnheader-nov-read-integer) ; chars
+ (nnheader-nov-read-integer) ; lines
(unless (eobp)
- (nnheader-nov-field)) ; misc
- (nnheader-nov-parse-extra)))) ; extra
+ (nnheader-nov-field)) ; misc
+ (nnheader-nov-parse-extra)))) ; extra
(widen))
;; using some other form will lead to serious barfage.
(or (symbolp thread) (signal 'wrong-type-argument '(symbolp thread)))
;; (8% speedup to gnus-summary-prepare, just for fun :-)
- (list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207" ;
+ (list 'byte-code "\10\211:\203\17\0\211@ ;\203\16\0A@@\207" ;
(vector thread) 2))
(defsubst gnus-article-sort-by-number (h1 h2)
(if (or (null gnus-summary-default-score)
(<= (abs (- gnus-tmp-score gnus-summary-default-score))
gnus-summary-zcore-fuzz))
- ? ;Whitespace
+ ? ;Whitespace
(if (< gnus-tmp-score gnus-summary-default-score)
gnus-score-below-mark gnus-score-over-mark))
gnus-tmp-replied
;; Add all marks lists to the list of marks lists.
(while (setq type (pop types))
(setq list (symbol-value
- (setq symbol
- (intern (format "gnus-newsgroup-%s"
- (car type))))))
+ (setq symbol
+ (intern (format "gnus-newsgroup-%s"
+ (car type))))))
(when list
;; Get rid of the entries of the articles that have the
(setq arts (cdr arts)))
(setq list (cdr all)))))
- (or (memq (cdr type) uncompressed)
- (setq list (gnus-compress-sequence (set symbol (sort list '<)) t)))
+ (or (memq (cdr type) uncompressed)
+ (setq list (gnus-compress-sequence (set symbol (sort list '<)) t)))
- (when (gnus-check-backend-function 'request-set-mark
- gnus-newsgroup-name)
- ;; uncompressed:s are not proper flags (they are cons cells)
- ;; cache is a internal gnus flag
- (unless (memq (cdr type) (cons 'cache uncompressed))
- (let* ((old (cdr (assq (cdr type) (gnus-info-marks info))))
- (del (gnus-remove-from-range (gnus-copy-sequence old) list))
- (add (gnus-remove-from-range (gnus-copy-sequence list) old)))
- (if add
- (push (list add 'add (list (cdr type))) delta-marks))
- (if del
- (push (list del 'del (list (cdr type))) delta-marks)))))
+ (when (gnus-check-backend-function 'request-set-mark
+ gnus-newsgroup-name)
+ ;; uncompressed:s are not proper flags (they are cons cells)
+ ;; cache is a internal gnus flag
+ (unless (memq (cdr type) (cons 'cache uncompressed))
+ (let* ((old (cdr (assq (cdr type) (gnus-info-marks info))))
+ (del (gnus-remove-from-range (gnus-copy-sequence old) list))
+ (add (gnus-remove-from-range (gnus-copy-sequence list) old)))
+ (if add
+ (push (list add 'add (list (cdr type))) delta-marks))
+ (if del
+ (push (list del 'del (list (cdr type))) delta-marks)))))
(when list
- (push (cons (cdr type) list) newmarked)))
+ (push (cons (cdr type) list) newmarked)))
(when delta-marks
(unless (gnus-check-group gnus-newsgroup-name)
headers id end ref
(mail-parse-charset gnus-newsgroup-charset)
(mail-parse-ignored-charsets
- (save-excursion (condition-case nil
- (set-buffer gnus-summary-buffer)
- (error))
- gnus-newsgroup-ignored-charsets)))
+ (save-excursion (condition-case nil
+ (set-buffer gnus-summary-buffer)
+ (error))
+ gnus-newsgroup-ignored-charsets)))
(save-excursion
(set-buffer nntp-server-buffer)
;; Translate all TAB characters into SPACE characters.
(key-binding
(read-key-sequence
(substitute-command-keys
- "\\<gnus-summary-mode-map>\\[gnus-summary-universal-argument]"
- ))))
+ "\\<gnus-summary-mode-map>\\[gnus-summary-universal-argument]"))))
'undefined)
(gnus-error 1 "Undefined key")
(save-excursion
gnus-newsgroup-name)) ; Server
(list 'gnus-request-accept-article
to-newsgroup (list 'quote select-method)
- (not articles) t) ; Accept form
+ (not articles) t) ; Accept form
(not articles))) ; Only save nov last time
;; Copy the article.
((eq action 'copy)
art-group))))))
(cond
((not art-group)
- (gnus-message 1 "Couldn't %s article %s: %s"
- (cadr (assq action names)) article
- (nnheader-get-report (car to-method))))
+ (gnus-message 1 "Couldn't %s article %s: %s"
+ (cadr (assq action names)) article
+ (nnheader-get-report (car to-method))))
((and (eq art-group 'junk)
(eq action 'move))
(gnus-summary-mark-article article gnus-canceled-mark)
(subst-char-in-region start (point) ?\n ?\^M)
(gnus-summary-goto-subject article))
(goto-char start)
- nil)
- ;;(gnus-summary-position-point)
- ))))
+ nil)))))
(defun gnus-summary-go-to-next-thread (&optional previous)
"Go to the same level (or less) next thread.
(gnus-info-set-read ',info ',(gnus-info-read info))
(gnus-get-unread-articles-in-group ',info (gnus-active ,group))
(gnus-group-update-group ,group t))))
- ;; Propagate the read marks to the backend.
- (if (gnus-check-backend-function 'request-set-mark group)
- (let ((del (gnus-remove-from-range (gnus-info-read info) read))
- (add (gnus-remove-from-range read (gnus-info-read info))))
- (when (or add del)
- (unless (gnus-check-group group)
- (error "Can't open server for %s" group))
- (gnus-request-set-mark
- group (delq nil (list (if add (list add 'add '(read)))
- (if del (list del 'del '(read)))))))))
+ ;; Propagate the read marks to the backend.
+ (if (gnus-check-backend-function 'request-set-mark group)
+ (let ((del (gnus-remove-from-range (gnus-info-read info) read))
+ (add (gnus-remove-from-range read (gnus-info-read info))))
+ (when (or add del)
+ (unless (gnus-check-group group)
+ (error "Can't open server for %s" group))
+ (gnus-request-set-mark
+ group (delq nil (list (if add (list add 'add '(read)))
+ (if del (list del 'del '(read)))))))))
;; Enter this list into the group info.
(gnus-info-set-read info read)
;; Set the number of unread articles in gnus-newsrc-hashtb.
"Setup newsgroup default charset."
(if (equal gnus-newsgroup-name "nndraft:drafts")
(setq gnus-newsgroup-charset nil)
- (let* ((name (and gnus-newsgroup-name
- (gnus-group-real-name gnus-newsgroup-name)))
- (ignored-charsets
- (or gnus-newsgroup-ephemeral-ignored-charsets
- (append
- (and gnus-newsgroup-name
- (or (gnus-group-find-parameter gnus-newsgroup-name
- 'ignored-charsets t)
- (let ((alist gnus-group-ignored-charsets-alist)
- elem (charsets nil))
- (while (setq elem (pop alist))
- (when (and name
- (string-match (car elem) name))
- (setq alist nil
- charsets (cdr elem))))
- charsets))))
- gnus-newsgroup-ignored-charsets)))
- (setq gnus-newsgroup-charset
- (or gnus-newsgroup-ephemeral-charset
- (and gnus-newsgroup-name
- (or (gnus-group-find-parameter gnus-newsgroup-name 'charset)
- (let ((alist gnus-group-charset-alist)
- elem charset)
- (while (setq elem (pop alist))
- (when (and name
- (string-match (car elem) name))
- (setq alist nil
- charset (cadr elem))))
- charset)))
- gnus-default-charset))
- (set (make-local-variable 'gnus-newsgroup-ignored-charsets)
- ignored-charsets))))
+ (let* ((name (and gnus-newsgroup-name
+ (gnus-group-real-name gnus-newsgroup-name)))
+ (ignored-charsets
+ (or gnus-newsgroup-ephemeral-ignored-charsets
+ (append
+ (and gnus-newsgroup-name
+ (or (gnus-group-find-parameter gnus-newsgroup-name
+ 'ignored-charsets t)
+ (let ((alist gnus-group-ignored-charsets-alist)
+ elem (charsets nil))
+ (while (setq elem (pop alist))
+ (when (and name
+ (string-match (car elem) name))
+ (setq alist nil
+ charsets (cdr elem))))
+ charsets))))
+ gnus-newsgroup-ignored-charsets)))
+ (setq gnus-newsgroup-charset
+ (or gnus-newsgroup-ephemeral-charset
+ (and gnus-newsgroup-name
+ (or (gnus-group-find-parameter gnus-newsgroup-name 'charset)
+ (let ((alist gnus-group-charset-alist)
+ elem charset)
+ (while (setq elem (pop alist))
+ (when (and name
+ (string-match (car elem) name))
+ (setq alist nil
+ charset (cadr elem))))
+ charset)))
+ gnus-default-charset))
+ (set (make-local-variable 'gnus-newsgroup-ignored-charsets)
+ ignored-charsets))))
;;;
;;; Mime Commands
(> unread 0))
(and gnus-list-groups-with-ticked-articles
(cdr (assq 'tick (gnus-info-marks info))))
- ; Has right readedness.
+ ;; Has right readedness.
;; Check for permanent visibility.
(and gnus-permanently-visible-groups
(string-match gnus-permanently-visible-groups group))
(if (null arg) (not gnus-topic-mode)
(> (prefix-numeric-value arg) 0)))
;; Infest Gnus with topics.
- (if (not gnus-topic-mode)
+ (if (not gnus-topic-mode)
(setq gnus-goto-missing-group-function nil)
(when (gnus-visual-p 'topic-menu 'menu)
(gnus-topic-make-menu-bar))
(save-excursion
(gnus-message 5 "Expiring groups in %s..." topic)
(let ((gnus-group-marked
- (mapcar (lambda (entry) (car (nth 2 entry)))
- (gnus-topic-find-groups topic gnus-level-killed t))))
- (gnus-group-expire-articles nil))
+ (mapcar (lambda (entry) (car (nth 2 entry)))
+ (gnus-topic-find-groups topic gnus-level-killed t))))
+ (gnus-group-expire-articles nil))
(gnus-message 5 "Expiring groups in %s...done" topic))))
(defun gnus-topic-read-group (&optional all no-article group)
(error "Can't find topic `%s'" current))
(unless to-top
(error "Can't find topic `%s'" to))
- (if (gnus-topic-find-topology to current-top 0) ;; Don't care the level
+ (if (gnus-topic-find-topology to current-top 0);; Don't care the level
(error "Can't move `%s' to its sub-level" current))
(gnus-topic-find-topology current nil nil 'delete)
(while (cdr to-top)
(setq gnus-undo-mode-map (make-sparse-keymap))
(gnus-define-keys gnus-undo-mode-map
- "\M-\C-_" gnus-undo
- "\C-_" gnus-undo
- "\C-xu" gnus-undo
- ;; many people are used to type `C-/' on X terminals and get `C-_'.
- [(control /)] gnus-undo))
+ "\M-\C-_" gnus-undo
+ "\C-_" gnus-undo
+ "\C-xu" gnus-undo
+ ;; many people are used to type `C-/' on X terminals and get `C-_'.
+ [(control /)] gnus-undo))
(defun gnus-undo-make-menu-bar ()
;; This is disabled for the time being.
first 't2
last 't1))
((gnus-functionp function)
+ ;; Do nothing.
)
(t
(error "Invalid sort spec: %s" function))))
"P" gnus-uu-decode-postscript-and-save)
(gnus-define-keys
- (gnus-uu-extract-view-map "v" gnus-uu-extract-map)
- "u" gnus-uu-decode-uu-view
- "U" gnus-uu-decode-uu-and-save-view
- "s" gnus-uu-decode-unshar-view
- "S" gnus-uu-decode-unshar-and-save-view
- "o" gnus-uu-decode-save-view
- "O" gnus-uu-decode-save-view
- "b" gnus-uu-decode-binhex-view
- "B" gnus-uu-decode-binhex-view
- "p" gnus-uu-decode-postscript-view
- "P" gnus-uu-decode-postscript-and-save-view)
+ (gnus-uu-extract-view-map "v" gnus-uu-extract-map)
+ "u" gnus-uu-decode-uu-view
+ "U" gnus-uu-decode-uu-and-save-view
+ "s" gnus-uu-decode-unshar-view
+ "S" gnus-uu-decode-unshar-and-save-view
+ "o" gnus-uu-decode-save-view
+ "O" gnus-uu-decode-save-view
+ "b" gnus-uu-decode-binhex-view
+ "B" gnus-uu-decode-binhex-view
+ "p" gnus-uu-decode-postscript-view
+ "P" gnus-uu-decode-postscript-and-save-view)
;; Commands.
(article 1.0)))
(t
'(vertical 1.0
- (summary 0.25 point)
- (if gnus-carpal '(summary-carpal 4))
- (article 1.0)))))
+ (summary 0.25 point)
+ (if gnus-carpal '(summary-carpal 4))
+ (article 1.0)))))
(server
(vertical 1.0
(server 1.0 point)
(if (and (setq buf (get-buffer (gnus-window-to-buffer-helper buffer)))
(setq win (get-buffer-window buf t)))
(if (memq 'point split)
- (setq all-visible win))
+ (setq all-visible win))
(setq all-visible nil)))
(t
(when (eq type 'frame)
gnus-summary-catchup t "Catchup"]
[gnus-summary-catchup-and-exit
gnus-summary-catchup-and-exit t "Catchup and exit"]
- [gnus-summary-exit gnus-summary-exit t "Exit this summary"]
- )
+ [gnus-summary-exit gnus-summary-exit t "Exit this summary"])
"The summary buffer toolbar.")
(defvar gnus-summary-mail-toolbar
[gnus-summary-next-unread
gnus-summary-next-unread-article t "Next unread article"]
[gnus-summary-mail-reply gnus-summary-reply t "Reply"]
-; [gnus-summary-mail-get gnus-mail-get t "Message get"]
[gnus-summary-mail-originate gnus-summary-post-news t "Originate"]
[gnus-summary-mail-save gnus-summary-save-article t "Save"]
[gnus-summary-mail-copy gnus-summary-copy-article t "Copy message"]
-; [gnus-summary-mail-delete gnus-summary-delete-article t "Delete message"]
[gnus-summary-mail-forward gnus-summary-mail-forward t "Forward message"]
-; [gnus-summary-mail-spell gnus-mail-spell t "Spell"]
-; [gnus-summary-mail-help gnus-mail-help t "Message help"]
[gnus-summary-caesar-message
gnus-summary-caesar-message t "Rot 13"]
[gnus-uu-decode-uu
gnus-summary-catchup t "Catchup"]
[gnus-summary-catchup-and-exit
gnus-summary-catchup-and-exit t "Catchup and exit"]
- [gnus-summary-exit gnus-summary-exit t "Exit this summary"]
- )
+ [gnus-summary-exit gnus-summary-exit t "Exit this summary"])
"The summary buffer mail toolbar.")
(defun gnus-xmas-setup-group-toolbar ()
you could set this variable:
\(setq gnus-secondary-select-methods '((nnml \"\")))"
-:group 'gnus-server
-:type '(repeat gnus-select-method))
+ :group 'gnus-server
+ :type '(repeat gnus-select-method))
(defvar gnus-backup-default-subscribed-newsgroups
'("news.announce.newusers" "news.groups.questions" "gnu.emacs.gnus")
(defvar gnus-variable-list
'(gnus-newsrc-options gnus-newsrc-options-n
- gnus-newsrc-last-checked-date
- gnus-newsrc-alist gnus-server-alist
- gnus-killed-list gnus-zombie-list
- gnus-topic-topology gnus-topic-alist
- gnus-format-specs)
+ gnus-newsrc-last-checked-date
+ gnus-newsrc-alist gnus-server-alist
+ gnus-killed-list gnus-zombie-list
+ gnus-topic-topology gnus-topic-alist
+ gnus-format-specs)
"Gnus variables saved in the quick startup file.")
(defvar gnus-newsrc-alist nil
gnus-cache-retrieve-headers gnus-cache-possibly-alter-active
gnus-cache-enter-remove-article gnus-cached-article-p
gnus-cache-open gnus-cache-close gnus-cache-update-article)
- ("gnus-cache" :interactive t gnus-jog-cache gnus-cache-enter-article
- gnus-cache-remove-article gnus-summary-insert-cached-articles)
- ("gnus-score" :interactive t
- gnus-summary-increase-score gnus-summary-set-score
- gnus-summary-raise-thread gnus-summary-raise-same-subject
- gnus-summary-raise-score gnus-summary-raise-same-subject-and-select
- gnus-summary-lower-thread gnus-summary-lower-same-subject
- gnus-summary-lower-score gnus-summary-lower-same-subject-and-select
- gnus-summary-current-score gnus-score-default
- gnus-score-flush-cache gnus-score-close
- gnus-possibly-score-headers gnus-score-followup-article
- gnus-score-followup-thread)
- ("gnus-score"
- (gnus-summary-score-map keymap) gnus-score-save gnus-score-headers
+ ("gnus-cache" :interactive t gnus-jog-cache gnus-cache-enter-article
+ gnus-cache-remove-article gnus-summary-insert-cached-articles)
+ ("gnus-score" :interactive t
+ gnus-summary-increase-score gnus-summary-set-score
+ gnus-summary-raise-thread gnus-summary-raise-same-subject
+ gnus-summary-raise-score gnus-summary-raise-same-subject-and-select
+ gnus-summary-lower-thread gnus-summary-lower-same-subject
+ gnus-summary-lower-score gnus-summary-lower-same-subject-and-select
+ gnus-summary-current-score gnus-score-default
+ gnus-score-flush-cache gnus-score-close
+ gnus-possibly-score-headers gnus-score-followup-article
+ gnus-score-followup-thread)
+ ("gnus-score"
+ (gnus-summary-score-map keymap) gnus-score-save gnus-score-headers
gnus-current-score-file-nondirectory gnus-score-adaptive
gnus-score-find-trace gnus-score-file-name)
("gnus-cus" :interactive t gnus-group-customize gnus-score-customize)
(let ((methods gnus-secondary-select-methods)
(gmethod (gnus-server-get-method nil method)))
(while (and methods
- (not (gnus-method-equal
- (gnus-server-get-method nil (car methods))
- gmethod)))
+ (not (gnus-method-equal
+ (gnus-server-get-method nil (car methods))
+ gmethod)))
(setq methods (cdr methods)))
methods))
(let ((opened gnus-opened-servers))
(while (and method opened)
(when (and (equal (cadr method) (cadaar opened))
- (equal (car method) (caaar opened))
+ (equal (car method) (caaar opened))
(not (equal method (caar opened))))
(setq method nil))
(pop opened))
(or gnus-override-method
(and (not group)
gnus-select-method)
- (and (not (gnus-group-entry group)) ;; a new group
+ (and (not (gnus-group-entry group));; a new group
(gnus-group-name-to-method group))
(let ((info (or info (gnus-get-info group)))
method)
;; imap.el is roughly divided in two parts, one that parses IMAP
;; responses from the server and storing data into buffer-local
;; variables, and one for utility functions which send commands to
-;; server, waits for an answer, and return information. The latter
+;; server, waits for an answer, and return information. The latter
;; part is layered on top of the previous.
;;
;; The imap.el API consist of the following functions, other functions
;; imap-body-lines
;;
;; It is my hope that theese commands should be pretty self
-;; explanatory for someone that know IMAP. All functions have
+;; explanatory for someone that know IMAP. All functions have
;; additional documentation on how to invoke them.
;;
;; imap.el support RFC1730/2060 (IMAP4/IMAP4rev1), implemented IMAP
;; the UNSELECT extension in Cyrus IMAPD.
;;
;; Without the work of John McClary Prevost and Jim Radford this library
-;; would not have seen the light of day. Many thanks.
+;; would not have seen the light of day. Many thanks.
;;
;; This is a transcript of short interactive session for demonstration
;; purposes.
;; => " *imap* my.mail.server:0"
;;
;; The rest are invoked with current buffer as the buffer returned by
-;; `imap-open'. It is possible to do all without this, but it would
+;; `imap-open'. It is possible to do all without this, but it would
;; look ugly here since `buffer' is always the last argument for all
;; imap.el API functions.
;;
stdout.")
(defvar imap-ssl-program 'auto
- "Program to use for SSL connections. It is called like this
+ "Program to use for SSL connections.
+It is called like this:
`imap-ssl-program' `imap-ssl-arguments' -ssl2 -connect host:port
-where -ssl2 can also be -ssl3 to indicate which ssl version to use. It
+where -ssl2 can also be -ssl3 to indicate which ssl version to use. It
should accept IMAP commands on stdin and return responses to stdout.
For SSLeay set this to \"s_client\" and `imap-ssl-arguments' to nil,
"Hooks called after receiving each FETCH response.")
(defvar imap-streams '(kerberos4 ssl network)
- "Priority of streams to consider when opening connection to
-server.")
+ "Priority of streams to consider when opening connection to server.")
(defvar imap-stream-alist
'((kerberos4 imap-kerberos4s-p imap-kerberos4-open)
stream.")
(defvar imap-authenticators '(kerberos4 cram-md5 login anonymous)
- "Priority of authenticators to consider when authenticating to
-server.")
+ "Priority of authenticators to consider when authenticating to server.")
(defvar imap-authenticator-alist
'((kerberos4 imap-kerberos4a-p imap-kerberos4-auth)
(NAME CHECK AUTHENTICATE)
-NAME names the authenticator. CHECK is a function returning non-nil if
+NAME names the authenticator. CHECK is a function returning non-nil if
the server support the authenticator and AUTHENTICATE is a function
for doing the actuall authentification.")
characters, you may disable this decoding if you need to access UTF7
encoded mailboxes which doesn't translate into ISO-8859-1.")
-;; Internal constants. Change theese and die.
+;; Internal constants. Change theese and die.
(defconst imap-default-port 143)
(defconst imap-default-ssl-port 993)
(defvar imap-username nil)
(defvar imap-password nil)
(defvar imap-state 'closed
- "IMAP state. Valid states are `closed', `initial', `nonauth',
-`auth', `selected' and `examine'.")
+ "IMAP state.
+Valid states are `closed', `initial', `nonauth', `auth', `selected'
+and `examine'.")
(defvar imap-server-eol "\r\n"
"The EOL string sent from the server.")
"Lower limit on command tags that have been parsed.")
(defvar imap-failed-tags nil
- "Alist of tags that failed. Each element is a list with four
-elements; tag (a integer), response state (a symbol, `OK', `NO' or
-`BAD'), response code (a string), and human readable response text (a
-string).")
+ "Alist of tags that failed.
+Each element is a list with four elements; tag (a integer), response
+state (a symbol, `OK', `NO' or `BAD'), response code (a string), and
+human readable response text (a string).")
(defvar imap-tag 0
"Command tag number.")
"Process.")
(defvar imap-continuation nil
- "Non-nil indicates that the server emitted a continuation request. The
-actually value is really the text on the continuation line.")
+ "Non-nil indicates that the server emitted a continuation request.
+The actually value is really the text on the continuation line.")
(defvar imap-log nil
"Imap session trace.")
-(defvar imap-debug nil;"*imap-debug*"
+(defvar imap-debug nil ;"*imap-debug*"
"Random debug spew.")
\f
(set-buffer-multibyte nil)))
(defun imap-read-passwd (prompt &rest args)
- "Read a password using PROMPT. If ARGS, PROMPT is used as an
-argument to `format'."
+ "Read a password using PROMPT.
+If ARGS, PROMPT is used as an argument to `format'."
(let ((prompt (if args
(apply 'format prompt args)
prompt)))
(buffer-disable-undo)
(goto-char (point-max))
(insert-buffer-substring buffer)))
- (let ((response (match-string 1)))
- (erase-buffer)
- (message "Kerberized IMAP connection: %s" response)
- (if (and response (let ((case-fold-search nil))
- (not (string-match "failed" response))))
- process
- (if (memq (process-status process) '(open run))
- (imap-send-command-wait "LOGOUT"))
- (delete-process process)
- nil))))))
+ (let ((response (match-string 1)))
+ (erase-buffer)
+ (message "Kerberized IMAP connection: %s" response)
+ (if (and response (let ((case-fold-search nil))
+ (not (string-match "failed" response))))
+ process
+ (if (memq (process-status process) '(open run))
+ (imap-send-command-wait "LOGOUT"))
+ (delete-process process)
+ nil))))))
(defun imap-ssl-p (buffer)
nil)
;; Server functions; authenticator stuff:
(defun imap-interactive-login (buffer loginfunc)
- "Login to server in BUFFER. LOGINFUNC is passed a username and a
-password, it should return t if it where sucessful authenticating
-itself to the server, nil otherwise. Returns t if login was
-successful, nil otherwise."
+ "Login to server in BUFFER.
+LOGINFUNC is passed a username and a password, it should return t if
+it where sucessful authenticating itself to the server, nil otherwise.
+Returns t if login was successful, nil otherwise."
(with-current-buffer buffer
(make-variable-buffer-local 'imap-username)
(make-variable-buffer-local 'imap-password)
(let (user passwd ret)
-;; (condition-case ()
- (while (or (not user) (not passwd))
- (setq user (or imap-username
- (read-from-minibuffer
- (concat "IMAP username for " imap-server ": ")
- (or user imap-default-user))))
- (setq passwd (or imap-password
- (imap-read-passwd
- (concat "IMAP password for " user "@"
- imap-server ": "))))
- (when (and user passwd)
- (if (funcall loginfunc user passwd)
- (progn
- (setq ret t
- imap-username user)
- (if (and (not imap-password)
- (y-or-n-p "Store password for this session? "))
- (setq imap-password passwd)))
- (message "Login failed...")
- (setq passwd nil)
- (sit-for 1))))
-;; (quit (with-current-buffer buffer
-;; (setq user nil
-;; passwd nil)))
-;; (error (with-current-buffer buffer
-;; (setq user nil
-;; passwd nil))))
+ ;; (condition-case ()
+ (while (or (not user) (not passwd))
+ (setq user (or imap-username
+ (read-from-minibuffer
+ (concat "IMAP username for " imap-server ": ")
+ (or user imap-default-user))))
+ (setq passwd (or imap-password
+ (imap-read-passwd
+ (concat "IMAP password for " user "@"
+ imap-server ": "))))
+ (when (and user passwd)
+ (if (funcall loginfunc user passwd)
+ (progn
+ (setq ret t
+ imap-username user)
+ (if (and (not imap-password)
+ (y-or-n-p "Store password for this session? "))
+ (setq imap-password passwd)))
+ (message "Login failed...")
+ (setq passwd nil)
+ (sit-for 1))))
+ ;; (quit (with-current-buffer buffer
+ ;; (setq user nil
+ ;; passwd nil)))
+ ;; (error (with-current-buffer buffer
+ ;; (setq user nil
+ ;; passwd nil))))
ret)))
(defun imap-kerberos4a-p (buffer)
imap-process))))
(defun imap-open (server &optional port stream auth buffer)
- "Open a IMAP connection to host SERVER at PORT returning a
-buffer. If PORT is unspecified, a default value is used (143 except
+ "Open a IMAP connection to host SERVER at PORT returning a buffer.
+If PORT is unspecified, a default value is used (143 except
for SSL which use 993).
STREAM indicates the stream to use, see `imap-streams' for available
-streams. If nil, it choices the best stream the server is capable of.
+streams. If nil, it choices the best stream the server is capable of.
AUTH indicates authenticator to use, see `imap-authenticators' for
-available authenticators. If nil, it choices the best stream the
+available authenticators. If nil, it choices the best stream the
server is capable of.
BUFFER can be a buffer or a name of a buffer, which is created if
-necessery. If nil, the buffer name is generated."
+necessery. If nil, the buffer name is generated."
(setq buffer (or buffer (format " *imap* %s:%d" server (or port 0))))
(with-current-buffer (get-buffer-create buffer)
(if (imap-opened buffer)
buffer)))
(defun imap-opened (&optional buffer)
- "Return non-nil if connection to imap server in BUFFER is open. If
-BUFFER is nil then the current buffer is used."
+ "Return non-nil if connection to imap server in BUFFER is open.
+If BUFFER is nil then the current buffer is used."
(and (setq buffer (get-buffer (or buffer (current-buffer))))
(buffer-live-p buffer)
(with-current-buffer buffer
(memq (process-status imap-process) '(open run))))))
(defun imap-authenticate (&optional user passwd buffer)
- "Authenticate to server in BUFFER, using current buffer if nil. It
-uses the authenticator specified when opening the server. If the
+ "Authenticate to server in BUFFER, using current buffer if nil.
+It uses the authenticator specified when opening the server. If the
authenticator requires username/passwords, they are queried from the
user and optionally stored in the buffer. If USER and/or PASSWD is
specified, the user will not be questioned and the username and/or
(setq imap-state 'auth)))))
(defun imap-close (&optional buffer)
- "Close connection to server in BUFFER. If BUFFER is nil, the current
-buffer is used."
+ "Close connection to server in BUFFER.
+If BUFFER is nil, the current buffer is used."
(with-current-buffer (or buffer (current-buffer))
(and (imap-opened)
(not (imap-ok-p (imap-send-command-wait "LOGOUT")))
t))
(defun imap-capability (&optional identifier buffer)
- "Return a list of identifiers which server in BUFFER support. If
-IDENTIFIER, return non-nil if it's among the servers capabilities. If
-BUFFER is nil, the current buffer is assumed."
+ "Return a list of identifiers which server in BUFFER support.
+If IDENTIFIER, return non-nil if it's among the servers capabilities.
+If BUFFER is nil, the current buffer is assumed."
(with-current-buffer (or buffer (current-buffer))
(unless imap-capability
(unless (imap-ok-p (imap-send-command-wait "CAPABILITY"))
imap-capability)))
(defun imap-namespace (&optional buffer)
- "Return a namespace hierarchy at server in BUFFER. If BUFFER is nil,
-the current buffer is assumed."
+ "Return a namespace hierarchy at server in BUFFER.
+If BUFFER is nil, the current buffer is assumed."
(with-current-buffer (or buffer (current-buffer))
(unless imap-namespace
(when (imap-capability 'NAMESPACE)
result)))
(defun imap-mailbox-map (func &optional buffer)
- "Map a function across each mailbox in `imap-mailbox-data',
-returning a list. Function should take a mailbox name (a string) as
+ "Map a function across each mailbox in `imap-mailbox-data', returning a list.
+Function should take a mailbox name (a string) as
the only argument."
(imap-mailbox-map-1 func 'imap-utf7-decode buffer))
(imap-current-mailbox-p-1 (imap-utf7-encode mailbox) examine)))
(defun imap-mailbox-select-1 (mailbox &optional examine)
- "Select MAILBOX on server in BUFFER. If EXAMINE is non-nil, do a
-read-only select."
+ "Select MAILBOX on server in BUFFER.
+If EXAMINE is non-nil, do a read-only select."
(if (imap-current-mailbox-p-1 mailbox examine)
imap-current-mailbox
(setq imap-current-mailbox mailbox)
(imap-mailbox-select-1 (imap-utf7-encode mailbox) examine))))
(defun imap-mailbox-examine (mailbox &optional buffer)
- "Examine MAILBOX on server in BUFFER"
+ "Examine MAILBOX on server in BUFFER."
(imap-mailbox-select mailbox 'exmine buffer))
(defun imap-mailbox-unselect (&optional buffer)
t)))
(defun imap-mailbox-expunge (&optional buffer)
- "Expunge articles in current folder in BUFFER. If BUFFER is
-nil the current buffer is assumed."
+ "Expunge articles in current folder in BUFFER.
+If BUFFER is nil the current buffer is assumed."
(with-current-buffer (or buffer (current-buffer))
(when (and imap-current-mailbox (not (eq imap-state 'examine)))
(imap-ok-p (imap-send-command-wait "EXPUNGE")))))
(defun imap-mailbox-close (&optional buffer)
- "Expunge articles and close current folder in BUFFER. If BUFFER is
-nil the current buffer is assumed."
+ "Expunge articles and close current folder in BUFFER.
+If BUFFER is nil the current buffer is assumed."
(with-current-buffer (or buffer (current-buffer))
(when (and imap-current-mailbox
(imap-ok-p (imap-send-command-wait "CLOSE")))
- (setq imap-current-mailbox nil
- imap-message-data nil
- imap-state 'auth)
- t)))
+ (setq imap-current-mailbox nil
+ imap-message-data nil
+ imap-state 'auth)
+ t)))
(defun imap-mailbox-create-1 (mailbox)
(imap-ok-p (imap-send-command-wait (list "CREATE \"" mailbox "\""))))
(defun imap-mailbox-create (mailbox &optional buffer)
- "Create MAILBOX on server in BUFFER. If BUFFER is nil the current
-buffer is assumed."
+ "Create MAILBOX on server in BUFFER.
+If BUFFER is nil the current buffer is assumed."
(with-current-buffer (or buffer (current-buffer))
(imap-mailbox-create-1 (imap-utf7-encode mailbox))))
(defun imap-mailbox-delete (mailbox &optional buffer)
- "Delete MAILBOX on server in BUFFER. If BUFFER is nil the current
-buffer is assumed."
+ "Delete MAILBOX on server in BUFFER.
+If BUFFER is nil the current buffer is assumed."
(let ((mailbox (imap-utf7-encode mailbox)))
(with-current-buffer (or buffer (current-buffer))
(imap-ok-p
(imap-send-command-wait (list "DELETE \"" mailbox "\""))))))
(defun imap-mailbox-rename (oldname newname &optional buffer)
- "Rename mailbox OLDNAME to NEWNAME on server in BUFFER. If BUFFER is
-nil the current buffer is assumed."
+ "Rename mailbox OLDNAME to NEWNAME on server in BUFFER.
+If BUFFER is nil the current buffer is assumed."
(let ((oldname (imap-utf7-encode oldname))
(newname (imap-utf7-encode newname)))
(with-current-buffer (or buffer (current-buffer))
(defun imap-mailbox-lsub (&optional root reference add-delimiter buffer)
"Return a list of subscribed mailboxes on server in BUFFER.
If ROOT is non-nil, only list matching mailboxes. If ADD-DELIMITER is
-non-nil, a hierarchy delimiter is added to root. REFERENCE is a
+non-nil, a hierarchy delimiter is added to root. REFERENCE is a
implementation-specific string that has to be passed to lsub command."
(with-current-buffer (or buffer (current-buffer))
;; Make sure we know the hierarchy separator for root's hierarchy
(defun imap-mailbox-list (root &optional reference add-delimiter buffer)
"Return a list of mailboxes matching ROOT on server in BUFFER.
If ADD-DELIMITER is non-nil, a hierarchy delimiter is added to
-root. REFERENCE is a implementation-specific string that has to be
+root. REFERENCE is a implementation-specific string that has to be
passed to list command."
(with-current-buffer (or buffer (current-buffer))
;; Make sure we know the hierarchy separator for root's hierarchy
(nreverse out)))))
(defun imap-mailbox-subscribe (mailbox &optional buffer)
- "Send the SUBSCRIBE command on the mailbox to server in
-BUFFER. Returns non-nil if successful."
+ "Send the SUBSCRIBE command on the mailbox to server in BUFFER.
+Returns non-nil if successful."
(with-current-buffer (or buffer (current-buffer))
(imap-ok-p (imap-send-command-wait (concat "SUBSCRIBE \""
(imap-utf7-encode mailbox)
"\"")))))
(defun imap-mailbox-unsubscribe (mailbox &optional buffer)
- "Send the SUBSCRIBE command on the mailbox to server in
-BUFFER. Returns non-nil if successful."
+ "Send the SUBSCRIBE command on the mailbox to server in BUFFER.
+Returns non-nil if successful."
(with-current-buffer (or buffer (current-buffer))
(imap-ok-p (imap-send-command-wait (concat "UNSUBSCRIBE "
(imap-utf7-encode mailbox)
"\"")))))
(defun imap-mailbox-status (mailbox items &optional buffer)
- "Get status items ITEM in MAILBOX from server in BUFFER. ITEMS can
-be a symbol or a list of symbols, valid symbols are one of the STATUS
-data items -- ie 'messages, 'recent, 'uidnext, 'uidvalidity or
-'unseen. If ITEMS is a list of symbols, a list of values is returned,
-if ITEMS is a symbol only it's value is returned."
+ "Get status items ITEM in MAILBOX from server in BUFFER.
+ITEMS can be a symbol or a list of symbols, valid symbols are one of
+the STATUS data items -- ie 'messages, 'recent, 'uidnext, 'uidvalidity
+or 'unseen. If ITEMS is a list of symbols, a list of values is
+returned, if ITEMS is a symbol only it's value is returned."
(with-current-buffer (or buffer (current-buffer))
(when (imap-ok-p
(imap-send-command-wait (list "STATUS \""
(imap-send-command-wait (list "GETACL \""
(or mailbox imap-current-mailbox)
"\"")))
- (imap-mailbox-get-1 'acl (or mailbox imap-current-mailbox))))))
+ (imap-mailbox-get-1 'acl (or mailbox imap-current-mailbox))))))
(defun imap-mailbox-acl-set (identifier rights &optional mailbox buffer)
- "Change/set ACL for IDENTIFIER to RIGHTS in MAILBOX from server in
-BUFFER."
+ "Change/set ACL for IDENTIFIER to RIGHTS in MAILBOX from server in BUFFER."
(let ((mailbox (imap-utf7-encode mailbox)))
(with-current-buffer (or buffer (current-buffer))
(imap-ok-p
rights))))))
(defun imap-mailbox-acl-delete (identifier &optional mailbox buffer)
- "Removes any <identifier,rights> pair for IDENTIFIER in MAILBOX from
-server in BUFFER."
+ "Removes any <identifier,rights> pair for IDENTIFIER in MAILBOX from server in BUFFER."
(let ((mailbox (imap-utf7-encode mailbox)))
(with-current-buffer (or buffer (current-buffer))
(imap-ok-p
props))))
(defun imap-fetch (uids props &optional receive nouidfetch buffer)
- "Fetch properties PROPS from message set UIDS from server in
-BUFFER. UIDS can be a string, number or a list of numbers. If RECEIVE
+ "Fetch properties PROPS from message set UIDS from server in BUFFER.
+UIDS can be a string, number or a list of numbers. If RECEIVE
is non-nil return theese properties."
(with-current-buffer (or buffer (current-buffer))
(when (imap-ok-p (imap-send-command-wait
propname)))
(defun imap-message-map (func propname &optional buffer)
- "Map a function across each mailbox in `imap-message-data',
-returning a list."
+ "Map a function across each mailbox in `imap-message-data', returning a list."
(with-current-buffer (or buffer (current-buffer))
(let (result)
(mapatoms
(imap-mailbox-get-1 'search imap-current-mailbox)))))
(defun imap-message-flag-permanent-p (flag &optional mailbox buffer)
- "Return t iff FLAG can be permanently (between IMAP sessions) saved
-on articles, in MAILBOX on server in BUFFER."
+ "Return t iff FLAG can be permanently (between IMAP sessions) saved on articles, in MAILBOX on server in BUFFER."
(with-current-buffer (or buffer (current-buffer))
(or (member "\\*" (imap-mailbox-get 'permanentflags mailbox))
(member flag (imap-mailbox-get 'permanentflags mailbox)))))
(defun imap-message-copy (articles mailbox
&optional dont-create no-copyuid buffer)
"Copy ARTICLES (a string message set) to MAILBOX on server in
-BUFFER, creating mailbox if it doesn't exist. If dont-create is
-non-nil, it will not create a mailbox. On success, return a list with
+BUFFER, creating mailbox if it doesn't exist. If dont-create is
+non-nil, it will not create a mailbox. On success, return a list with
the UIDVALIDITY of the mailbox the article(s) was copied to as the
first element, rest of list contain the saved articles' UIDs."
(when articles
(imap-message-appenduid-1 (imap-utf7-encode mailbox))))
(defun imap-message-append (mailbox article &optional flags date-time buffer)
- "Append ARTICLE (a buffer) to MAILBOX on server in BUFFER. FLAGS and
-DATE-TIME is currently not used. Return a cons holding uidvalidity of
-MAILBOX and UID the newly created article got, or nil on failure."
+ "Append ARTICLE (a buffer) to MAILBOX on server in BUFFER.
+FLAGS and DATE-TIME is currently not used. Return a cons holding
+uidvalidity of MAILBOX and UID the newly created article got, or nil
+on failure."
(let ((mailbox (imap-utf7-encode mailbox)))
(with-current-buffer (or buffer (current-buffer))
(and (let ((imap-current-target-mailbox mailbox))
(imap-message-appenduid-1 mailbox)))))
(defun imap-body-lines (body)
- "Return number of lines in article by looking at the mime bodystructure
-BODY."
+ "Return number of lines in article by looking at the mime bodystructure BODY."
(if (listp body)
(if (stringp (car body))
(cond ((and (string= (car body) "TEXT")
(imap-send-command-1 cmdstr)
(setq cmdstr nil)
(if (not (eq (imap-wait-for-tag tag) 'INCOMPLETE))
- (setq command nil) ;; abort command if no cont-req
+ (setq command nil);; abort command if no cont-req
(let ((process imap-process)
(stream imap-stream))
(with-current-buffer cmd
(setq cmdstr nil)
(unwind-protect
(if (not (eq (imap-wait-for-tag tag) 'INCOMPLETE))
- (setq command nil) ;; abort command if no cont-req
+ (setq command nil);; abort command if no cont-req
(setq command (cons (funcall cmd imap-continuation)
command)))
(setq imap-continuation nil)))
(delete-process process))
(defun imap-find-next-line ()
- "Return point at end of current line, taking into account
-literals. Return nil if no complete line has arrived."
+ "Return point at end of current line, taking into account literals.
+Return nil if no complete line has arrived."
(when (re-search-forward (concat imap-server-eol "\\|{\\([0-9]+\\)}"
imap-server-eol)
nil t)
(defun imap-parse-envelope ()
(when (eq (char-after) ?\()
(imap-forward)
- (vector (prog1 (imap-parse-nstring) ;; date
+ (vector (prog1 (imap-parse-nstring);; date
(imap-forward))
- (prog1 (imap-parse-nstring) ;; subject
+ (prog1 (imap-parse-nstring);; subject
(imap-forward))
- (prog1 (imap-parse-address-list) ;; from
+ (prog1 (imap-parse-address-list);; from
(imap-forward))
- (prog1 (imap-parse-address-list) ;; sender
+ (prog1 (imap-parse-address-list);; sender
(imap-forward))
- (prog1 (imap-parse-address-list) ;; reply-to
+ (prog1 (imap-parse-address-list);; reply-to
(imap-forward))
- (prog1 (imap-parse-address-list) ;; to
+ (prog1 (imap-parse-address-list);; to
(imap-forward))
- (prog1 (imap-parse-address-list) ;; cc
+ (prog1 (imap-parse-address-list);; cc
(imap-forward))
- (prog1 (imap-parse-address-list) ;; bcc
+ (prog1 (imap-parse-address-list);; bcc
(imap-forward))
- (prog1 (imap-parse-nstring) ;; in-reply-to
+ (prog1 (imap-parse-nstring);; in-reply-to
(imap-forward))
- (prog1 (imap-parse-nstring) ;; message-id
+ (prog1 (imap-parse-nstring);; message-id
(imap-forward)))))
;; body-fld-param = "(" string SP string *(SP string SP string) ")" / nil
(defsubst imap-parse-string-list ()
- (cond ((eq (char-after) ?\() ;; body-fld-param
+ (cond ((eq (char-after) ?\();; body-fld-param
(let (strlist str)
(imap-forward)
(while (setq str (imap-parse-string))
(defsubst imap-parse-body-ext ()
(let (ext)
- (when (eq (char-after) ?\ ) ;; body-fld-dsp
+ (when (eq (char-after) ?\ );; body-fld-dsp
(imap-forward)
(let (dsp)
(if (eq (char-after) ?\()
(imap-forward))
(assert (imap-parse-nil)))
(push (nreverse dsp) ext))
- (when (eq (char-after) ?\ ) ;; body-fld-lang
+ (when (eq (char-after) ?\ );; body-fld-lang
(imap-forward)
(if (eq (char-after) ?\()
(push (imap-parse-string-list) ext)
(push (imap-parse-nstring) ext))
- (while (eq (char-after) ?\ ) ;; body-extension
+ (while (eq (char-after) ?\ );; body-extension
(imap-forward)
(setq ext (append (imap-parse-body-extension) ext)))))
ext))
(setq subbody (imap-parse-body)))
(push subbody body))
(imap-forward)
- (push (imap-parse-string) body) ;; media-subtype
- (when (eq (char-after) ?\ ) ;; body-ext-mpart:
+ (push (imap-parse-string) body);; media-subtype
+ (when (eq (char-after) ?\ );; body-ext-mpart:
(imap-forward)
- (if (eq (char-after) ?\() ;; body-fld-param
+ (if (eq (char-after) ?\();; body-fld-param
(push (imap-parse-string-list) body)
(push (and (imap-parse-nil) nil) body))
(setq body
- (append (imap-parse-body-ext) body))) ;; body-ext-...
+ (append (imap-parse-body-ext) body)));; body-ext-...
(assert (eq (char-after) ?\)))
(imap-forward)
(nreverse body))
- (push (imap-parse-string) body) ;; media-type
+ (push (imap-parse-string) body);; media-type
(imap-forward)
- (push (imap-parse-string) body) ;; media-subtype
+ (push (imap-parse-string) body);; media-subtype
(imap-forward)
;; next line for Sun SIMS bug
(and (eq (char-after) ? ) (imap-forward))
- (if (eq (char-after) ?\() ;; body-fld-param
+ (if (eq (char-after) ?\();; body-fld-param
(push (imap-parse-string-list) body)
(push (and (imap-parse-nil) nil) body))
(imap-forward)
- (push (imap-parse-nstring) body) ;; body-fld-id
+ (push (imap-parse-nstring) body);; body-fld-id
(imap-forward)
- (push (imap-parse-nstring) body) ;; body-fld-desc
+ (push (imap-parse-nstring) body);; body-fld-desc
(imap-forward)
- (push (imap-parse-string) body) ;; body-fld-enc
+ (push (imap-parse-string) body);; body-fld-enc
(imap-forward)
- (push (imap-parse-number) body) ;; body-fld-octets
+ (push (imap-parse-number) body);; body-fld-octets
;; ok, we're done parsing the required parts, what comes now is one
;; of three things:
;; body-ext-1part (then we're parsing body-type-basic)
;;
;; the problem is that the two first are in turn optionally followed
- ;; by the third. So we parse the first two here (if there are any)...
+ ;; by the third. So we parse the first two here (if there are any)...
(when (eq (char-after) ?\ )
(imap-forward)
(let (lines)
- (cond ((eq (char-after) ?\() ;; body-type-msg:
- (push (imap-parse-envelope) body) ;; envelope
+ (cond ((eq (char-after) ?\();; body-type-msg:
+ (push (imap-parse-envelope) body);; envelope
(imap-forward)
- (push (imap-parse-body) body) ;; body
+ (push (imap-parse-body) body);; body
(imap-forward)
- (push (imap-parse-number) body)) ;; body-fld-lines
- ((setq lines (imap-parse-number)) ;; body-type-text:
- (push lines body)) ;; body-fld-lines
+ (push (imap-parse-number) body));; body-fld-lines
+ ((setq lines (imap-parse-number));; body-type-text:
+ (push lines body));; body-fld-lines
(t
- (backward-char))))) ;; no match...
+ (backward-char)))));; no match...
;; ...and then parse the third one here...
- (when (eq (char-after) ?\ ) ;; body-ext-1part:
+ (when (eq (char-after) ?\ );; body-ext-1part:
(imap-forward)
- (push (imap-parse-nstring) body) ;; body-fld-md5
+ (push (imap-parse-nstring) body);; body-fld-md5
(setq body (append (imap-parse-body-ext) body)));; body-ext-1part..
(assert (eq (char-after) ?\)))
(imap-forward)
(nreverse body)))))
-(when imap-debug ; (untrace-all)
+(when imap-debug ; (untrace-all)
(require 'trace)
(buffer-disable-undo (get-buffer-create imap-debug))
(mapcar (lambda (f) (trace-function-background f imap-debug))
- '(
-imap-read-passwd
-imap-utf7-encode
-imap-utf7-decode
-imap-error-text
-imap-kerberos4s-p
-imap-kerberos4-open
-imap-ssl-p
-imap-ssl-open-2
-imap-ssl-open-1
-imap-ssl-open
-imap-network-p
-imap-network-open
-imap-interactive-login
-imap-kerberos4a-p
-imap-kerberos4-auth
-imap-cram-md5-p
-imap-cram-md5-auth
-imap-login-p
-imap-login-auth
-imap-anonymous-p
-imap-anonymous-auth
-imap-open-1
-imap-open
-imap-opened
-imap-authenticate
-imap-close
-imap-capability
-imap-namespace
-imap-send-command-wait
-imap-mailbox-put
-imap-mailbox-get
-imap-mailbox-map-1
-imap-mailbox-map
-imap-current-mailbox
-imap-current-mailbox-p-1
-imap-current-mailbox-p
-imap-mailbox-select-1
-imap-mailbox-select
-imap-mailbox-examine
-imap-mailbox-unselect
-imap-mailbox-expunge
-imap-mailbox-close
-imap-mailbox-create-1
-imap-mailbox-create
-imap-mailbox-delete
-imap-mailbox-rename
-imap-mailbox-lsub
-imap-mailbox-list
-imap-mailbox-subscribe
-imap-mailbox-unsubscribe
-imap-mailbox-status
-imap-mailbox-acl-get
-imap-mailbox-acl-set
-imap-mailbox-acl-delete
-imap-current-message
-imap-list-to-message-set
-imap-fetch-asynch
-imap-fetch
-imap-message-put
-imap-message-get
-imap-message-map
-imap-search
-imap-message-flag-permanent-p
-imap-message-flags-set
-imap-message-flags-del
-imap-message-flags-add
-imap-message-copyuid-1
-imap-message-copyuid
-imap-message-copy
-imap-message-appenduid-1
-imap-message-appenduid
-imap-message-append
-imap-body-lines
-imap-envelope-from
-imap-send-command-1
-imap-send-command
-imap-wait-for-tag
-imap-sentinel
-imap-find-next-line
-imap-arrival-filter
-imap-parse-greeting
-imap-parse-response
-imap-parse-resp-text
-imap-parse-resp-text-code
-imap-parse-data-list
-imap-parse-fetch
-imap-parse-status
-imap-parse-acl
-imap-parse-flag-list
-imap-parse-envelope
-imap-parse-body-extension
-imap-parse-body
- )))
+ '(
+ imap-read-passwd
+ imap-utf7-encode
+ imap-utf7-decode
+ imap-error-text
+ imap-kerberos4s-p
+ imap-kerberos4-open
+ imap-ssl-p
+ imap-ssl-open-2
+ imap-ssl-open-1
+ imap-ssl-open
+ imap-network-p
+ imap-network-open
+ imap-interactive-login
+ imap-kerberos4a-p
+ imap-kerberos4-auth
+ imap-cram-md5-p
+ imap-cram-md5-auth
+ imap-login-p
+ imap-login-auth
+ imap-anonymous-p
+ imap-anonymous-auth
+ imap-open-1
+ imap-open
+ imap-opened
+ imap-authenticate
+ imap-close
+ imap-capability
+ imap-namespace
+ imap-send-command-wait
+ imap-mailbox-put
+ imap-mailbox-get
+ imap-mailbox-map-1
+ imap-mailbox-map
+ imap-current-mailbox
+ imap-current-mailbox-p-1
+ imap-current-mailbox-p
+ imap-mailbox-select-1
+ imap-mailbox-select
+ imap-mailbox-examine
+ imap-mailbox-unselect
+ imap-mailbox-expunge
+ imap-mailbox-close
+ imap-mailbox-create-1
+ imap-mailbox-create
+ imap-mailbox-delete
+ imap-mailbox-rename
+ imap-mailbox-lsub
+ imap-mailbox-list
+ imap-mailbox-subscribe
+ imap-mailbox-unsubscribe
+ imap-mailbox-status
+ imap-mailbox-acl-get
+ imap-mailbox-acl-set
+ imap-mailbox-acl-delete
+ imap-current-message
+ imap-list-to-message-set
+ imap-fetch-asynch
+ imap-fetch
+ imap-message-put
+ imap-message-get
+ imap-message-map
+ imap-search
+ imap-message-flag-permanent-p
+ imap-message-flags-set
+ imap-message-flags-del
+ imap-message-flags-add
+ imap-message-copyuid-1
+ imap-message-copyuid
+ imap-message-copy
+ imap-message-appenduid-1
+ imap-message-appenduid
+ imap-message-append
+ imap-body-lines
+ imap-envelope-from
+ imap-send-command-1
+ imap-send-command
+ imap-wait-for-tag
+ imap-sentinel
+ imap-find-next-line
+ imap-arrival-filter
+ imap-parse-greeting
+ imap-parse-response
+ imap-parse-resp-text
+ imap-parse-resp-text-code
+ imap-parse-data-list
+ imap-parse-fetch
+ imap-parse-status
+ imap-parse-acl
+ imap-parse-flag-list
+ imap-parse-envelope
+ imap-parse-body-extension
+ imap-parse-body
+ )))
(provide 'imap)
babel-translations babel-history
display-time-mail-function))
(maybe-fbind '(color-instance-rgb-components temp-directory
- glyph-width annotation-glyph window-pixel-width glyph-height
- window-pixel-height map-extents
- make-color-instance color-instance-name specifier-instance
- device-type device-class get-popup-menu-response event-object
- x-defined-colors read-color add-submenu set-font-family
- font-create-object set-font-size frame-device find-face
- set-extent-property make-extent characterp display-error
- set-face-doc-string frame-property face-doc-string
- button-press-event-p next-command-event
- widget-make-intangible glyphp make-glyph set-glyph-image
- set-glyph-property event-glyph glyph-property event-point
- device-on-window-system-p make-gui-button Info-goto-node
- pp-to-string color-name
- gnus-mule-get-coding-system decode-coding-string
- mail-aliases-setup
- mm-copy-tree url-view-url w3-prepare-buffer
- mule-write-region-no-coding-system char-int
- annotationp delete-annotation make-image-specifier
- make-annotation events-to-keys
- w3-do-setup w3-region
- w3-coding-system-for-mime-charset
- rmail-summary-exists rmail-select-summary rmail-update-summary
- url-generic-parse-url valid-image-instantiator-format-p
- babel-fetch babel-wash babel-as-string sc-cite-regexp
- pop3-get-message-count)))
+ glyph-width annotation-glyph window-pixel-width glyph-height
+ window-pixel-height map-extents
+ make-color-instance color-instance-name specifier-instance
+ device-type device-class get-popup-menu-response event-object
+ x-defined-colors read-color add-submenu set-font-family
+ font-create-object set-font-size frame-device find-face
+ set-extent-property make-extent characterp display-error
+ set-face-doc-string frame-property face-doc-string
+ button-press-event-p next-command-event
+ widget-make-intangible glyphp make-glyph set-glyph-image
+ set-glyph-property event-glyph glyph-property event-point
+ device-on-window-system-p make-gui-button Info-goto-node
+ pp-to-string color-name
+ gnus-mule-get-coding-system decode-coding-string
+ mail-aliases-setup
+ mm-copy-tree url-view-url w3-prepare-buffer
+ mule-write-region-no-coding-system char-int
+ annotationp delete-annotation make-image-specifier
+ make-annotation events-to-keys
+ w3-do-setup w3-region
+ w3-coding-system-for-mime-charset
+ rmail-summary-exists rmail-select-summary rmail-update-summary
+ url-generic-parse-url valid-image-instantiator-format-p
+ babel-fetch babel-wash babel-as-string sc-cite-regexp
+ pop3-get-message-count)))
(setq load-path (cons "." load-path))
(require 'custom)
(eval-and-compile
(defun mail-source-strip-keyword (keyword)
- "Strip the leading colon off the KEYWORD."
- (intern (substring (symbol-name keyword) 1))))
+ "Strip the leading colon off the KEYWORD."
+ (intern (substring (symbol-name keyword) 1))))
(eval-and-compile
(defun mail-source-bind-1 (type)
(mail-source-run-script
prescript
(format-spec-make ?p password ?t mail-source-crash-box
- ?s server ?P port ?u user)
+ ?s server ?P port ?u user)
prescript-delay)
(let ((from (format "%s:%s:%s" server user port))
(mail-source-string (format "pop:%s@%s" user server))
(viewer . mailcap-save-binary-file)
(non-viewer . t)
(test . (or (featurep 'nas-sound)
- (featurep 'native-sound)))
+ (featurep 'native-sound)))
(type . "audio/*"))
(".*"
(viewer . "showaudio")
(viewer . tar-mode)
(type . "archive/tar")
(test . (fboundp 'tar-mode)))))
- "The mailcap structure is an assoc list of assoc lists.
+ "The mailcap structure is an assoc list of assoc lists.
1st assoc list is keyed on the major content-type
2nd assoc list is keyed on the minor content-type (which can be a regexp)
;;;
(defun mailcap-generate-unique-filename (&optional fmt)
- "Generate a unique filename in mailcap-temporary-directory"
+ "Generate a unique filename in mailcap-temporary-directory."
(if (not fmt)
(let ((base (format "mailcap-tmp.%d" (user-real-uid)))
(fname "")
(kill-buffer (current-buffer))))
(defun mailcap-maybe-eval ()
- "Maybe evaluate a buffer of emacs lisp code"
+ "Maybe evaluate a buffer of emacs lisp code."
(if (yes-or-no-p "This is emacs-lisp code, evaluate it? ")
(eval-buffer (current-buffer))
(emacs-lisp-mode)))
fname)
(while fnames
(setq fname (car fnames))
- (if (and (file-exists-p fname) (file-readable-p fname)
- (file-regular-p fname))
+ (if (and (file-exists-p fname) (file-readable-p fname)
+ (file-regular-p fname))
(mailcap-parse-mailcap (car fnames)))
(setq fnames (cdr fnames))))
(setq mailcap-parsed-p t)))
((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
+ ((and (not (assq 'test info)) ; No test info, replace completely
(not (assq 'test cur-minor)))
(setcdr cur-minor info))
(t
:group 'message-headers)
(defcustom message-syntax-checks nil
- ; Guess this one shouldn't be easy to customize...
+ ;; Guess this one shouldn't be easy to customize...
"*Controls what syntax checks should not be performed on outgoing posts.
To disable checking of long signatures, for instance, add
`(signature . disabled)' to this list.
(defcustom message-make-forward-subject-function
'message-forward-subject-author-subject
- "*A list of functions that are called to generate a subject header for forwarded messages.
+ "*A list of functions that are called to generate a subject header for forwarded messages.
The subject generated by the previous function is passed into each
successive function.
newsgroup)), in brackets followed by the subject
* message-forward-subject-fwd (Subject of article with 'Fwd:' prepended
to it."
- :group 'message-forwarding
- :type '(radio (function-item message-forward-subject-author-subject)
- (function-item message-forward-subject-fwd)))
+ :group 'message-forwarding
+ :type '(radio (function-item message-forward-subject-author-subject)
+ (function-item message-forward-subject-fwd)))
(defcustom message-forward-as-mime t
"*If non-nil, forward messages as an inline/rfc822 MIME section. Otherwise, directly inline the old message in the forwarded message."
:type 'message-header-lines)
(defcustom message-default-news-headers ""
- "*A string of header lines to be inserted in outgoing news
-articles."
+ "*A string of header lines to be inserted in outgoing news articles."
:group 'message-headers
:group 'message-news
:type 'message-header-lines)
"\\([^\0-\b\n-\r\^?].*\\)? "
;; The time the message was sent.
- "\\([^\0-\r \^?]+\\) +" ; day of the week
- "\\([^\0-\r \^?]+\\) +" ; month
- "\\([0-3]?[0-9]\\) +" ; day of month
- "\\([0-2][0-9]:[0-5][0-9]\\(:[0-6][0-9]\\)?\\) *" ; time of day
+ "\\([^\0-\r \^?]+\\) +" ; day of the week
+ "\\([^\0-\r \^?]+\\) +" ; month
+ "\\([0-3]?[0-9]\\) +" ; day of month
+ "\\([0-2][0-9]:[0-5][0-9]\\(:[0-6][0-9]\\)?\\) *" ; time of day
;; Perhaps a time zone, specified by an abbreviation, or by a
;; numeric offset.
(unless (string-match "^\\([^:]+\\):[ \t]*[^ \t]" (car headers))
(error "Invalid header `%s'" (car headers)))
(setq hclean (match-string 1 (car headers)))
- (save-restriction
- (message-narrow-to-headers)
- (unless (re-search-forward (concat "^" (regexp-quote hclean) ":") nil t)
- (insert (car headers) ?\n))))
+ (save-restriction
+ (message-narrow-to-headers)
+ (unless (re-search-forward (concat "^" (regexp-quote hclean) ":") nil t)
+ (insert (car headers) ?\n))))
(setq headers (cdr headers))))
;; We build the table, if necessary.
(when (or (not message-caesar-translation-table)
(/= (aref message-caesar-translation-table ?a) (+ ?a n)))
- (setq message-caesar-translation-table
- (message-make-caesar-translation-table n)))
+ (setq message-caesar-translation-table
+ (message-make-caesar-translation-table n)))
;; Then we translate the region. Do it this way to retain
;; text properties.
(while (< b e)
(narrow-to-region (point) (point-max)))
(let ((body (buffer-substring (point-min) (point-max))))
(unless (equal 0 (call-process-region
- (point-min) (point-max) program t t))
- (insert body)
- (message "%s failed" program))))))
+ (point-min) (point-max) program t t))
+ (insert body)
+ (message "%s failed" program))))))
(defun message-rename-buffer (&optional enter-string)
"Rename the *message* buffer to \"*message* RECIPIENT\".
(backward-char 1))
(run-hooks 'message-send-news-hook)
(gnus-open-server method)
- (setq result (let ((mail-header-separator ""))
- (gnus-request-post method))))
+ (setq result (let ((mail-header-separator ""))
+ (gnus-request-post method))))
(kill-buffer tembuf))
(set-buffer messbuf)
(if result
"Make an Organization header."
(let* ((organization
(when message-user-organization
- (if (message-functionp message-user-organization)
- (funcall message-user-organization)
- message-user-organization))))
+ (if (message-functionp message-user-organization)
+ (funcall message-user-organization)
+ message-user-organization))))
(save-excursion
(message-set-work-buffer)
(cond ((stringp organization)
(when (yes-or-no-p "Do you really want to cancel this article? ")
(let (from newsgroups message-id distribution buf sender)
(save-excursion
- ;; Get header info. from original article.
+ ;; Get header info from original article.
(save-restriction
(message-narrow-to-head)
(setq from (message-fetch-field "from")
;; message.
(message-goto-body)
(if message-forward-as-mime
- (insert "\n\n<#part type=message/rfc822 disposition=inline>\n")
+ (insert "\n\n<#part type=message/rfc822 disposition=inline>\n")
(insert "\n\n"))
(let ((b (point))
e)
;; Deleted the autoload cookie because this crashes in loaddefs.el.
(defvar message-signature-file mail-signature-file
- "*File containing the text inserted at end of message. buffer.")
+ "*File containing the text inserted at end of the message buffer.")
(defvar message-default-headers mail-default-headers
"*A string containing header lines to be inserted in outgoing messages.
(delete-region (point) (point-max))
(point))))
((memq encoding '(7bit 8bit binary))
+ ;; Do nothing.
)
((null encoding)
+ ;; Do nothing.
)
((memq encoding '(x-uuencode x-uue))
(funcall mm-uu-decode-function (point-min) (point-max)))
"Decode the current article that has been encoded with ENCODING.
The characters in CHARSET should then be decoded."
(if (stringp charset)
- (setq charset (intern (downcase charset))))
+ (setq charset (intern (downcase charset))))
(if (or (not charset)
(eq 'gnus-all mail-parse-ignored-charsets)
(memq 'gnus-all mail-parse-ignored-charsets)
(defun mm-decode-string (string charset)
"Decode STRING with CHARSET."
(if (stringp charset)
- (setq charset (intern (downcase charset))))
+ (setq charset (intern (downcase charset))))
(if (or (not charset)
(eq 'gnus-all mail-parse-ignored-charsets)
(memq 'gnus-all mail-parse-ignored-charsets)
(setq charset mail-parse-charset))
(or
(when (featurep 'mule)
- (let ((mule-charset (mm-charset-to-coding-system charset)))
- (if (and (not mule-charset)
- (listp mail-parse-ignored-charsets)
- (memq 'gnus-unknown mail-parse-ignored-charsets))
- (setq mule-charset
- (mm-charset-to-coding-system mail-parse-charset)))
+ (let ((mule-charset (mm-charset-to-coding-system charset)))
+ (if (and (not mule-charset)
+ (listp mail-parse-ignored-charsets)
+ (memq 'gnus-unknown mail-parse-ignored-charsets))
+ (setq mule-charset
+ (mm-charset-to-coding-system mail-parse-charset)))
(when (and charset mule-charset
(mm-multibyte-p)
(or (not (eq mule-charset 'ascii))
(require 'mm-bodies)
(defgroup mime-display ()
- "Display of MIME in mail and news articles."
+ "Display of MIME in mail and news articles."
:link '(custom-manual "(emacs-mime)Customization")
:group 'mail
:group 'news)
(defun mm-dissect-multipart (ctl)
(goto-char (point-min))
(let* ((boundary (concat "\n--" (mail-content-type-get ctl 'boundary)))
- (close-delimiter (concat (regexp-quote boundary) "--[ \t]*$"))
- start parts
- (end (save-excursion
- (goto-char (point-max))
- (if (re-search-backward close-delimiter nil t)
- (match-beginning 0)
- (point-max)))))
+ (close-delimiter (concat (regexp-quote boundary) "--[ \t]*$"))
+ start parts
+ (end (save-excursion
+ (goto-char (point-max))
+ (if (re-search-backward close-delimiter nil t)
+ (match-beginning 0)
+ (point-max)))))
(while (search-forward boundary end t)
(goto-char (match-beginning 0))
(when start
(while (setq handle (pop handles))
(cond
((stringp handle)
+ ;; Do nothing.
)
((and (listp handle)
(stringp (car handle)))
(while (setq handle (pop handles))
(cond
((stringp handle)
+ ;; Do nothing.
)
((and (listp handle)
(stringp (car handle)))
(message "Error while decoding: %s" error)
nil)))
((memq encoding '(7bit 8bit binary))
+ ;; Do nothing.
)
((null encoding)
+ ;; Do nothing.
)
((functionp encoding)
(ignore-errors (funcall encoding (point-min) (point-max))))
(let ((nnheader-file-name-translation-alist
'((?/ . ?,) (? . ?_) (?* . ?_) (?$ . ?_))))
(nnheader-translate-file-chars (match-string 1))))))
- (forward-line) ;; in case of failure
+ (forward-line);; in case of failure
(setq start-char-1 (point))
(setq end-line (symbol-value
(intern (concat "mm-uu-" (symbol-name type)
(if (> start-char text-start)
(push
(mm-make-handle (mm-uu-copy-to-buffer text-start start-char)
- text-plain-type)
+ text-plain-type)
result))
(push
(cond
((eq type 'postscript)
(mm-make-handle (mm-uu-copy-to-buffer start-char end-char)
- '("application/postscript")))
+ '("application/postscript")))
((eq type 'forward)
(mm-make-handle (mm-uu-copy-to-buffer start-char-1 end-char-1)
'("message/rfc822" (charset . gnus-decoded))))
((eq type 'uu)
(mm-make-handle (mm-uu-copy-to-buffer start-char end-char)
- (list (or (and file-name
- (string-match "\\.[^\\.]+$" file-name)
- (mailcap-extension-to-mime
- (match-string 0 file-name)))
- "application/octet-stream"))
- 'x-uuencode nil
- (if (and file-name (not (equal file-name "")))
- (list mm-dissect-disposition
- (cons 'filename file-name)))))
+ (list (or (and file-name
+ (string-match "\\.[^\\.]+$" file-name)
+ (mailcap-extension-to-mime
+ (match-string 0 file-name)))
+ "application/octet-stream"))
+ 'x-uuencode nil
+ (if (and file-name (not (equal file-name "")))
+ (list mm-dissect-disposition
+ (cons 'filename file-name)))))
((eq type 'binhex)
(mm-make-handle (mm-uu-copy-to-buffer start-char end-char)
- (list (or (and file-name
- (string-match "\\.[^\\.]+$" file-name)
- (mailcap-extension-to-mime
- (match-string 0 file-name)))
- "application/octet-stream"))
- 'x-binhex nil
- (if (and file-name (not (equal file-name "")))
- (list mm-dissect-disposition
- (cons 'filename file-name)))))
+ (list (or (and file-name
+ (string-match "\\.[^\\.]+$" file-name)
+ (mailcap-extension-to-mime
+ (match-string 0 file-name)))
+ "application/octet-stream"))
+ 'x-binhex nil
+ (if (and file-name (not (equal file-name "")))
+ (list mm-dissect-disposition
+ (cons 'filename file-name)))))
((eq type 'shar)
(mm-make-handle (mm-uu-copy-to-buffer start-char end-char)
- '("application/x-shar"))))
+ '("application/x-shar"))))
result)
(setq text-start end-char))))
(when result
(if (> (point-max) (1+ text-start))
(push
(mm-make-handle (mm-uu-copy-to-buffer text-start (point-max))
- text-plain-type)
+ text-plain-type)
result))
(setq result (cons "multipart/mixed" (nreverse result))))
result)))
(mm-enable-multibyte)
(let (handles)
(let (gnus-article-mime-handles)
- ;; Double decode problem may happen. See mm-inline-message.
+ ;; Double decode problem may happen. See mm-inline-message.
(run-hooks 'gnus-article-decode-hook)
(gnus-article-prepare-display)
(setq handles gnus-article-mime-handles))
(defun mml-insert-multipart (&optional type)
(interactive (list (completing-read "Multipart type (default mixed): "
- '(("mixed") ("alternative") ("digest") ("parallel")
- ("signed") ("encrypted"))
- nil nil "mixed")))
+ '(("mixed") ("alternative") ("digest") ("parallel")
+ ("signed") ("encrypted"))
+ nil nil "mixed")))
(or type
(setq type "mixed"))
(mml-insert-empty-tag "multipart" 'type type)
(forward-line -1))
(defun mml-preview (&optional raw)
- "Display current buffer with Gnus, in a new buffer.
+ "Display current buffer with Gnus, in a new buffer.
If RAW, don't highlight the article."
- (interactive "P")
- (let ((buf (current-buffer)))
- (switch-to-buffer (get-buffer-create
- (concat (if raw "*Raw MIME preview of "
- "*MIME preview of ") (buffer-name))))
- (erase-buffer)
- (insert-buffer buf)
- (if (re-search-forward
- (concat "^" (regexp-quote mail-header-separator) "\n") nil t)
- (replace-match "\n"))
- (mml-to-mime)
- (unless raw
- (run-hooks 'gnus-article-decode-hook)
- (let ((gnus-newsgroup-name "dummy"))
- (gnus-article-prepare-display)))
- (fundamental-mode)
- (setq buffer-read-only t)
- (goto-char (point-min))))
+ (interactive "P")
+ (let ((buf (current-buffer)))
+ (switch-to-buffer (get-buffer-create
+ (concat (if raw "*Raw MIME preview of "
+ "*MIME preview of ") (buffer-name))))
+ (erase-buffer)
+ (insert-buffer buf)
+ (if (re-search-forward
+ (concat "^" (regexp-quote mail-header-separator) "\n") nil t)
+ (replace-match "\n"))
+ (mml-to-mime)
+ (unless raw
+ (run-hooks 'gnus-article-decode-hook)
+ (let ((gnus-newsgroup-name "dummy"))
+ (gnus-article-prepare-display)))
+ (fundamental-mode)
+ (setq buffer-read-only t)
+ (goto-char (point-min))))
(defun mml-validate ()
"Validate the current MML document."
(nnheader-report 'nnbabyl "nnbabyl: LIST NEWSGROUPS is not implemented."))
(deffoo nnbabyl-request-expire-articles
- (articles newsgroup &optional server force)
+ (articles newsgroup &optional server force)
(nnbabyl-possibly-change-newsgroup newsgroup server)
(let* ((is-old t)
rest)
(nconc rest articles))))
(deffoo nnbabyl-request-move-article
- (article group server accept-form &optional last)
+ (article group server accept-form &optional last)
(let ((buf (get-buffer-create " *nnbabyl move*"))
result)
(and
(widen)
(narrow-to-region
(save-excursion
- (unless (re-search-backward (concat "^" nnbabyl-mail-delimiter) nil t)
- (goto-char (point-min))
- (end-of-line))
+ (unless (re-search-backward (concat "^" nnbabyl-mail-delimiter) nil t)
+ (goto-char (point-min))
+ (end-of-line))
(if leave-delim (progn (forward-line 1) (point))
(match-beginning 0)))
(progn
(nnbabyl-create-mbox)
(unless (and nnbabyl-mbox-buffer
- (buffer-name nnbabyl-mbox-buffer)
- (save-excursion
- (set-buffer nnbabyl-mbox-buffer)
- (= (buffer-size) (nnheader-file-size nnbabyl-mbox-file))))
+ (buffer-name nnbabyl-mbox-buffer)
+ (save-excursion
+ (set-buffer nnbabyl-mbox-buffer)
+ (= (buffer-size) (nnheader-file-size nnbabyl-mbox-file))))
;; This buffer has changed since we read it last. Possibly.
(save-excursion
(let ((delim (concat "^" nnbabyl-mail-delimiter))
"*The program used to put a message in an NNDB group.")
(defvoo nndb-server-side-expiry nil
- "If t, expiry calculation will occur on the server side")
+ "If t, expiry calculation will occur on the server side.")
(defvoo nndb-set-expire-date-on-mark nil
"If t, the expiry date for a given article will be set to the time
(nntp-send-command nil "X-TOUCH" article))
(deffoo nndb-request-update-mark
- (group article mark)
+ (group article mark)
"Sets the expiry date for ARTICLE in GROUP to now, if the mark is 'E'"
(if (and nndb-set-expire-date-on-mark (string-equal mark "E"))
(nndb-touch-article group article))
(list art)))
(deffoo nndb-request-replace-article (article group buffer)
- "ARTICLE is the number of the article in GROUP to be replaced
-with the contents of the BUFFER."
+ "ARTICLE is the number of the article in GROUP to be replaced with the contents of the BUFFER."
(set-buffer buffer)
(when (nntp-send-command "^[23].*\r?\n" "X-REPLACE" (int-to-string article))
(nnheader-insert "")
(defun nndoc-transform-lanl-gov-announce (article)
(goto-char (point-max))
(when (re-search-backward "^\\\\\\\\ +(\\([^ ]*\\) , *\\([^ ]*\\))" nil t)
- (replace-match "\n\nGet it at \\1 (\\2)" t nil))
- ;; (when (re-search-backward "^\\\\\\\\$" nil t)
- ;; (replace-match "" t t))
- )
+ (replace-match "\n\nGet it at \\1 (\\2)" t nil)))
(defun nndoc-generate-lanl-gov-head (article)
(let ((entry (cdr (assq article nndoc-dissection-alist)))
(when (re-search-forward "^Title: \\([^\f]*\\)\nAuthors?: \\(.*\\)"
nil t)
(setq subject (concat (match-string 1) subject))
- (setq from (concat (match-string 2) " <" e-mail ">"))))
- ))
+ (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")
(nndraft-possibly-change-group group)
(let ((gnus-verbose-backends nil)
(buf (current-buffer))
- article file)
+ article file)
(with-temp-buffer
(insert-buffer-substring buf)
(setq article (nndraft-request-accept-article
(and large
(zerop (% count 20))
(nnheader-message 5 "nneething: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (/ (* count 100) number))))
(when large
(nnheader-message 5 "nneething: Receiving headers...done"))
(concat "Lines: " (int-to-string
(count-lines (point-min) (point-max)))
"\n"))
- "")
- )))
+ ""))))
(defun nneething-from-line (uid &optional file)
"Return a From header based of UID."
"The name of the nnfolder directory.")
(defvoo nnfolder-active-file
- (nnheader-concat nnfolder-directory "active")
+ (nnheader-concat nnfolder-directory "active")
"The name of the active file.")
;; I renamed this variable to something more in keeping with the general GNU
;; style. -SLB
(defvoo nnfolder-ignore-active-file nil
- "If non-nil, causes nnfolder to do some extra work in order to determine
-the true active ranges of an mbox file. Note that the active file is still
-saved, but it's values are not used. This costs some extra time when
-scanning an mbox when opening it.")
+ "If non-nil, the active file is ignores.
+This causes nnfolder to do some extra work in order to determine the
+true active ranges of an mbox file. Note that the active file is
+still saved, but it's values are not used. This costs some extra time
+when scanning an mbox when opening it.")
(defvoo nnfolder-distrust-mbox nil
- "If non-nil, causes nnfolder to not trust the user with respect to
-inserting unaccounted for mail in the middle of an mbox file. This can greatly
-slow down scans, which now must scan the entire file for unmarked messages.
-When nil, scans occur forward from the last marked message, a huge
-time saver for large mailboxes.")
+ "If non-nil, the folder will be distrusted.
+This means that nnfolder will not trust the user with respect to
+inserting unaccounted for mail in the middle of an mbox file. This
+can greatly slow down scans, which now must scan the entire file for
+unmarked messages. When nil, scans occur forward from the last marked
+message, a huge time saver for large mailboxes.")
(defvoo nnfolder-newsgroups-file
- (concat (file-name-as-directory nnfolder-directory) "newsgroups")
+ (concat (file-name-as-directory nnfolder-directory) "newsgroups")
"Mail newsgroups description file.")
(defvoo nnfolder-get-new-mail t
numbers))))
(deffoo nnfolder-request-expire-articles
- (articles newsgroup &optional server force)
+ (articles newsgroup &optional server force)
(nnfolder-possibly-change-group newsgroup server)
(let* ((is-old t)
;; The articles we have deleted so far.
nil t))
(forward-sexp)
(when (setq is-old
- (nnmail-expired-article-p
- newsgroup
- (buffer-substring
- (point) (progn (end-of-line) (point)))
- force nnfolder-inhibit-expiry))
- (nnheader-message 5 "Deleting article %d..."
+ (nnmail-expired-article-p
+ newsgroup
+ (buffer-substring
+ (point) (progn (end-of-line) (point)))
+ force nnfolder-inhibit-expiry))
+ (nnheader-message 5 "Deleting article %d..."
(car maybe-expirable) newsgroup)
(nnfolder-delete-mail)
;; Must remember which articles were actually deleted
\(setq nnheader-file-name-translation-alist '((?: . ?_)))")
(eval-and-compile
- (autoload 'nnmail-message-id "nnmail")
- (autoload 'mail-position-on-field "sendmail")
- (autoload 'message-remove-header "message")
- (autoload 'cancel-function-timers "timers")
- (autoload 'gnus-point-at-eol "gnus-util")
- (autoload 'gnus-delete-line "gnus-util")
- (autoload 'gnus-buffer-live-p "gnus-util"))
+ (autoload 'nnmail-message-id "nnmail")
+ (autoload 'mail-position-on-field "sendmail")
+ (autoload 'message-remove-header "message")
+ (autoload 'cancel-function-timers "timers")
+ (autoload 'gnus-point-at-eol "gnus-util")
+ (autoload 'gnus-delete-line "gnus-util")
+ (autoload 'gnus-buffer-live-p "gnus-util"))
;;; Header access macros.
"Get the most recent report from BACKEND."
(condition-case ()
(nnheader-message 5 "%s" (symbol-value (intern (format "%s-status-string"
- backend))))
+ backend))))
(error (nnheader-message 5 ""))))
(defun nnheader-insert (format &rest args)
second is a regexp that nnimap will try to match on the header to find
a fit.
-The first element can also be a list. In that case, the first element
+The first element can also be a list. In that case, the first element
is the server the second element is the group on that server in which
the matching article will be stored.
Change this if
-1) you want to connect with SSL. The SSL integration with IMAP is
+1) you want to connect with SSL. The SSL integration with IMAP is
brain-dead so you'll have to tell it specifically.
2) your server is more capable than your environment -- i.e. your
Possible choices: kerberos4, cram-md5, login, anonymous.")
(defvoo nnimap-directory (nnheader-concat gnus-directory "overview/")
- "Directory to keep NOV cache files for nnimap groups. See also
-`nnimap-nov-file-name'.")
+ "Directory to keep NOV cache files for nnimap groups.
+See also `nnimap-nov-file-name'.")
(defvoo nnimap-nov-file-name "nnimap."
- "NOV cache base filename. The group name and
-`nnimap-nov-file-name-suffix' will be appended. A typical complete
-file name would be ~/News/overview/nnimap.pdc.INBOX.ding.nov, or
+ "NOV cache base filename.
+The group name and `nnimap-nov-file-name-suffix' will be appended. A
+typical complete file name would be
+~/News/overview/nnimap.pdc.INBOX.ding.nov, or
~/News/overview/nnimap/pdc/INBOX/ding/nov if
`nnmail-use-long-file-names' is nil")
"Suffix for NOV cache base filename.")
(defvoo nnimap-nov-is-evil nil
- "If non-nil, nnimap will never generate or use a local nov database
-for this backend. Using nov databases will speed up header fetching
-considerably. Unlike other backends, you do not need to take special
-care if you flip this variable.")
+ "If non-nil, nnimap will never generate or use a local nov database for this backend.
+Using nov databases will speed up header fetching considerably.
+Unlike other backends, you do not need to take special care if you
+flip this variable.")
(defvoo nnimap-expunge-on-close 'always ; 'ask, 'never
- "When a IMAP group with articles marked for deletion is closed, this
+ "Whether to expunge a group when it is closed.
+When a IMAP group with articles marked for deletion is closed, this
variable determine if nnimap should actually remove the articles or
not.
by using `G x' (gnus-group-nnimap-expunge) from the Group buffer.")
(defvoo nnimap-list-pattern "*"
- "A string LIMIT or list of strings with mailbox wildcards used to
-limit available groups. Se below for available wildcards.
+ "A string LIMIT or list of strings with mailbox wildcards used to limit available groups.
+See below for available wildcards.
The LIMIT string can be a cons cell (REFERENCE . LIMIT), where
-REFERENCE will be passed as the first parameter to LIST/LSUB. The
+REFERENCE will be passed as the first parameter to LIST/LSUB. The
semantics of this are server specific, on the University of Washington
server you can specify a directory.
everything in the current hierarchy.")
(defvoo nnimap-news-groups nil
- "IMAP support a news-like mode, also known as bulletin board mode,
-where replies is sent via IMAP instead of SMTP.
+ "IMAP support a news-like mode, also known as bulletin board mode, where replies is sent via IMAP instead of SMTP.
This variable should contain a regexp matching groups where you wish
replies to be stored to the mailbox directly.
This will match all groups not beginning with \"INBOX\".
Note that there is nothing technically different between mail-like and
-news-like mailboxes. If you wish to have a group with todo items or
+news-like mailboxes. If you wish to have a group with todo items or
similar which you wouldn't want to set up a mailing list for, you can
use this to make replies go directly to the group.")
(defvoo nnimap-server-address nil
- "Obsolete. Use `nnimap-address'.")
+ "Obsolete. Use `nnimap-address'.")
(defcustom nnimap-authinfo-file "~/.authinfo"
"Authorization information for IMAP servers. In .netrc format."
(string :format "Password: %v")))))))
(defcustom nnimap-prune-cache t
- "If non-nil, nnimap check wheter articles still exist on server
-before using data stored in NOV cache."
+ "If non-nil, nnimap check whether articles still exist on server before using data stored in NOV cache."
:type 'boolean)
(defvar nnimap-request-list-method 'imap-mailbox-list
;; Internal variables:
-(defvar nnimap-debug nil) ;; "*nnimap-debug*")
+(defvar nnimap-debug nil);; "*nnimap-debug*")
(defvar nnimap-current-move-server nil)
(defvar nnimap-current-move-group nil)
(defvar nnimap-current-move-article nil)
\f
;; Internal variables.
-(defvar nnimap-server-buffer-alist nil) ;; Map server name to buffers.
-(defvar nnimap-current-server nil) ;; Current server
-(defvar nnimap-server-buffer nil) ;; Current servers' buffer
+(defvar nnimap-server-buffer-alist nil);; Map server name to buffers.
+(defvar nnimap-current-server nil);; Current server
+(defvar nnimap-server-buffer nil);; Current servers' buffer
(nnoo-define-basics nnimap)
(concat (substring string 0 (match-beginning 0))
to
(nnimap-replace-in-string (substring string (match-end 0))
- regexp to))
+ regexp to))
string))
(defsubst nnimap-get-server-buffer (server)
(old-uidvalidity (gnus-group-get-parameter gnusgroup 'uidvalidity)))
(if old-uidvalidity
(if (not (equal old-uidvalidity new-uidvalidity))
- nil ;; uidvalidity clash
+ nil;; uidvalidity clash
(gnus-group-set-parameter gnusgroup 'uidvalidity new-uidvalidity)
t)
(gnus-group-add-parameter gnusgroup (cons 'uidvalidity new-uidvalidity))
(zerop (imap-mailbox-get 'exists group))
(yes-or-no-p
(format
- "nnimap: Group %s is not uidvalid. Continue? " group)))
+ "nnimap: Group %s is not uidvalid. Continue? " group)))
imap-current-mailbox
(imap-mailbox-unselect)
(error "nnimap: Group %s is not uid-valid." group))
(substring str (match-beginning 0) (match-end 0))))))
(imap-message-get imap-current-message 'RFC822.SIZE)
(imap-body-lines (imap-message-body imap-current-message))
- nil ;; xref
- nil))))) ;; extra-headers
+ nil;; xref
+ nil)))));; extra-headers
(defun nnimap-retrieve-which-headers (articles fetch-old)
"Get a range of articles to fetch based on ARTICLES and FETCH-OLD."
(nnimap-open-connection server))))
(deffoo nnimap-server-opened (&optional server)
- "If SERVER is the current virtual server, and the connection to the
-physical server is alive, this function return a non-nil value. If
+ "Whether SERVER is opened.
+If SERVER is the current virtual server, and the connection to the
+physical server is alive, this function return a non-nil value. If
SERVER is nil, it is treated as the current server."
;; clean up autologouts??
(and (or server nnimap-current-server)
(imap-opened (nnimap-get-server-buffer server))))
(deffoo nnimap-close-server (&optional server)
- "Close connection to server and free all resources connected to
-it. Return nil if the server couldn't be closed for some reason."
+ "Close connection to server and free all resources connected to it.
+Return nil if the server couldn't be closed for some reason."
(let ((server (or server nnimap-current-server)))
(when (or (nnimap-server-opened server)
(imap-opened (nnimap-get-server-buffer server)))
(nnoo-close-server 'nnimap server)))
(deffoo nnimap-request-close ()
- "Close connection to all servers and free all resources that the
-backend have reserved. All buffers that have been created by that
-backend should be killed. (Not the nntp-server-buffer, though.) This
+ "Close connection to all servers and free all resources that the backend have reserved.
+All buffers that have been created by that
+backend should be killed. (Not the nntp-server-buffer, though.) This
function is generally only called when Gnus is shutting down."
(mapcar (lambda (server) (nnimap-close-server (car server)))
nnimap-server-buffer-alist)
(deffoo nnimap-request-update-info-internal (group info &optional server)
(when (nnimap-possibly-change-group group server)
- (when info ;; xxx what does this mean? should we create a info?
+ (when info;; xxx what does this mean? should we create a info?
(with-current-buffer nnimap-server-buffer
(gnus-message 5 "nnimap: Updating info for %s..."
(gnus-info-group info))
(let (rule inbox removeorig (inboxes (nnimap-split-find-inbox server)))
;; iterate over inboxes
(while (and (setq inbox (pop inboxes))
- (nnimap-possibly-change-group inbox)) ;; SELECT
+ (nnimap-possibly-change-group inbox));; SELECT
;; find split rule for this server / inbox
(when (setq rule (nnimap-split-find-rule server inbox))
;; iterate over articles
(and removeorig
(imap-message-flags-add (format "%d" article)
"\\Seen \\Deleted")))))
- (when (imap-mailbox-select inbox) ;; just in case
+ (when (imap-mailbox-select inbox);; just in case
;; todo: UID EXPUNGE (if available) to remove splitted articles
(imap-mailbox-expunge)
(imap-mailbox-close)))
;; delete all removed identifiers
(mapcar (lambda (old-acl)
(unless (assoc (car old-acl) new-acls)
- (or (imap-mailbox-acl-delete (car old-acl) mailbox)
- (error "Can't delete ACL for %s" (car old-acl)))))
+ (or (imap-mailbox-acl-delete (car old-acl) mailbox)
+ (error "Can't delete ACL for %s" (car old-acl)))))
old-acls)
;; set all changed acl's
(mapcar (lambda (new-acl)
(let ((new-rights (cdr new-acl))
(old-rights (cdr (assoc (car new-acl) old-acls))))
- (unless (and old-rights new-rights
- (string= old-rights new-rights))
- (or (imap-mailbox-acl-set (car new-acl) new-rights mailbox)
- (error "Can't set ACL for %s to %s" (car new-acl)
- new-rights)))))
+ (unless (and old-rights new-rights
+ (string= old-rights new-rights))
+ (or (imap-mailbox-acl-set (car new-acl) new-rights mailbox)
+ (error "Can't set ACL for %s to %s" (car new-acl)
+ new-rights)))))
new-acls)
t)))
;; predicate => "SEEN", "FLAGGED", "DRAFT", "KEYWORD gnus-expire" etc
;;
;; Mark should not really contain 'read since it's not a "mark" in the Gnus
-;; world, but we cheat. Mark == gnus-article-mark-lists + '(read . read).
+;; world, but we cheat. Mark == gnus-article-mark-lists + '(read . read).
;;
(defconst nnimap-mark-to-predicate-alist
(mapcar
- (lambda (pair) ; cdr is the mark
+ (lambda (pair) ; cdr is the mark
(or (assoc (cdr pair)
'((read . "SEEN")
(tick . "FLAGGED")
(cons '(read . read) gnus-article-mark-lists)))
(defun nnimap-mark-to-predicate (pred)
- "Convert a Gnus mark (a symbol such as read, tick, expire) to a IMAP
-predicate (a string such as \"SEEN\", \"FLAGGED\", \"KEYWORD
-gnus-expire\") to be used within a IMAP SEARCH query."
+ "Convert a Gnus mark (a symbol such as read, tick, expire) to a IMAP predicate.
+This is a string such as \"SEEN\", \"FLAGGED\", \"KEYWORD gnus-expire\",
+to be used within a IMAP SEARCH query."
(cdr (assq pred nnimap-mark-to-predicate-alist)))
(defconst nnimap-mark-to-flag-alist
(cdr (assoc preds nnimap-mark-to-flag-alist))))
(defun nnimap-mark-to-flag (preds &optional always-list make-string)
- "Convert a Gnus mark (a symbol such as read, tick, expire) to a IMAP
-flag (a string such as \"\\Seen\", \"\\Flagged\", \"gnus-expire\") to
+ "Convert a Gnus mark (a symbol such as read, tick, expire) to a IMAP flag.
+This is a string such as \"\\Seen\", \"\\Flagged\", \"gnus-expire\", to
be used in a STORE FLAGS command."
(let ((result (nnimap-mark-to-flag-1 preds)))
(setq result (if (and (or make-string always-list)
result)))
(defun nnimap-mark-permanent-p (mark &optional group)
- "Return t iff MARK can be permanently (between IMAP sessions) saved
-on articles, in GROUP."
+ "Return t iff MARK can be permanently (between IMAP sessions) saved on articles, in GROUP."
(imap-message-flag-permanent-p (nnimap-mark-to-flag mark)))
(defun nnimap-remassoc (key alist)
- "Delete by side effect any elements of LIST whose car is
-`equal' to KEY. The modified LIST is returned. If the first member
+ "Delete by side effect any elements of LIST whose car is `equal' to KEY.
+The modified LIST is returned. If the first member
of LIST has a car that is `equal' to KEY, there is no way to remove it
by side effect; therefore, write `(setq foo (remassoc key foo))' to be
sure of changing the value of `foo'."
(car item) (cdr item))
(format "%d" item)))
(if (and (listp range) (not (listp (cdr range))))
- (list range) ;; make (1 . 2) into ((1 . 2))
+ (list range);; make (1 . 2) into ((1 . 2))
range)
","))
(buffer-disable-undo (get-buffer-create nnimap-debug))
(mapc (lambda (f) (trace-function-background f nnimap-debug))
'(
-nnimap-replace-in-string
-nnimap-possibly-change-server
-nnimap-verify-uidvalidity
-nnimap-find-minmax-uid
-nnimap-possibly-change-group
-;nnimap-replace-whitespace
-nnimap-retrieve-headers-progress
-nnimap-retrieve-which-headers
-nnimap-group-overview-filename
-nnimap-retrieve-headers-from-file
-nnimap-retrieve-headers-from-server
-nnimap-retrieve-headers
-nnimap-open-connection
-nnimap-open-server
-nnimap-server-opened
-nnimap-close-server
-nnimap-request-close
-nnimap-status-message
-;nnimap-demule
-nnimap-request-article-part
-nnimap-request-article
-nnimap-request-head
-nnimap-request-body
-nnimap-request-group
-nnimap-close-group
-nnimap-pattern-to-list-arguments
-nnimap-request-list
-nnimap-request-post
-nnimap-retrieve-groups
-nnimap-request-update-info-internal
-nnimap-request-type
-nnimap-request-set-mark
-nnimap-split-to-groups
-nnimap-split-find-rule
-nnimap-split-find-inbox
-nnimap-split-articles
-nnimap-request-scan
-nnimap-request-newgroups
-nnimap-request-create-group
-nnimap-time-substract
-nnimap-date-days-ago
-nnimap-request-expire-articles-progress
-nnimap-request-expire-articles
-nnimap-request-move-article
-nnimap-request-accept-article
-nnimap-request-delete-group
-nnimap-request-rename-group
-gnus-group-nnimap-expunge
-gnus-group-nnimap-edit-acl
-gnus-group-nnimap-edit-acl-done
-nnimap-group-mode-hook
-nnimap-mark-to-predicate
-nnimap-mark-to-flag-1
-nnimap-mark-to-flag
-nnimap-mark-permanent-p
-nnimap-remassoc
-nnimap-update-alist-soft
-nnimap-range-to-string
+ nnimap-replace-in-string
+ nnimap-possibly-change-server
+ nnimap-verify-uidvalidity
+ nnimap-find-minmax-uid
+ nnimap-possibly-change-group
+ ;;nnimap-replace-whitespace
+ nnimap-retrieve-headers-progress
+ nnimap-retrieve-which-headers
+ nnimap-group-overview-filename
+ nnimap-retrieve-headers-from-file
+ nnimap-retrieve-headers-from-server
+ nnimap-retrieve-headers
+ nnimap-open-connection
+ nnimap-open-server
+ nnimap-server-opened
+ nnimap-close-server
+ nnimap-request-close
+ nnimap-status-message
+ ;;nnimap-demule
+ nnimap-request-article-part
+ nnimap-request-article
+ nnimap-request-head
+ nnimap-request-body
+ nnimap-request-group
+ nnimap-close-group
+ nnimap-pattern-to-list-arguments
+ nnimap-request-list
+ nnimap-request-post
+ nnimap-retrieve-groups
+ nnimap-request-update-info-internal
+ nnimap-request-type
+ nnimap-request-set-mark
+ nnimap-split-to-groups
+ nnimap-split-find-rule
+ nnimap-split-find-inbox
+ nnimap-split-articles
+ nnimap-request-scan
+ nnimap-request-newgroups
+ nnimap-request-create-group
+ nnimap-time-substract
+ nnimap-date-days-ago
+ nnimap-request-expire-articles-progress
+ nnimap-request-expire-articles
+ nnimap-request-move-article
+ nnimap-request-accept-article
+ nnimap-request-delete-group
+ nnimap-request-rename-group
+ gnus-group-nnimap-expunge
+ gnus-group-nnimap-edit-acl
+ gnus-group-nnimap-edit-acl-done
+ nnimap-group-mode-hook
+ nnimap-mark-to-predicate
+ nnimap-mark-to-flag-1
+ nnimap-mark-to-flag
+ nnimap-mark-permanent-p
+ nnimap-remassoc
+ nnimap-update-alist-soft
+ nnimap-range-to-string
)))
(provide 'nnimap)
(deffoo nnkiboze-request-delete-group (group &optional force server)
(nnkiboze-possibly-change-group group)
(when force
- (let ((files (nconc
- (nnkiboze-score-file group)
- (list (nnkiboze-nov-file-name)
- (nnkiboze-nov-file-name ".newsrc")))))
- (while files
- (and (file-exists-p (car files))
- (file-writable-p (car files))
- (delete-file (car files)))
- (setq files (cdr files)))))
+ (let ((files (nconc
+ (nnkiboze-score-file group)
+ (list (nnkiboze-nov-file-name)
+ (nnkiboze-nov-file-name ".newsrc")))))
+ (while files
+ (and (file-exists-p (car files))
+ (file-writable-p (car files))
+ (delete-file (car files)))
+ (setq files (cdr files)))))
(setq nnkiboze-current-group nil)
t)
nnweb-type)
(defvoo nnlistserv-type-definition
- '((kk
- (article . nnlistserv-kk-wash-article)
- (map . nnlistserv-kk-create-mapping)
- (search . nnlistserv-kk-search)
- (address . "http://www.itk.ntnu.no/ansatte/Andresen_Trond/kk-f/%s/")
- (pages "fra160396" "fra160796" "fra061196" "fra160197"
- "fra090997" "fra040797" "fra130397" "nye")
- (index . "date.html")
- (identifier . nnlistserv-kk-identity)))
+ '((kk
+ (article . nnlistserv-kk-wash-article)
+ (map . nnlistserv-kk-create-mapping)
+ (search . nnlistserv-kk-search)
+ (address . "http://www.itk.ntnu.no/ansatte/Andresen_Trond/kk-f/%s/")
+ (pages "fra160396" "fra160796" "fra061196" "fra160197"
+ "fra090997" "fra040797" "fra130397" "nye")
+ (index . "date.html")
+ (identifier . nnlistserv-kk-identity)))
"Type-definition alist."
nnweb-type-definition)
nil 0 0 url))
map)
(nnweb-set-hashtb (cadar map) (car map))
- (nnheader-message 5 "%s %s %s" (cdr active) (point) pages)
- ))))
+ (nnheader-message 5 "%s %s %s" (cdr active) (point) pages)))))
;; Return the articles in the right order.
(setq nnweb-articles
(sort (nconc nnweb-articles map) 'car-less-than-car)))))
'("bogus"))
(error
(nnheader-message 5
- "Error in `nnmail-split-methods'; using `bogus' mail group")
+ "Error in `nnmail-split-methods'; using `bogus' mail group")
(sit-for 1)
'("bogus")))))
(setq split (gnus-remove-duplicates split))
(let ((coding-system-for-write
(or nnmbox-file-coding-system-for-write
nnmbox-file-coding-system)))
- (save-buffer)))
+ (save-buffer)))
(defun nnmbox-save-active (group-alist active-file)
(let ((nnmail-active-file-coding-system
(nnheader-report 'nnmbox "LIST NEWSGROUPS is not implemented."))
(deffoo nnmbox-request-expire-articles
- (articles newsgroup &optional server force)
+ (articles newsgroup &optional server force)
(nnmbox-possibly-change-newsgroup newsgroup server)
(let* ((is-old t)
rest)
(nconc rest articles))))
(deffoo nnmbox-request-move-article
- (article group server accept-form &optional last)
+ (article group server accept-form &optional last)
(let ((buf (get-buffer-create " *nnmbox move*"))
result)
(and
(and large
(zerop (% count 20))
(nnheader-message 5 "nnmh: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (/ (* count 100) number))))
(when large
(nnheader-message 5 "nnmh: Receiving headers...done"))
(mapcar (lambda (name) (string-to-int name))
(directory-files pathname nil "^[0-9]+$" t))
'<))
- (cond
- (dir
- (setq nnmh-group-alist
- (delq (assoc group nnmh-group-alist) nnmh-group-alist))
- (push (list group (cons (car dir) (car (last dir))))
- nnmh-group-alist)
- (nnheader-report 'nnmh "Selected group %s" group)
- (nnheader-insert
- "211 %d %d %d %s\n" (length dir) (car dir)
- (car (last dir)) group))
- (t
- (nnheader-report 'nnmh "Empty group %s" group)
- (nnheader-insert (format "211 0 1 0 %s\n" group))))))))))
+ (cond
+ (dir
+ (setq nnmh-group-alist
+ (delq (assoc group nnmh-group-alist) nnmh-group-alist))
+ (push (list group (cons (car dir) (car (last dir))))
+ nnmh-group-alist)
+ (nnheader-report 'nnmh "Selected group %s" group)
+ (nnheader-insert
+ "211 %d %d %d %s\n" (length dir) (car dir)
+ (car (last dir)) group))
+ (t
+ (nnheader-report 'nnmh "Empty group %s" group)
+ (nnheader-insert (format "211 0 1 0 %s\n" group))))))))))
(deffoo nnmh-request-scan (&optional group server)
(nnmail-get-new-mail 'nnmh nil nnmh-directory group))
t)
(deffoo nnmh-request-move-article
- (article group server accept-form &optional last)
+ (article group server accept-form &optional last)
(let ((buf (get-buffer-create " *nnmh move*"))
result)
(and
"Spool directory for the nnml mail backend.")
(defvoo nnml-active-file
- (concat (file-name-as-directory nnml-directory) "active")
+ (concat (file-name-as-directory nnml-directory) "active")
"Mail active file.")
(defvoo nnml-newsgroups-file
- (concat (file-name-as-directory nnml-directory) "newsgroups")
+ (concat (file-name-as-directory nnml-directory) "newsgroups")
"Mail newsgroups description file.")
(defvoo nnml-get-new-mail t
(nconc rest articles)))
(deffoo nnml-request-move-article
- (article group server accept-form &optional last)
+ (article group server accept-form &optional last)
(let ((buf (get-buffer-create " *nnml move*"))
result)
(nnml-possibly-change-directory group server)
(setq info (pop infolist)
range-list (gnus-uncompress-range (car info))
prefix (gnus-soup-area-prefix (nth 1 info)))
- (when ;; All the articles in this file are marked for expiry.
+ (when;; All the articles in this file are marked for expiry.
(and (or (setq mod-time (nth 5 (file-attributes
(nnsoup-file prefix))))
(setq mod-time (nth 5 (file-attributes
(and do-message
(zerop (% (incf count) 20))
(nnheader-message 5 "nnspool: Receiving headers... %d%%"
- (/ (* count 100) number))))
+ (/ (* count 100) number))))
(when do-message
(nnheader-message 5 "nnspool: Receiving headers...done"))
(read (current-buffer)))
seconds))
(push (buffer-substring
- (match-beginning 1) (match-end 1))
- groups)
+ (match-beginning 1) (match-end 1))
+ groups)
(zerop (forward-line -1))))
(erase-buffer)
(while groups
It is called with no parameters.")
(defvoo nntp-server-action-alist
- '(("nntpd 1\\.5\\.11t"
- (remove-hook 'nntp-server-opened-hook 'nntp-send-mode-reader))
- ("NNRP server Netscape"
- (setq nntp-server-list-active-group nil)))
+ '(("nntpd 1\\.5\\.11t"
+ (remove-hook 'nntp-server-opened-hook 'nntp-send-mode-reader))
+ ("NNRP server Netscape"
+ (setq nntp-server-list-active-group nil)))
"Alist of regexps to match on server types and actions to be taken.
For instance, if you want Gnus to beep every time you connect
to innd, you could say something like:
(nntp-inhibit-erase t)
article)
;; Send HEAD commands.
- (while (setq article (pop articles))
- (nntp-send-command
- nil
- "HEAD" (if (numberp article)
- (int-to-string article)
- ;; `articles' is either a list of article numbers
- ;; or a list of article IDs.
- article))
- (incf count)
- ;; Every 400 requests we have to read the stream in
- ;; order to avoid deadlocks.
- (when (or (null articles) ;All requests have been sent.
- (zerop (% count nntp-maximum-request)))
- (nntp-accept-response)
- (while (progn
- (set-buffer buf)
- (goto-char last-point)
- ;; Count replies.
- (while (nntp-next-result-arrived-p)
- (setq last-point (point))
- (incf received))
- (< received count))
- ;; If number of headers is greater than 100, give
- ;; informative messages.
- (and (numberp nntp-large-newsgroup)
- (> number nntp-large-newsgroup)
- (zerop (% received 20))
- (nnheader-message 6 "NNTP: Receiving headers... %d%%"
- (/ (* received 100) number)))
- (nntp-accept-response))))
+ (while (setq article (pop articles))
+ (nntp-send-command
+ nil
+ "HEAD" (if (numberp article)
+ (int-to-string article)
+ ;; `articles' is either a list of article numbers
+ ;; or a list of article IDs.
+ article))
+ (incf count)
+ ;; Every 400 requests we have to read the stream in
+ ;; order to avoid deadlocks.
+ (when (or (null articles) ;All requests have been sent.
+ (zerop (% count nntp-maximum-request)))
+ (nntp-accept-response)
+ (while (progn
+ (set-buffer buf)
+ (goto-char last-point)
+ ;; Count replies.
+ (while (nntp-next-result-arrived-p)
+ (setq last-point (point))
+ (incf received))
+ (< received count))
+ ;; If number of headers is greater than 100, give
+ ;; informative messages.
+ (and (numberp nntp-large-newsgroup)
+ (> number nntp-large-newsgroup)
+ (zerop (% received 20))
+ (nnheader-message 6 "NNTP: Receiving headers... %d%%"
+ (/ (* received 100) number)))
+ (nntp-accept-response))))
(and (numberp nntp-large-newsgroup)
(> number nntp-large-newsgroup)
(nnheader-message 6 "NNTP: Receiving headers...done"))
(unless (member user '(nil ""))
(nntp-send-command "^3.*\r?\n" "AUTHINFO USER" user)
(when t ;???Should check if AUTHINFO succeeded
- (nntp-send-command
- "^2.*\r?\n" "AUTHINFO PASS"
- (or passwd
- nntp-authinfo-password
- (setq nntp-authinfo-password
+ (nntp-send-command
+ "^2.*\r?\n" "AUTHINFO PASS"
+ (or passwd
+ nntp-authinfo-password
+ (setq nntp-authinfo-password
(mail-source-read-passwd (format "NNTP (%s@%s) password: "
- user nntp-address))))))))))
+ user nntp-address))))))))))
(defun nntp-send-nosy-authinfo ()
"Send the AUTHINFO to the nntp server."
(when t ;???Should check if AUTHINFO succeeded
(nntp-send-command "^2.*\r?\n" "AUTHINFO PASS"
(mail-source-read-passwd "NNTP (%s@%s) password: "
- user nntp-address))))))
+ user nntp-address))))))
(defun nntp-send-authinfo-from-file ()
"Send the AUTHINFO to the nntp server.
;;(setq total-contents (nreverse total-contents))
(dolist (art (cdr elem))
(if (not (nth (1- (cdr art)) total-contents))
- ();(debug)
+ () ;(debug)
(push (list (car art)
(nth (1- (cdr art)) total-contents)
subject)
(nnultimate-open-server server))
(unless nnultimate-groups-alist
(nnultimate-read-groups)
- (setq nnultimate-groups (cdr (assoc nnultimate-address
- nnultimate-groups-alist)))))
+ (setq nnultimate-groups (cdr (assoc nnultimate-address
+ nnultimate-groups-alist)))))
(deffoo nnultimate-open-server (server &optional defs connectionless)
(nnheader-init-server-buffer)
case-fold-search)
(when (and href (string-match
"postings\\|forumdisplay\\|Forum[0-9]+/HTML\\|getbio"
- href))
+ href))
t))))
(provide 'nnultimate)
(defvoo nnvirtual-current-group nil)
(defvoo nnvirtual-mapping-table nil
- "Table of rules on how to map between component group and article number
-to virtual article number.")
+ "Table of rules on how to map between component group and article number to virtual article number.")
(defvoo nnvirtual-mapping-offsets nil
"Table indexed by component group to an offset to be applied to article numbers in that group.")
(let ((gnus-use-cache t))
(setq result (gnus-retrieve-headers
articles cgroup nil))))
- (set-buffer nntp-server-buffer)
- ;; If we got HEAD headers, we convert them into NOV
- ;; headers. This is slow, inefficient and, come to think
- ;; of it, downright evil. So sue me. I couldn't be
- ;; bothered to write a header parse routine that could
- ;; parse a mixed HEAD/NOV buffer.
- (when (eq result 'headers)
- (nnvirtual-convert-headers))
- (goto-char (point-min))
- (while (not (eobp))
- (delete-region (point)
- (progn
- (setq carticle (read nntp-server-buffer))
- (point)))
-
- ;; We remove this article from the articles list, if
- ;; anything is left in the articles list after going through
- ;; the entire buffer, then those articles have been
- ;; expired or canceled, so we appropriately update the
- ;; component group below. They should be coming up
- ;; generally in order, so this shouldn't be slow.
- (setq articles (delq carticle articles))
-
- (setq article (nnvirtual-reverse-map-article cgroup carticle))
- (if (null article)
- ;; This line has no reverse mapping, that means it
- ;; was an extra article reference returned by nntp.
- (progn
- (beginning-of-line)
- (delete-region (point) (progn (forward-line 1) (point))))
- ;; Otherwise insert the virtual article number,
- ;; and clean up the xrefs.
- (princ article nntp-server-buffer)
- (nnvirtual-update-xref-header cgroup carticle
- prefix system-name)
- (forward-line 1))
- )
-
- (set-buffer vbuf)
- (goto-char (point-max))
- (insert-buffer-substring nntp-server-buffer))
+ (set-buffer nntp-server-buffer)
+ ;; If we got HEAD headers, we convert them into NOV
+ ;; headers. This is slow, inefficient and, come to think
+ ;; of it, downright evil. So sue me. I couldn't be
+ ;; bothered to write a header parse routine that could
+ ;; parse a mixed HEAD/NOV buffer.
+ (when (eq result 'headers)
+ (nnvirtual-convert-headers))
+ (goto-char (point-min))
+ (while (not (eobp))
+ (delete-region (point)
+ (progn
+ (setq carticle (read nntp-server-buffer))
+ (point)))
+
+ ;; We remove this article from the articles list, if
+ ;; anything is left in the articles list after going through
+ ;; the entire buffer, then those articles have been
+ ;; expired or canceled, so we appropriately update the
+ ;; component group below. They should be coming up
+ ;; generally in order, so this shouldn't be slow.
+ (setq articles (delq carticle articles))
+
+ (setq article (nnvirtual-reverse-map-article cgroup carticle))
+ (if (null article)
+ ;; This line has no reverse mapping, that means it
+ ;; was an extra article reference returned by nntp.
+ (progn
+ (beginning-of-line)
+ (delete-region (point) (progn (forward-line 1) (point))))
+ ;; Otherwise insert the virtual article number,
+ ;; and clean up the xrefs.
+ (princ article nntp-server-buffer)
+ (nnvirtual-update-xref-header cgroup carticle
+ prefix system-name)
+ (forward-line 1))
+ )
+
+ (set-buffer vbuf)
+ (goto-char (point-max))
+ (insert-buffer-substring nntp-server-buffer))
;; Anything left in articles is expired or canceled.
;; Could be smart and not tell it about articles already known?
(when articles
(aref entry 1)
(cdr (aref nnvirtual-mapping-offsets group-pos)))
))
- ))
+ ))
"Return an association list of component article numbers.
These are indexed by elements of nnvirtual-component-groups, based on
the sequence ARTICLES of virtual article numbers. ARTICLES should be
-sorted, and can be a compressed sequence. If any of the article
+sorted, and can be a compressed sequence. If any of the article
numbers has no corresponding component article, then it is left out of
the result."
(when (numberp (cdr-safe articles))
;; Into all-marks we put (g marks).
;; We also increment cnt and tot here, and compute M (max of sizes).
(mapcar (lambda (g)
- (setq active (gnus-activate-group g)
- min (car active)
- max (cdr active))
- (when (and active (>= max min) (not (zerop max)))
- ;; store active information
- (push (list g (- max min -1) max) actives)
- ;; collect unread/mark info for later
- (setq unreads (gnus-list-of-unread-articles g))
- (setq marks (gnus-info-marks (gnus-get-info g)))
- (when gnus-use-cache
- (push (cons 'cache
- (gnus-cache-articles-in-group g))
- marks))
- (push (cons g unreads) all-unreads)
- (push (cons g marks) all-marks)
- ;; count groups, total #articles, and max size
- (setq size (- max min -1))
- (setq cnt (1+ cnt)
- tot (+ tot size)
- M (max M size))))
- nnvirtual-component-groups)
+ (setq active (gnus-activate-group g)
+ min (car active)
+ max (cdr active))
+ (when (and active (>= max min) (not (zerop max)))
+ ;; store active information
+ (push (list g (- max min -1) max) actives)
+ ;; collect unread/mark info for later
+ (setq unreads (gnus-list-of-unread-articles g))
+ (setq marks (gnus-info-marks (gnus-get-info g)))
+ (when gnus-use-cache
+ (push (cons 'cache
+ (gnus-cache-articles-in-group g))
+ marks))
+ (push (cons g unreads) all-unreads)
+ (push (cons g marks) all-marks)
+ ;; count groups, total #articles, and max size
+ (setq size (- max min -1))
+ (setq cnt (1+ cnt)
+ tot (+ tot size)
+ M (max M size))))
+ nnvirtual-component-groups)
;; Number of articles in the virtual group.
(setq nnvirtual-mapping-len tot)
(deffoo nnwarchive-retrieve-headers (articles &optional group server fetch-old)
(nnwarchive-possibly-change-server group server)
(nnwarchive-bind
- (setq nnwarchive-headers (cdr (assoc group nnwarchive-headers-cache)))
- (save-excursion
- (set-buffer nnwarchive-buffer)
- (erase-buffer)
- (let (point start starts)
- (setq starts (nnwarchive-paged (sort articles '<)))
- (while (setq start (pop starts))
- (goto-char (point-max))
- (nnwarchive-url nnwarchive-xover-url))
- (if nnwarchive-xover-dissect
- (funcall nnwarchive-xover-dissect))))
- (save-excursion
- (set-buffer nntp-server-buffer)
- (erase-buffer)
- (let (header)
- (dolist (art articles)
- (if (setq header (assq art nnwarchive-headers))
- (nnheader-insert-nov (cdr header))))))
- (let ((elem (assoc group nnwarchive-headers-cache)))
- (if elem
- (setcdr elem nnwarchive-headers)
- (push (cons group nnwarchive-headers) nnwarchive-headers-cache)))
- 'nov))
+ (setq nnwarchive-headers (cdr (assoc group nnwarchive-headers-cache)))
+ (save-excursion
+ (set-buffer nnwarchive-buffer)
+ (erase-buffer)
+ (let (point start starts)
+ (setq starts (nnwarchive-paged (sort articles '<)))
+ (while (setq start (pop starts))
+ (goto-char (point-max))
+ (nnwarchive-url nnwarchive-xover-url))
+ (if nnwarchive-xover-dissect
+ (funcall nnwarchive-xover-dissect))))
+ (save-excursion
+ (set-buffer nntp-server-buffer)
+ (erase-buffer)
+ (let (header)
+ (dolist (art articles)
+ (if (setq header (assq art nnwarchive-headers))
+ (nnheader-insert-nov (cdr header))))))
+ (let ((elem (assoc group nnwarchive-headers-cache)))
+ (if elem
+ (setcdr elem nnwarchive-headers)
+ (push (cons group nnwarchive-headers) nnwarchive-headers-cache)))
+ 'nov))
(deffoo nnwarchive-retrieve-groups (groups &optional server)
"Retrieve group info on GROUPS."
(nnwarchive-possibly-change-server nil server)
(nnwarchive-bind
- (if nnwarchive-list-groups
- (funcall nnwarchive-list-groups groups))
- (nnwarchive-write-groups)
- (nnwarchive-generate-active)
- 'active))
+ (if nnwarchive-list-groups
+ (funcall nnwarchive-list-groups groups))
+ (nnwarchive-write-groups)
+ (nnwarchive-generate-active)
+ 'active))
(deffoo nnwarchive-request-group (group &optional server dont-check)
(nnwarchive-possibly-change-server nil server)
(nnwarchive-bind
- (if nnwarchive-list-groups
- (funcall nnwarchive-list-groups (list group)))
- (nnwarchive-write-groups)
- (let ((elem (assoc group nnwarchive-groups)))
- (cond
- ((not elem)
- (nnheader-report 'nnwarchive "Group does not exist"))
- (t
- (nnheader-report 'nnwarchive "Opened group %s" group)
- (nnheader-insert
- "211 %d %d %d %s\n" (or (cadr elem) 0) 1 (or (cadr elem) 0)
- (prin1-to-string group))
- t)))))
+ (if nnwarchive-list-groups
+ (funcall nnwarchive-list-groups (list group)))
+ (nnwarchive-write-groups)
+ (let ((elem (assoc group nnwarchive-groups)))
+ (cond
+ ((not elem)
+ (nnheader-report 'nnwarchive "Group does not exist"))
+ (t
+ (nnheader-report 'nnwarchive "Opened group %s" group)
+ (nnheader-insert
+ "211 %d %d %d %s\n" (or (cadr elem) 0) 1 (or (cadr elem) 0)
+ (prin1-to-string group))
+ t)))))
(deffoo nnwarchive-close-group (group &optional server)
(nnwarchive-possibly-change-server group server)
(nnwarchive-bind
- (when (gnus-buffer-live-p nnwarchive-buffer)
- (save-excursion
- (set-buffer nnwarchive-buffer)
- (kill-buffer nnwarchive-buffer)))
- t))
+ (when (gnus-buffer-live-p nnwarchive-buffer)
+ (save-excursion
+ (set-buffer nnwarchive-buffer)
+ (kill-buffer nnwarchive-buffer)))
+ t))
(deffoo nnwarchive-request-article (article &optional group server buffer)
(nnwarchive-possibly-change-server group server)
(nnwarchive-bind
- (let (contents)
- (save-excursion
- (set-buffer nnwarchive-buffer)
- (goto-char (point-min))
- (nnwarchive-url nnwarchive-article-url)
- (setq contents (funcall nnwarchive-article-dissect)))
- (when contents
- (save-excursion
- (set-buffer (or buffer nntp-server-buffer))
- (erase-buffer)
- (insert contents)
- (nnheader-report 'nnwarchive "Fetched article %s" article)
- (cons group article))))))
+ (let (contents)
+ (save-excursion
+ (set-buffer nnwarchive-buffer)
+ (goto-char (point-min))
+ (nnwarchive-url nnwarchive-article-url)
+ (setq contents (funcall nnwarchive-article-dissect)))
+ (when contents
+ (save-excursion
+ (set-buffer (or buffer nntp-server-buffer))
+ (erase-buffer)
+ (insert contents)
+ (nnheader-report 'nnwarchive "Fetched article %s" article)
+ (cons group article))))))
(deffoo nnwarchive-close-server (&optional server)
(when (and (nnwarchive-server-opened server)
(deffoo nnwarchive-request-list (&optional server)
(nnwarchive-possibly-change-server nil server)
(nnwarchive-bind
- (save-excursion
- (set-buffer nnwarchive-buffer)
- (erase-buffer)
- (if nnwarchive-list-url
- (nnwarchive-url nnwarchive-list-url))
- (if nnwarchive-list-dissect
- (funcall nnwarchive-list-dissect))
- (nnwarchive-write-groups)
- (nnwarchive-generate-active)))
+ (save-excursion
+ (set-buffer nnwarchive-buffer)
+ (erase-buffer)
+ (if nnwarchive-list-url
+ (nnwarchive-url nnwarchive-list-url))
+ (if nnwarchive-list-dissect
+ (funcall nnwarchive-list-dissect))
+ (nnwarchive-write-groups)
+ (nnwarchive-generate-active)))
'active)
(deffoo nnwarchive-request-newgroups (date &optional server)
(nnwarchive-possibly-change-server nil server)
(nnwarchive-bind
- (nnwarchive-write-groups)
- (nnwarchive-generate-active))
+ (nnwarchive-write-groups)
+ (nnwarchive-generate-active))
'active)
(deffoo nnwarchive-asynchronous-p ()
(setq nnwarchive-passwd
(or nnwarchive-passwd
(mail-source-read-passwd
- (format "Password for %s at %s: " nnwarchive-login server))))
+ (format "Password for %s at %s: " nnwarchive-login server))))
(nnwarchive-bind
- (unless nnwarchive-groups
- (nnwarchive-read-groups))
- (save-excursion
- (set-buffer nnwarchive-buffer)
- (erase-buffer)
- (if nnwarchive-open-url
- (nnwarchive-url nnwarchive-open-url))
- (if nnwarchive-open-dissect
- (funcall nnwarchive-open-dissect))
- (setq nnwarchive-opened t)))
+ (unless nnwarchive-groups
+ (nnwarchive-read-groups))
+ (save-excursion
+ (set-buffer nnwarchive-buffer)
+ (erase-buffer)
+ (if nnwarchive-open-url
+ (nnwarchive-url nnwarchive-open-url))
+ (if nnwarchive-open-dissect
+ (funcall nnwarchive-open-dissect))
+ (setq nnwarchive-opened t)))
t))
(nnoo-define-skeleton nnwarchive)
(nnwarchive-url nnwarchive-xover-last-url)
(goto-char (point-min))
(when (re-search-forward "of \\([0-9]+\\)</title>" nil t)
- (setq articles (string-to-number (match-string 1))))
+ (setq articles (string-to-number (match-string 1))))
(let ((elem (assoc group nnwarchive-groups)))
- (if elem
- (setcar (cdr elem) articles)
- (push (list group articles "") nnwarchive-groups)))
+ (if elem
+ (setcar (cdr elem) articles)
+ (push (list group articles "") nnwarchive-groups)))
(setq nnwarchive-headers (cdr (assoc group nnwarchive-headers-cache)))
- (nnwarchive-egroups-xover)
- (let ((elem (assoc group nnwarchive-headers-cache)))
- (if elem
- (setcdr elem nnwarchive-headers)
- (push (cons group nnwarchive-headers) nnwarchive-headers-cache)))))))
+ (nnwarchive-egroups-xover)
+ (let ((elem (assoc group nnwarchive-headers-cache)))
+ (if elem
+ (setcdr elem nnwarchive-headers)
+ (push (cons group nnwarchive-headers) nnwarchive-headers-cache)))))))
(defun nnwarchive-egroups-list ()
(let ((case-fold-search t)
(while (re-search-forward
"<a href=\"/group/\\([^/]+\\)/\\([0-9]+\\)\\.html[^>]+>\\([^<]+\\)<"
nil t)
- (setq group (match-string 1)
- article (string-to-number (match-string 2))
- subject (match-string 3))
- (forward-line 1)
- (unless (assq article nnwarchive-headers)
- (if (looking-at "<td[^>]+><font[^>]+>\\([^<]+\\)</font>")
- (setq from (match-string 1)))
- (forward-line 1)
- (if (looking-at "<td[^>]+><font[^>]+>\\([^<]+\\)</font>")
- (setq date (identity (match-string 1))))
- (push (cons
- article
- (make-full-mail-header
- article
- (nnwarchive-decode-entities-string subject)
- (nnwarchive-decode-entities-string from)
- date
- (concat "<" group "%"
- (number-to-string article)
- "@egroup.com>")
- ""
- 0 0 "")) nnwarchive-headers))))
+ (setq group (match-string 1)
+ article (string-to-number (match-string 2))
+ subject (match-string 3))
+ (forward-line 1)
+ (unless (assq article nnwarchive-headers)
+ (if (looking-at "<td[^>]+><font[^>]+>\\([^<]+\\)</font>")
+ (setq from (match-string 1)))
+ (forward-line 1)
+ (if (looking-at "<td[^>]+><font[^>]+>\\([^<]+\\)</font>")
+ (setq date (identity (match-string 1))))
+ (push (cons
+ article
+ (make-full-mail-header
+ article
+ (nnwarchive-decode-entities-string subject)
+ (nnwarchive-decode-entities-string from)
+ date
+ (concat "<" group "%"
+ (number-to-string article)
+ "@egroup.com>")
+ ""
+ 0 0 "")) nnwarchive-headers))))
nnwarchive-headers)
(defun nnwarchive-egroups-article ()
t))
(deffoo nnweb-request-update-info (group info &optional server)
- (nnweb-possibly-change-server group server)
- ;;(setcar (cddr info) nil)
- )
+ (nnweb-possibly-change-server group server))
(deffoo nnweb-asynchronous-p ()
t)
(goto-char (point-min))
(search-forward "</pre><hr>" nil t)
(delete-region (point-min) (point))
- ;(nnweb-decode-entities)
(goto-char (point-min))
(while (re-search-forward "^ +[0-9]+\\." nil t)
(narrow-to-region
(unless (aref parse-time-digits ?0)
(loop for i from ?0 to ?9
- do (aset parse-time-digits i (- i ?0))))
+ do (aset parse-time-digits i (- i ?0))))
(unless (aref parse-time-syntax ?0)
(loop for i from ?0 to ?9
- do (aset parse-time-syntax i ?0))
+ do (aset parse-time-syntax i ?0))
(loop for i from ?A to ?Z
- do (aset parse-time-syntax i ?A))
+ do (aset parse-time-syntax i ?A))
(loop for i from ?a to ?z
- do (aset parse-time-syntax i ?a))
+ do (aset parse-time-syntax i ?a))
(aset parse-time-syntax ?+ 1)
(aset parse-time-syntax ?- -1)
(aset parse-time-syntax ?: ?d)
(let ((process-buffer
(get-buffer-create (format "trace of POP session to %s" mailhost)))
(process)
- (coding-system-for-read 'binary) ;; because FSF Emacs 20 and
- (coding-system-for-write 'binary) ;; XEmacs 20 & 21 are st00pid
- )
+ (coding-system-for-read 'binary);; because FSF Emacs 20 and
+ (coding-system-for-write 'binary);; XEmacs 20 & 21 are st00pid
+ )
(save-excursion
(set-buffer process-buffer)
(erase-buffer)
(insert output)))
(defun pop3-send-command (process command)
- (set-buffer (process-buffer process))
- (goto-char (point-max))
-;; (if (= (aref command 0) ?P)
-;; (insert "PASS <omitted>\r\n")
-;; (insert command "\r\n"))
- (setq pop3-read-point (point))
- (goto-char (point-max))
- (process-send-string process (concat command "\r\n"))
- )
+ (set-buffer (process-buffer process))
+ (goto-char (point-max))
+ ;; (if (= (aref command 0) ?P)
+ ;; (insert "PASS <omitted>\r\n")
+ ;; (insert command "\r\n"))
+ (setq pop3-read-point (point))
+ (goto-char (point-max))
+ (process-send-string process (concat command "\r\n"))
+ )
(defun pop3-read-response (process &optional return)
"Read the response from the server.
;; bill@att.com
;; condensed into:
;; (sometimes causes problems for really large messages.)
-; (if (> (buffer-size) 20000) (sleep-for (/ (buffer-size) 20000)))
+ ;; (if (> (buffer-size) 20000) (sleep-for (/ (buffer-size) 20000)))
(goto-char start))
(setq pop3-read-point (point-marker))
-;; this code does not seem to work for some POP servers...
-;; and I cannot figure out why not.
-; (goto-char (match-beginning 0))
-; (backward-char 2)
-; (if (not (looking-at "\r\n"))
-; (insert "\r\n"))
-; (re-search-forward "\\.\r\n")
+ ;; this code does not seem to work for some POP servers...
+ ;; and I cannot figure out why not.
+ ;; (goto-char (match-beginning 0))
+ ;; (backward-char 2)
+ ;; (if (not (looking-at "\r\n"))
+ ;; (insert "\r\n"))
+ ;; (re-search-forward "\\.\r\n")
(goto-char (match-beginning 0))
(setq end (point-marker))
(pop3-clean-region start end)
(message "Malformed MIME quoted-printable message"))))))
(defun quoted-printable-decode-string (string)
- "Decode the quoted-printable-encoded STRING and return the results."
- (with-temp-buffer
- (insert string)
- (quoted-printable-decode-region (point-min) (point-max))
- (buffer-string)))
+ "Decode the quoted-printable-encoded STRING and return the results."
+ (with-temp-buffer
+ (insert string)
+ (quoted-printable-decode-region (point-min) (point-max))
+ (buffer-string)))
(defun quoted-printable-encode-region (from to &optional fold class)
"QP-encode the region between FROM and TO.
(save-excursion
(save-restriction
(narrow-to-region from to)
-;; (mm-encode-body)
+ ;; (mm-encode-body)
;; Encode all the non-ascii and control characters.
(goto-char (point-min))
(while (and (skip-chars-forward
(end-of-line)
(while (> (current-column) 72)
(beginning-of-line)
- (forward-char 71) ;; 71 char plus an "="
+ (forward-char 71);; 71 char plus an "="
(search-backward "=" (- (point) 2) t)
(insert "=\n")
(end-of-line))
(forward-line)))))))
(defun quoted-printable-encode-string (string)
- "QP-encode STRING and return the results."
- (mm-with-unibyte-buffer
- (insert string)
- (quoted-printable-encode-region (point-min) (point-max))
- (buffer-string)))
+ "QP-encode STRING and return the results."
+ (mm-with-unibyte-buffer
+ (insert string)
+ (quoted-printable-encode-region (point-min) (point-max))
+ (buffer-string)))
(provide 'qp)
"~\\({\\([\041-\167][\041-\176]\\| \\)+\\(~}\\|$\\)")
(defvar rfc1843-word-regexp-strictly
- "~\\({\\([\041-\167][\041-\176]\\)+\\(~}\\|$\\)")
+ "~\\({\\([\041-\167][\041-\176]\\)+\\(~}\\|$\\)")
(defvar rfc1843-hzp-word-regexp
"~\\({\\([\041-\167][\041-\176]\\| \\)+\\|\
[<>]\\([\041-\175][\041-\176]\\| \\)+\\)\\(~}\\|$\\)")
(defvar rfc1843-hzp-word-regexp-strictly
- "~\\({\\([\041-\167][\041-\176]\\)+\\|\
+ "~\\({\\([\041-\167][\041-\176]\\)+\\|\
[<>]\\([\041-\175][\041-\176]\\)+\\)\\(~}\\|$\\)")
(defcustom rfc1843-decode-loosely nil
(cond ((eq (char-after) ?\n)
(delete-char -1)
(delete-char 1))
- ((eq (char-after) ?~)
- (delete-char 1)))))))))
+ ((eq (char-after) ?~)
+ (delete-char 1)))))))))
(defun rfc1843-decode-string (string)
"Decode HZ STRING and return the results."
(buffer-string))))
(defun rfc1843-decode (word &optional firstc)
- "Decode HZ WORD and return it"
+ "Decode HZ WORD and return it."
(let ((i -1) (s (substring word 0)) v)
(if (or (not firstc) (eq firstc ?{))
(while (< (incf i) (length s))
s))
(defun rfc1843-decode-article-body ()
- "Decode HZ encoded text in the article body."
- (if (string-match (concat "\\<\\(" rfc1843-newsgroups-regexp "\\)\\>")
- (or gnus-newsgroup-name ""))
- (save-excursion
- (save-restriction
- (message-narrow-to-head)
- (let* ((inhibit-point-motion-hooks t)
- (case-fold-search t)
- (ct (message-fetch-field "Content-Type" t))
- (ctl (and ct (ignore-errors
- (mail-header-parse-content-type ct)))))
- (if (and ctl (not (string-match "/" (car ctl))))
- (setq ctl nil))
- (goto-char (point-max))
- (widen)
- (forward-line 1)
- (narrow-to-region (point) (point-max))
- (when (or (not ctl)
- (equal (car ctl) "text/plain"))
- (rfc1843-decode-region (point) (point-max))))))))
+ "Decode HZ encoded text in the article body."
+ (if (string-match (concat "\\<\\(" rfc1843-newsgroups-regexp "\\)\\>")
+ (or gnus-newsgroup-name ""))
+ (save-excursion
+ (save-restriction
+ (message-narrow-to-head)
+ (let* ((inhibit-point-motion-hooks t)
+ (case-fold-search t)
+ (ct (message-fetch-field "Content-Type" t))
+ (ctl (and ct (ignore-errors
+ (mail-header-parse-content-type ct)))))
+ (if (and ctl (not (string-match "/" (car ctl))))
+ (setq ctl nil))
+ (goto-char (point-max))
+ (widen)
+ (forward-line 1)
+ (narrow-to-region (point) (point-max))
+ (when (or (not ctl)
+ (equal (car ctl) "text/plain"))
+ (rfc1843-decode-region (point) (point-max))))))))
(defvar rfc1843-old-gnus-decode-header-function nil)
(defvar gnus-decode-header-methods)
Valid ENCODINGs are \"B\" and \"Q\".
If your Emacs implementation can't decode CHARSET, it returns nil."
(if (stringp charset)
- (setq charset (intern (downcase charset))))
+ (setq charset (intern (downcase charset))))
(if (or (not charset)
(eq 'gnus-all mail-parse-ignored-charsets)
(memq 'gnus-all mail-parse-ignored-charsets)
(if (and (not cs) charset
(listp mail-parse-ignored-charsets)
(memq 'gnus-unknown mail-parse-ignored-charsets))
- (setq cs (mm-charset-to-coding-system mail-parse-charset)))
+ (setq cs (mm-charset-to-coding-system mail-parse-charset)))
(when cs
(when (and (eq cs 'ascii)
mail-parse-charset)
(defvar smiley-running-xemacs (string-match "XEmacs" emacs-version))
(defvar smiley-map (make-sparse-keymap "smiley-keys")
- "Keymap to toggle smiley states.")
+ "Keymap to toggle smiley states.")
(define-key smiley-map [(button2)] 'smiley-toggle-extent)
(define-key smiley-map [(button3)] 'smiley-popup-menu)
;; Copyright (c) 1998 by Shenghuo Zhu <zsh@cs.rochester.edu>
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
-;; $Revision: 5.6 $
+;; $Revision: 5.7 $
;; Keywords: uudecode
;; This file is not part of GNU Emacs, but the same permissions
(uudecode-insert-char
(logand (lsh bits -8) 255) 1 nil work-buffer)
(uudecode-insert-char (logand bits 255) 1 nil
- work-buffer)
+ work-buffer)
(setq bits 0 counter 0))
(t (setq bits (lsh bits 6)))))))
(cond
- (done)
- ((> 0 remain)
- (error "uucode line ends unexpectly")
- (setq done t))
- ((and (= (point) end) (not done))
- ;(error "uucode ends unexpectly")
- (setq done t))
- ((= counter 3)
- (uudecode-insert-char (logand (lsh bits -16) 255) 1 nil
- work-buffer)
- (uudecode-insert-char (logand (lsh bits -8) 255) 1 nil
- work-buffer))
- ((= counter 2)
- (uudecode-insert-char (logand (lsh bits -10) 255) 1 nil
- work-buffer)))
+ (done)
+ ((> 0 remain)
+ (error "uucode line ends unexpectly")
+ (setq done t))
+ ((and (= (point) end) (not done))
+ ;;(error "uucode ends unexpectly")
+ (setq done t))
+ ((= counter 3)
+ (uudecode-insert-char (logand (lsh bits -16) 255) 1 nil
+ work-buffer)
+ (uudecode-insert-char (logand (lsh bits -8) 255) 1 nil
+ work-buffer))
+ ((= counter 2)
+ (uudecode-insert-char (logand (lsh bits -10) 255) 1 nil
+ work-buffer)))
(skip-chars-forward non-data-chars end))
(if file-name
(save-excursion
;; W3 hate redirect POST
(login-url
"http://%s/cgi-bin/dologin?login=%s&passwd=%s&enter=Sign+in&sec=no&curmbox=ACTIVE&_lang=&js=yes&id=2&tw=-10000&beta="
- webmail-aux user password)
+ webmail-aux user password)
(list-snarf . webmail-hotmail-list)
(article-snarf . webmail-hotmail-article)
(trash-url
(address . "mail.yahoo.com")
(open-url "http://mail.yahoo.com")
(open-snarf . webmail-yahoo-open)
- (login-url ;; yahoo will not accept GET
+ (login-url;; yahoo will not accept GET
content
("%s" webmail-aux)
".tries=1&.src=ym&.last=&promo=&lg=us&.intl=us&.bypass=&.chkP=Y&.done=http%%253a%%2F%%2Fedit.yahoo.com%%2Fconfig%%2Fmail%%253f.intl%%3D&login=%s&passwd=%s"
(address . "www.netaddress.com")
(open-url "http://www.netaddress.com")
(open-snarf . webmail-netaddress-open)
- (login-url ;; yahoo will not accept GET
+ (login-url;; yahoo will not accept GET
content
("%s" webmail-aux)
"LoginState=2&SuccessfulLogin=%%2Ftpl&NewServerName=www.netaddress.com&JavaScript=JavaScript1.2&DomainID=4&NA31site=classic.netaddress.com&NA31port=80&UserID=%s&passwd=%s"
(defvar url-cookie-multiple-line)
(defvar url-confirmation-func)
-;; Hack W3 POST redirect. See `url-parse-mime-headers'.
+;; Hack W3 POST redirect. See `url-parse-mime-headers'.
;;
;; Netscape uses "GET" as redirect method when orignal method is POST
;; and status is 302, .i.e no security risks by default without
(defun webmail-url-confirmation-func (prompt)
(cond
((equal prompt (concat "Honor redirection with non-GET method "
- "(possible security risks)? "))
+ "(possible security risks)? "))
nil)
((equal prompt "Continue (with method of GET)? ")
t)
"Redirect refresh url in META."
(goto-char (point-min))
(while (re-search-forward "HTTP-EQUIV=\"Refresh\"[^>]*URL=\\([^\"]+\\)\""
- nil t)
+ nil t)
(let ((url (match-string 1)))
(erase-buffer)
(nnweb-insert url))
(if webmail-list-snarf
(funcall webmail-list-snarf))
(while (setq item (pop webmail-articles))
- (message "Fetching mail #%d..." (setq n (1+ n)))
- (erase-buffer)
- (nnweb-insert (cdr item))
- (setq id (car item))
- (if webmail-article-snarf
- (funcall webmail-article-snarf file id))
- (when (and webmail-trash-url webmail-move-to-trash-can)
- (message "Move mail #%d to trash can..." n)
- (condition-case err
- (progn
- (webmail-url webmail-trash-url)
- (let (buf)
- (while (setq buf (pop webmail-buffer-list))
- (kill-buffer buf))))
- (error
- (let (buf)
- (while (setq buf (pop webmail-buffer-list))
- (kill-buffer buf)))
- (error err))))))
+ (message "Fetching mail #%d..." (setq n (1+ n)))
+ (erase-buffer)
+ (nnweb-insert (cdr item))
+ (setq id (car item))
+ (if webmail-article-snarf
+ (funcall webmail-article-snarf file id))
+ (when (and webmail-trash-url webmail-move-to-trash-can)
+ (message "Move mail #%d to trash can..." n)
+ (condition-case err
+ (progn
+ (webmail-url webmail-trash-url)
+ (let (buf)
+ (while (setq buf (pop webmail-buffer-list))
+ (kill-buffer buf))))
+ (error
+ (let (buf)
+ (while (setq buf (pop webmail-buffer-list))
+ (kill-buffer buf)))
+ (error err))))))
(if webmail-post-process
(funcall webmail-post-process))))
(while (re-search-forward "<div>\\|\\(http://[^/]+/cgi-bin/getmsg/\\([^\?]+\\)\?[^\"]*\\)\"" nil t)
(if (setq attachment (match-string 1))
(let ((filename (match-string 2))
- bufname) ;; Attachment
+ bufname);; Attachment
(delete-region p (match-end 0))
(save-excursion
(set-buffer (generate-new-buffer " *webmail-att*"))
(goto-char (point-min))
(when (re-search-forward
"showing [0-9]+-\\([0-9]+\\) of \\([0-9]+\\)" nil t)
- ;(setq listed (match-string 1))
+ ;;(setq listed (match-string 1))
(message "Found %s mail(s)" (match-string 2)))
(if (string-match "http://[^/]+" webmail-aux)
(setq webmail-aux (match-string 0 webmail-aux))
(cons id
(format "%s/tpl/Message/%s/Read?Q=%s&FolderID=-4&SortUseCase=True&Sort=Date&Headers=True"
(car webmail-open-url)
- webmail-session id)))
+ webmail-session id)))
(if (or (not webmail-newmail-only)
(equal (match-string 1) "True"))
(push item webmail-articles))))))
(replace-match " "))
(goto-char (point-min))
(while (re-search-forward "<br>" nil t)
- (replace-match "\n"))
+ (replace-match "\n"))
(webmail-remove-markup)
(webmail-decode-entities)
nil)
(unless (search-forward "</TABLE>" nil t)
(error "Can't find end label (article@8)"))
(delete-region p (point))
- (let (bufname) ;; Attachment
+ (let (bufname);; Attachment
(save-excursion
(set-buffer (generate-new-buffer " *webmail-att*"))
(nnweb-insert (concat (car webmail-open-url) attachment))
(setq p (point))
(widen)))
(unless mime
- (narrow-to-region p (point-max))
- (setq mime (webmail-netaddress-single-part))
- (widen))
+ (narrow-to-region p (point-max))
+ (setq mime (webmail-netaddress-single-part))
+ (widen))
(goto-char (point-min))
;; Some blank line to seperate mails.
(insert "\n\nFrom nobody " (current-time-string) "\n")