Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

*** empty log message ***

  • Loading branch information...
commit bc2e36aa3571e009279f3cb47dc28ada8ccf3c37 1 parent fd8763c
@larsmagne larsmagne authored
View
60 lisp/ChangeLog
@@ -1,5 +1,65 @@
+Fri Feb 23 00:24:55 1996 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+
+ * gnus.el (gnus-read-active-file): Would put wrong method on
+ `gnus-have-read-active-file'.
+
+ * gnus-srvr.el (gnus-browse-exit): Make sure all newly subscribed
+ groups are listed in the group buffer.
+
+ * gnus-uu.el (gnus-uu-check-for-generated-files): New
+ implementation.
+ (gnus-uu-save-files): Save directories properly.
+ (gnus-uu-scan-directory): Scan directories properly.
+
+ * gnus.el (gnus-configure-windows): Would create repeating
+ windows in multiple frames.
+ (gnus-group-make-group): Would bug out.
+
+ * gnus-salt.el (gnus-generate-tree): Make sure the tree window is
+ displayed before selecting it.
+ (gnus-highlight-selected-tree): Ditto.
+
+Fri Feb 23 00:01:25 1996 Lars Magne Ingebrigtsen <larsi@eistla.ifi.uio.no>
+
+ * gnus-srvr.el (gnus-server-yank-server): Would try to setcdr
+ nil.
+
+ * nndraft.el (nndraft-request-post): Removed function.
+
+ * gnus-score.el (gnus-score-followup): Apply "followup" scores
+ after generating them.
+
+Thu Feb 22 23:33:35 1996 Lars Magne Ingebrigtsen <larsi@eistla.ifi.uio.no>
+
+ * gnus-score.el (gnus-score-followup): Change to the adapt score
+ file properly.
+ (gnus-summary-score-entry): Return the added score entry.
+
+Thu Feb 22 01:03:16 1996 Lars Ingebrigtsen <lars@eyesore.no>
+
+ * gnus.el (gnus-unread-mark-p): New function.
+ (gnus-read-mark-p): New function.
+ (gnus-summary-mark-unread-and-read-as-read): New function.
+ (gnus-mark-article-hook): New default value.
+
+ * x-easymenu.el: Double up.
+
+ * gnus-edit.el (gnus-score-custom-data): Use kill file directory.
+
+ * gnus-msg.el (gnus-debug): Pp the entire setq.
+
+Wed Feb 21 04:10:12 1996 Lars Ingebrigtsen <lars@eyesore.no>
+
+ * nnspool.el: Use nnheader-report/nnheader-insert.
+ * nnml.el: Ditto.
+ * nnmbox.el: Ditto.
+ * nnkiboze.el: Ditto.
+ * nnbabyl.el: Ditto.
+
Wed Feb 21 00:21:56 1996 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+ * gnus.el: 0.40 is released.
+
* gnus.el (gnus-summary-refer-parent-article): Also check the NOV
references.
View
2  lisp/gnus-edit.el
@@ -47,7 +47,7 @@ the score file and the value of the global variable
(query . gnus-score-custom-save))
((name . file)
(tag . "File")
- (directory . "~/News/")
+ (directory . gnus-kill-files-directory)
(default-file . "SCORE")
(type . file))))
((name . files)
View
17 lisp/gnus-msg.el
@@ -2533,13 +2533,16 @@ The source file has to be in the Emacs load path."
(insert "------------------ Environment follows ------------------\n\n"))
(while olist
(if (boundp (car olist))
- (insert "(setq " (symbol-name (car olist))
- (if (or (consp (setq sym (symbol-value (car olist))))
- (and (symbolp sym)
- (not (or (eq sym nil)
- (eq sym t)))))
- " '" " ")
- (pp-to-string (symbol-value (car olist))) ")\n")
+ (insert
+ (pp-to-string
+ `(setq ,(symbol-name (car olist))
+ ,(if (or (consp (setq sym (symbol-value (car olist))))
+ (and (symbolp sym)
+ (not (or (eq sym nil)
+ (eq sym t)))))
+ (cons 'quote (symbol-value (car olist)))
+ (symbol-value (car olist)))
+ "\n")))
(insert ";; (makeunbound '" (symbol-name (car olist)) ")\n"))
(setq olist (cdr olist)))
(insert "\n\n")
View
14 lisp/gnus-salt.el
@@ -459,9 +459,10 @@ Two predefined functions are available:
(gnus-tree-minimize)
(gnus-tree-recenter)
(let ((selected (selected-window)))
- (select-window (get-buffer-window (set-buffer gnus-tree-buffer) t))
- (gnus-horizontal-recenter)
- (select-window selected)))))
+ (when (get-buffer-window (set-buffer gnus-tree-buffer) t)
+ (select-window (get-buffer-window (set-buffer gnus-tree-buffer) t))
+ (gnus-horizontal-recenter)
+ (select-window selected))))))
(defun gnus-generate-horizontal-tree (thread level &optional dummyp)
"Generate a horizontal tree."
@@ -609,9 +610,10 @@ Two predefined functions are available:
(gnus-tree-minimize)
(gnus-tree-recenter)
(let ((selected (selected-window)))
- (select-window (get-buffer-window (set-buffer gnus-tree-buffer) t))
- (gnus-horizontal-recenter)
- (select-window selected)))
+ (when (get-buffer-window (set-buffer gnus-tree-buffer) t)
+ (select-window (get-buffer-window (set-buffer gnus-tree-buffer) t))
+ (gnus-horizontal-recenter)
+ (select-window selected))))
;; If we remove this save-excursion, it updates the wrong mode lines?!?
(save-excursion
(set-buffer gnus-tree-buffer)
View
189 lisp/gnus-score.el
@@ -522,6 +522,8 @@ If optional argument `SILENT' is nil, show effect of score entry."
(if (numberp match)
(int-to-string match)
match))))
+
+ ;; Score the current buffer.
(and (>= (nth 1 (assoc header gnus-header-index)) 0)
(eq (nth 2 (assoc header gnus-header-index)) 'gnus-score-string)
(not silent)
@@ -531,9 +533,9 @@ If optional argument `SILENT' is nil, show effect of score entry."
(and (eq (nth 2 (assoc header gnus-header-index)) 'gnus-score-integer)
(setq match (string-to-int match)))
- (if (eq date 'now)
- ()
- (and (= score gnus-score-interactive-default-score)
+ (unless (eq date 'now)
+ ;; Add the score entry to the score file.
+ (when (= score gnus-score-interactive-default-score)
(setq score nil))
(let ((new (cond
(type
@@ -560,8 +562,9 @@ If optional argument `SILENT' is nil, show effect of score entry."
(or (nth 1 new)
gnus-score-interactive-default-score)))
;; Nope, we have to add a new elem.
- (gnus-score-set header (if old (cons new old) (list new)))))
- (gnus-score-set 'touched '(t)))))
+ (gnus-score-set header (if old (cons new old) (list new))))
+ (gnus-score-set 'touched '(t))
+ new))))
(defun gnus-summary-score-effect (header match type score)
"Simulate the effect of a score file entry.
@@ -1009,7 +1012,7 @@ SCORE is the score to add."
(defun gnus-score-headers (score-files &optional trace)
;; Score `gnus-newsgroup-headers'.
- (let (scores)
+ (let (scores news)
;; PLM: probably this is not the best place to clear orphan-score
(setq gnus-orphan-score nil)
(setq gnus-scores-articles nil)
@@ -1033,69 +1036,72 @@ SCORE is the score to add."
(member (car c) gnus-scores-exclude-files)
(setq scores (delq (car s) scores)))
(setq s (cdr s)))))
+ (setq news scores)
;; Do the scoring.
- (when (and gnus-summary-default-score
- scores
- (> (length gnus-newsgroup-headers)
- (length gnus-newsgroup-scored)))
- (let* ((entries gnus-header-index)
- (now (gnus-day-number (current-time-string)))
- (expire (and gnus-score-expiry-days
- (- now gnus-score-expiry-days)))
- (headers gnus-newsgroup-headers)
- (current-score-file gnus-current-score-file)
- entry header)
- (gnus-message 5 "Scoring...")
- ;; Create articles, an alist of the form `(HEADER . SCORE)'.
- (while headers
- (setq header (car headers)
- headers (cdr headers))
- ;; WARNING: The assq makes the function O(N*S) while it could
- ;; be written as O(N+S), where N is (length gnus-newsgroup-headers)
- ;; and S is (length gnus-newsgroup-scored).
- (or (assq (mail-header-number header) gnus-newsgroup-scored)
- (setq gnus-scores-articles ;Total of 2 * N cons-cells used.
- (cons (cons header (or gnus-summary-default-score 0))
- gnus-scores-articles))))
-
- (save-excursion
- (set-buffer (get-buffer-create "*Headers*"))
- (buffer-disable-undo (current-buffer))
-
- ;; Set the global variant of this variable.
- (setq gnus-current-score-file current-score-file)
- ;; score orphans
- (if gnus-orphan-score
- (progn
- (setq gnus-score-index
- (nth 1 (assoc "references" gnus-header-index)))
- (gnus-score-orphans gnus-orphan-score)))
- ;; Run each header through the score process.
- (while entries
- (setq entry (car entries)
- header (downcase (nth 0 entry))
- entries (cdr entries))
- (setq gnus-score-index (nth 1 (assoc header gnus-header-index)))
- (if (< 0 (apply 'max (mapcar
- (lambda (score)
- (length (gnus-score-get header score)))
- scores)))
+ (while news
+ (setq scores news
+ news nil)
+ (when (and gnus-summary-default-score
+ scores
+ (> (length gnus-newsgroup-headers)
+ (length gnus-newsgroup-scored)))
+ (let* ((entries gnus-header-index)
+ (now (gnus-day-number (current-time-string)))
+ (expire (and gnus-score-expiry-days
+ (- now gnus-score-expiry-days)))
+ (headers gnus-newsgroup-headers)
+ (current-score-file gnus-current-score-file)
+ entry header new)
+ (gnus-message 5 "Scoring...")
+ ;; Create articles, an alist of the form `(HEADER . SCORE)'.
+ (while (setq header (pop headers))
+ ;; WARNING: The assq makes the function O(N*S) while it could
+ ;; be written as O(N+S), where N is (length gnus-newsgroup-headers)
+ ;; and S is (length gnus-newsgroup-scored).
+ (or (assq (mail-header-number header) gnus-newsgroup-scored)
+ (setq gnus-scores-articles ;Total of 2 * N cons-cells used.
+ (cons (cons header (or gnus-summary-default-score 0))
+ gnus-scores-articles))))
+
+ (save-excursion
+ (set-buffer (get-buffer-create "*Headers*"))
+ (buffer-disable-undo (current-buffer))
+
+ ;; Set the global variant of this variable.
+ (setq gnus-current-score-file current-score-file)
+ ;; score orphans
+ (when gnus-orphan-score
+ (setq gnus-score-index
+ (nth 1 (assoc "references" gnus-header-index)))
+ (gnus-score-orphans gnus-orphan-score))
+ ;; Run each header through the score process.
+ (while entries
+ (setq entry (car entries)
+ header (downcase (nth 0 entry))
+ entries (cdr entries))
+ (setq gnus-score-index (nth 1 (assoc header gnus-header-index)))
+ (when (< 0 (apply 'max (mapcar
+ (lambda (score)
+ (length (gnus-score-get header score)))
+ scores)))
;; Call the scoring function for this type of "header".
- (funcall (nth 2 entry) scores header now expire trace)))
- ;; Remove the buffer.
- (kill-buffer (current-buffer)))
+ (when (setq new (funcall (nth 2 entry) scores header
+ now expire trace))
+ (push new news))))
+ ;; Remove the buffer.
+ (kill-buffer (current-buffer)))
- ;; Add articles to `gnus-newsgroup-scored'.
- (while gnus-scores-articles
- (or (= gnus-summary-default-score (cdr (car gnus-scores-articles)))
- (setq gnus-newsgroup-scored
- (cons (cons (mail-header-number
- (car (car gnus-scores-articles)))
- (cdr (car gnus-scores-articles)))
- gnus-newsgroup-scored)))
- (setq gnus-scores-articles (cdr gnus-scores-articles)))
+ ;; Add articles to `gnus-newsgroup-scored'.
+ (while gnus-scores-articles
+ (or (= gnus-summary-default-score (cdr (car gnus-scores-articles)))
+ (setq gnus-newsgroup-scored
+ (cons (cons (mail-header-number
+ (car (car gnus-scores-articles)))
+ (cdr (car gnus-scores-articles)))
+ gnus-newsgroup-scored)))
+ (setq gnus-scores-articles (cdr gnus-scores-articles)))
- (gnus-message 5 "Scoring...done")))))
+ (gnus-message 5 "Scoring...done"))))))
(defun gnus-get-new-thread-ids (articles)
@@ -1218,7 +1224,8 @@ SCORE is the score to add."
(gnus-score-set 'touched '(t) alist)
(setcdr entries (cdr rest))
(setq rest entries)))
- (setq entries rest))))))
+ (setq entries rest)))))
+ nil)
(defun gnus-score-date (scores header now expire &optional trace)
(let ((gnus-score-index (nth 1 (assoc header gnus-header-index)))
@@ -1272,7 +1279,8 @@ SCORE is the score to add."
(gnus-score-set 'touched '(t) alist)
(setcdr entries (cdr rest))
(setq rest entries)))
- (setq entries rest))))))
+ (setq entries rest)))))
+ nil)
(defun gnus-score-body (scores header now expire &optional trace)
(save-excursion
@@ -1367,7 +1375,8 @@ SCORE is the score to add."
(setcdr entries (cdr rest))
(setq rest entries)))
(setq entries rest)))))
- (setq articles (cdr articles)))))))
+ (setq articles (cdr articles))))))
+ nil)
(defun gnus-score-followup (scores header now expire &optional trace thread)
;; Insert the unique article headers in the buffer.
@@ -1375,12 +1384,15 @@ SCORE is the score to add."
(current-score-file gnus-current-score-file)
(all-scores scores)
;; gnus-score-index is used as a free variable.
- alike last this art entries alist articles)
+ alike last this art entries alist articles
+ new news)
;; Change score file to the adaptive score file. All entries that
;; this function makes will be put into this file.
- (gnus-score-load-file (gnus-score-file-name
- gnus-newsgroup-name gnus-adaptive-file-suffix))
+ (save-excursion
+ (set-buffer gnus-summary-buffer)
+ (gnus-score-load-file (gnus-score-file-name
+ gnus-newsgroup-name gnus-adaptive-file-suffix)))
(setq gnus-scores-articles (sort gnus-scores-articles 'gnus-score-string<)
articles gnus-scores-articles)
@@ -1445,10 +1457,10 @@ SCORE is the score to add."
(end-of-line)
(setq found (setq arts (get-text-property (point) 'articles)))
;; Found a match, update scores.
- (while arts
- (setq art (car arts)
- arts (cdr arts))
- (gnus-score-add-followups (car art) score all-scores thread))))
+ (while (setq art (pop arts))
+ (when (setq new (gnus-score-add-followups
+ (car art) score all-scores thread))
+ (push new news)))))
;; Update expire date
(cond ((null date)) ;Permanent entry.
((and found gnus-update-score-entry-dates) ;Match, update date.
@@ -1460,29 +1472,29 @@ SCORE is the score to add."
(setq rest entries)))
(setq entries rest))))
;; We change the score file back to the previous one.
- (gnus-score-load-file current-score-file)))
+ (save-excursion
+ (set-buffer gnus-summary-buffer)
+ (gnus-score-load-file current-score-file))
+ (list (cons "references" news))))
(defun gnus-score-add-followups (header score scores &optional thread)
+ "Add a score entry to the adapt file."
(save-excursion
(set-buffer gnus-summary-buffer)
(let* ((id (mail-header-id header))
(scores (car scores))
entry dont)
;; Don't enter a score if there already is one.
- (while scores
- (setq entry (car scores))
+ (while (setq entry (pop scores))
(and (equal "references" (car entry))
(or (null (nth 3 (car (cdr entry))))
(eq 's (nth 3 (car (cdr entry)))))
- (progn
- (if (assoc id entry)
- (setq dont t))))
- (setq scores (cdr scores)))
- (or dont
- (gnus-summary-score-entry
- (if thread "thread" "references")
- id 's score (current-time-string) nil t)))))
-
+ (assoc id entry)
+ (setq dont t)))
+ (unless dont
+ (gnus-summary-score-entry
+ (if thread "thread" "references")
+ id 's score (current-time-string) nil t)))))
(defun gnus-score-string (score-list header now expire &optional trace)
;; Score ARTICLES according to HEADER in SCORE-LIST.
@@ -1668,7 +1680,8 @@ SCORE is the score to add."
(gnus-score-set 'touched '(t) alist)
(setcdr entries (cdr rest))
(setq rest entries)))))
- (setq entries rest)))))))
+ (setq entries rest))))))
+ nil)
(defun gnus-score-string< (a1 a2)
;; Compare headers in articles A2 and A2.
View
18 lisp/gnus-srvr.el
@@ -280,7 +280,6 @@ The following commands are available:
(while (and (cdr alist)
(not (string= server (car (car (cdr alist))))))
(setq alist (cdr alist)))
- (setcdr alist (cons killed (cdr alist)))
(if alist
(setcdr alist (cons killed (cdr alist)))
(setq gnus-server-alist (list killed)))))
@@ -621,15 +620,15 @@ buffer.
(defun gnus-browse-unsubscribe-current-group (arg)
"(Un)subscribe to the next ARG groups."
(interactive "p")
- (and (eobp)
- (error "No group at current line."))
+ (when (eobp)
+ (error "No group at current line."))
(let ((ward (if (< arg 0) -1 1))
(arg (abs arg)))
(while (and (> arg 0)
(not (eobp))
(gnus-browse-unsubscribe-group)
(zerop (gnus-browse-next-group ward)))
- (setq arg (1- arg)))
+ (decf arg))
(gnus-group-position-point)
(if (/= 0 arg) (gnus-message 7 "No more newsgroups"))
arg))
@@ -670,12 +669,15 @@ buffer.
(defun gnus-browse-exit ()
"Quit browsing and return to the group buffer."
(interactive)
- (if (eq major-mode 'gnus-browse-mode)
- (kill-buffer (current-buffer)))
+ (when (eq major-mode 'gnus-browse-mode)
+ (kill-buffer (current-buffer)))
+ ;; Insert the newly subscribed groups in the group buffer.
+ (save-excursion
+ (set-buffer gnus-group-buffer)
+ (gnus-group-list-groups nil))
(if gnus-browse-return-buffer
(gnus-configure-windows 'server 'force)
- (gnus-configure-windows 'group 'force)
- (gnus-group-list-groups nil)))
+ (gnus-configure-windows 'group 'force)))
(defun gnus-browse-describe-briefly ()
"Give a one line description of the group mode commands."
View
80 lisp/gnus-uu.el
@@ -674,37 +674,37 @@ The headers will be included in the sequence they are matched.")
(or not-insert (not gnus-insert-pseudo-articles)
(gnus-summary-insert-pseudos files save))))
-;; Return a list of files in dir.
-(defun gnus-uu-scan-directory (dir)
+(defun gnus-uu-scan-directory (dir &optional rec)
+ "Return a list of all files under DIR."
(let ((files (directory-files dir t))
- dirs out)
- (while files
- (cond ((string-match "/\\.\\.?$" (car files)))
- ((file-directory-p (car files))
- (setq dirs (cons (car files) dirs)))
- (t (setq out (cons (list (cons 'name (car files))
- (cons 'article gnus-current-article))
- out))))
- (setq files (cdr files)))
- (apply 'nconc out (mapcar (lambda (d) (gnus-uu-scan-directory d))
- dirs))))
+ out file)
+ (while (setq file (pop files))
+ (unless (string-match "/\\.\\.?$" file)
+ (push (list (cons 'name file)
+ (cons 'article gnus-current-article))
+ out)
+ (when (file-directory-p file)
+ (setq out (nconc (gnus-uu-scan-directory file t) out)))))
+ (if rec
+ out
+ (nreverse out))))
(defun gnus-uu-save-files (files dir)
+ "Save FILES in DIR."
(let ((len (length files))
- to-file file)
- (while files
- (and
- (setq file (cdr (assq 'name (car files))))
- (file-exists-p file)
- (progn
- (setq to-file (if (file-directory-p dir)
- (concat dir (file-name-nondirectory file))
- dir))
- (and (or (not (file-exists-p to-file))
- (gnus-y-or-n-p (format "%s exists; overwrite? "
- to-file)))
- (copy-file file to-file t t))))
- (setq files (cdr files)))
+ (reg (concat "^" (regexp-quote gnus-uu-work-dir)))
+ to-file file fromdir)
+ (while (setq file (cdr (assq 'name (pop files))))
+ (when (file-exists-p file)
+ (string-match reg file)
+ (setq fromdir (substring file (match-end 0)))
+ (if (file-directory-p file)
+ (unless (file-exists-p (concat dir fromdir))
+ (make-directory (concat dir fromdir) t))
+ (setq to-file (concat dir fromdir))
+ (when (or (not (file-exists-p to-file))
+ (gnus-y-or-n-p (format "%s exists; overwrite? " to-file)))
+ (copy-file file to-file t t)))))
(message "Saved %d file%s" len (if (> len 1) "s" ""))))
;; Functions for saving and possibly digesting articles without
@@ -1613,23 +1613,17 @@ The headers will be included in the sequence they are matched.")
;; with `C-g'.
(defun gnus-uu-check-for-generated-files ()
(let (file dirs)
- (while gnus-uu-generated-file-list
- (setq file (car gnus-uu-generated-file-list))
- (setq gnus-uu-generated-file-list (cdr gnus-uu-generated-file-list))
- (if (not (string-match "/\\.[\\.]?$" file))
- (progn
- (if (file-directory-p file)
- (setq dirs (cons file dirs))
- (if (file-exists-p file)
- (delete-file file))))))
+ ;; First delete the generated files.
+ (while (setq file (pop gnus-uu-generated-file-list))
+ (unless (string-match "/\\.[\\.]?$" file)
+ (if (file-directory-p file)
+ (push file dirs)
+ (when (file-exists-p file)
+ (delete-file file)))))
+ ;; Then delete the directories.
(setq dirs (nreverse dirs))
- (while dirs
- (setq file (car dirs))
- (setq dirs (cdr dirs))
- (if (file-directory-p file)
- (if (string-match "/$" file)
- (delete-directory (substring file 0 (match-beginning 0)))
- (delete-directory file))))))
+ (while (setq file (pop dirs))
+ (delete-directory (directory-file-name file)))))
;; Add a file (or a list of files) to be checked (and deleted if it/they
;; still exists upon exiting the newsgroup).
View
38 lisp/gnus.el
@@ -1226,6 +1226,7 @@ with some simple extensions:
("nnbabyl" mail address respool)
("nnkiboze" post address virtual)
("nnsoup" post-mail address)
+ ("nndraft" post-mail)
("nnfolder" mail respool address))
"An alist of valid select methods.
The first element of each list lists should be a string with the name
@@ -1502,7 +1503,7 @@ The default function `gnus-group-highlight-line' will
highlight the line according to the `gnus-group-highlight'
variable.")
-(defvar gnus-mark-article-hook (list 'gnus-summary-mark-unread-as-read)
+(defvar gnus-mark-article-hook '(gnus-summary-mark-read-and-unread-as-read)
"*A hook called when an article is selected for the first time.
The hook is intended to mark an article as read (or unread)
automatically when it is selected.")
@@ -1685,7 +1686,7 @@ variable (string, integer, character, etc).")
"gnus-bug@ifi.uio.no (The Gnus Bugfixing Girls + Boys)"
"The mail address of the Gnus maintainers.")
-(defconst gnus-version "September Gnus v0.40"
+(defconst gnus-version "September Gnus v0.41"
"Version number for this version of Gnus.")
(defvar gnus-info-nodes
@@ -3276,8 +3277,8 @@ If RE-ONLY is non-nil, strip leading `Re:'s only."
(unless split
(error "No such setting: %s" setting))
- (if (and (not force)
- (setq all-visible (gnus-all-windows-visible-p split)))
+ (if (and (setq all-visible (gnus-all-windows-visible-p split))
+ (not force))
;; All the windows mentioned are already visible, so we just
;; put point in the assigned buffer, and do not touch the
;; winconf.
@@ -5298,9 +5299,9 @@ ADDRESS."
(concat "(gnus-group-set-info '" (prin1-to-string (cdr info)) ")")))
(gnus-group-insert-group-line-info nname)
- (when (assoc (symbol-name (car method)) gnus-valid-select-methods)
- (require (car method)))
- (gnus-check-server method)
+ (when (assoc (symbol-name (car meth)) gnus-valid-select-methods)
+ (require (car meth)))
+ (gnus-check-server meth)
(and (gnus-check-backend-function 'request-create-group nname)
(gnus-request-create-group nname))
t)))
@@ -7129,6 +7130,18 @@ article number."
(not (< (gnus-data-level (car data)) level))))
(and data (gnus-data-number (car data))))))
+(defun gnus-unread-mark-p (mark)
+ "Say whether MARK is the unread mark."
+ (= mark gnus-unread-mark))
+
+(defun gnus-read-mark-p (mark)
+ "Say whether MARK is one of the marks that mark as read.
+This is all marks except unread, ticked, dormant, and expirable."
+ (not (or (= mark gnus-unread-mark)
+ (= mark gnus-ticked-mark)
+ (= mark gnus-dormant-mark)
+ (= mark gnus-expirable-mark))))
+
;; Various summary mode internalish functions.
(defun gnus-mouse-pick-article (e)
@@ -11849,6 +11862,13 @@ The difference between N and the number of marks cleared is returned."
(when (memq gnus-current-article gnus-newsgroup-unreads)
(gnus-summary-mark-article gnus-current-article gnus-read-mark)))
+(defun gnus-summary-mark-unread-and-read-as-read ()
+ "Intended to be used by `gnus-summary-mark-article-hook'."
+ (let ((mark (gnus-summary-article-mark)))
+ (when (or (gnus-unread-mark-p mark)
+ (gnus-read-mark-p mark))
+ (gnus-summary-mark-article gnus-current-article gnus-read-mark))))
+
(defun gnus-summary-mark-region-as-read (point mark all)
"Mark all unread articles between point and mark as read.
If given a prefix, mark all articles between point and mark as read,
@@ -15410,7 +15430,9 @@ Returns whether the updating was successful."
(save-excursion
(set-buffer nntp-server-buffer)
(while methods
- (let* ((method (gnus-server-get-method nil (car methods)))
+ (let* ((method (if (stringp (car methods))
+ (gnus-server-get-method nil (car methods))
+ (car methods)))
(where (nth 1 method))
(mesg (format "Reading active file%s via %s..."
(if (and where (not (zerop (length where))))
View
6 lisp/nnbabyl.el
@@ -259,8 +259,7 @@
(nnbabyl-request-list server))
(defun nnbabyl-request-list-newsgroups (&optional server)
- (setq nnbabyl-status-string "nnbabyl: LIST NEWSGROUPS is not implemented.")
- nil)
+ (nnheader-report 'nnbabyl "nnbabyl: LIST NEWSGROUPS is not implemented."))
(defun nnbabyl-request-post (&optional server)
(mail-send-and-exit nil))
@@ -452,8 +451,7 @@
(if newsgroup
(if (assoc newsgroup nnbabyl-group-alist)
(setq nnbabyl-current-group newsgroup)
- (setq nnbabyl-status-string "No such group in file")
- nil)
+ (nnheader-report 'nnbabyl "No such group in file"))
t))
(defun nnbabyl-article-string (article)
View
3  lisp/nndraft.el
@@ -180,9 +180,6 @@
(nndraft-execute-nnmh-command
`(nnmh-request-newgroups ,date ,server)))
-(defun nndraft-request-post (&optional server)
- (mail-send-and-exit nil))
-
(defun nndraft-request-expire-articles
(articles group &optional server force)
(let ((res (nndraft-execute-nnmh-command
View
11 lisp/nnkiboze.el
@@ -178,19 +178,14 @@ If the stream is opened, return T, otherwise return NIL."
(setq nnkiboze-current-group nil)))
(defun nnkiboze-request-list (&optional server)
- (setq nnkiboze-status-string "nnkiboze: LIST is not implemented.")
- nil)
+ (nnheader-report 'nnkiboze "LIST is not implemented."))
(defun nnkiboze-request-newgroups (date &optional server)
"List new groups."
- (setq nnkiboze-status-string "NEWGROUPS is not supported.")
- nil)
+ (nnheader-report 'nnkiboze "NEWGROUPS is not supported."))
(defun nnkiboze-request-list-newsgroups (&optional server)
- (setq nnkiboze-status-string "nnkiboze: LIST NEWSGROUPS is not implemented.")
- nil)
-
-(defalias 'nnkiboze-request-post 'nntp-request-post)
+ (nnheader-report 'nnkiboze "LIST NEWSGROUPS is not implemented."))
(defun nnkiboze-request-delete-group (group &optional force server)
(nnkiboze-possibly-change-newsgroups group)
View
3  lisp/nnmbox.el
@@ -228,8 +228,7 @@
(nnmbox-request-list server))
(defun nnmbox-request-list-newsgroups (&optional server)
- (setq nnmbox-status-string "nnmbox: LIST NEWSGROUPS is not implemented.")
- nil)
+ (nnheader-report 'nnmbox "LIST NEWSGROUPS is not implemented."))
(defun nnmbox-request-post (&optional server)
(mail-send-and-exit nil))
View
16 lisp/nnml.el
@@ -223,16 +223,12 @@ all. This may very well take some time.")
(t
(nnmail-activate 'nnml)
(let ((active (nth 1 (assoc group nnml-group-alist))))
- (save-excursion
- (set-buffer nntp-server-buffer)
- (erase-buffer)
- (if (not active)
- (nnheader-report 'nnml "No such group: %s" group)
- (insert (format "211 %d %d %d %s\n"
- (max (1+ (- (cdr active) (car active))) 0)
- (car active) (cdr active) group))
- (nnheader-report 'nnml "Group %s selected" group)
- t))))))
+ (if (not active)
+ (nnheader-report 'nnml "No such group: %s" group)
+ (nnheader-report 'nnml "Selected group %s" group)
+ (nnheader-insert "211 %d %d %d %s\n"
+ (max (1+ (- (cdr active) (car active))) 0)
+ (car active) (cdr active) group))))))
(defun nnml-request-scan (&optional group server)
(setq nnml-article-file-alist nil)
View
56 lisp/nnspool.el
@@ -216,13 +216,14 @@ there.")
(defun nnspool-request-body (id &optional group server)
"Select article body by message ID (or number)."
(nnspool-possibly-change-directory group)
- (if (nnspool-request-article id)
+ (let ((res (nnspool-request-article id)))
+ (when res
(save-excursion
(set-buffer nntp-server-buffer)
(goto-char (point-min))
- (if (search-forward "\n\n" nil t)
- (delete-region (point-min) (point)))
- t)))
+ (when (search-forward "\n\n" nil t)
+ (delete-region (point-min) (point)))
+ res))))
(defun nnspool-request-head (id &optional group server)
"Select article head by message ID (or number)."
@@ -249,25 +250,18 @@ there.")
(progn
(nnheader-report 'nnspool "Selected group %s" group)
t)
- ;; Yes, completely empty spool directories *are* possible
+ ;; Yes, completely empty spool directories *are* possible.
;; Fix by Sudish Joseph <joseph@cis.ohio-state.edu>
(when (setq dir (directory-files pathname nil "^[0-9]+$" t))
(setq dir
(sort (mapcar (lambda (name) (string-to-int name)) dir) '<)))
- (save-excursion
- (set-buffer nntp-server-buffer)
- (erase-buffer)
- (if dir
- (progn
- (insert
- (format "211 %d %d %d %s\n" (length dir) (car dir)
- (progn (while (cdr dir) (setq dir (cdr dir)))
- (car dir))
- group))
- t)
- (insert (format "211 0 0 0 %s\n" group))
- (nnheader-report 'nnspool "Empty group %s" group)
- t))))))
+ (if dir
+ (nnheader-insert
+ "211 %d %d %d %s\n" (length dir) (car dir)
+ (progn (while (cdr dir) (setq dir (cdr dir))) (car dir))
+ group)
+ (nnheader-report 'nnspool "Empty group %s" group)
+ (nnheader-insert "211 0 0 0 %s\n" group))))))
(defun nnspool-request-type (group &optional article)
'news)
@@ -335,12 +329,11 @@ there.")
(apply 'start-process "*nnspool inews*" inews-buffer
nnspool-inews-program nnspool-inews-switches)
(error
- (setq nnspool-status-string (format "inews error: %S" err))
- nil))))
+ (nnheader-report 'nnspool "inews error: %S" err)))))
(if (not proc)
;; The inews program failed.
()
- (setq nnspool-status-string "")
+ (nnheader-report 'nnspool "")
(set-process-sentinel proc 'nnspool-inews-sentinel)
(process-send-region proc (point-min) (point-max))
;; We slap a condition-case around this, because the process may
@@ -360,7 +353,7 @@ there.")
;; Make status message by folding lines.
(while (re-search-forward "[ \t\n]+" nil t)
(replace-match " " t t))
- (setq nnspool-status-string (buffer-string))
+ (nnheader-report 'nnspool "%s" (buffer-string))
(message "nnspool: %s" nnspool-status-string)
(ding)
(run-hooks 'nnspool-rejected-article-hook))))
@@ -461,16 +454,13 @@ there.")
(file-error nil)))
(defun nnspool-possibly-change-directory (group)
- (if group
- (let ((pathname (nnspool-article-pathname group)))
- (if (file-directory-p pathname)
- (progn
- (setq nnspool-current-directory pathname)
- (setq nnspool-current-group group))
- (setq nnspool-status-string
- (format "No such newsgroup: %s" group))
- nil))
- t))
+ (if (not group)
+ t
+ (let ((pathname (nnspool-article-pathname group)))
+ (if (file-directory-p pathname)
+ (setq nnspool-current-directory pathname
+ nnspool-current-group group)
+ (nnheader-report 'nnspool "No such newsgroup: %s" group)))))
(defun nnspool-article-pathname (group &optional article)
"Find the path for GROUP."
View
181 lisp/x-easymenu.el
@@ -1,188 +1,11 @@
;;; easymenu.el - Easy menu support for Emacs 19 and XEmacs.
;;
-;; $Id: x-easymenu.el,v 1.1 1995/11/26 04:01:08 steve Exp $
+;; $Id: x-easymenu.el,v 1.2 1996/02/23 03:24:58 steve Exp $
;;
;; LCD Archive Entry:
;; easymenu|Per Abrahamsen|abraham@iesd.auc.dk|
;; Easy menu support for XEmacs|
-;; $Date: 1995/11/26 04:01:08 $|$Revision: 1.1 $|~/misc/easymenu.el.gz|
-
-;; Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
-;;
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-;; Commentary:
-;;
-;; Easymenu allows you to define menus for both Emacs 19 and XEmacs.
-;;
-;; This file
-;; The advantages of using easymenu are:
-;;
-;; - Easier to use than either the Emacs 19 and XEmacs menu syntax.
-;;
-;; - Common interface for Emacs 18, Emacs 19, and XEmacs.
-;; (The code does nothing when run under Emacs 18).
-;;
-;; The public functions are:
-;;
-;; - Function: easy-menu-define SYMBOL MAPS DOC MENU
-;; SYMBOL is both the name of the variable that holds the menu and
-;; the name of a function that will present a the menu.
-;; MAPS is a list of keymaps where the menu should appear in the menubar.
-;; DOC is the documentation string for the variable.
-;; MENU is an XEmacs style menu description.
-;;
-;; See the documentation for easy-menu-define for details.
-;;
-;; - Function: easy-menu-change PATH NAME ITEMS
-;; Change an existing menu.
-;; The menu must already exist an be visible on the menu bar.
-;; PATH is a list of strings used for locating the menu on the menu bar.
-;; NAME is the name of the menu.
-;; ITEMS is a list of menu items, as defined in `easy-menu-define'.
-;;
-;; - Function: easy-menu-add MENU [ MAP ]
-;; Add MENU to the current menubar in MAP.
-;;
-;; - Function: easy-menu-remove MENU
-;; Remove MENU from the current menubar.
-;;
-;; Emacs 19 never uses `easy-menu-add' or `easy-menu-remove', menus
-;; automatically appear and disappear when the keymaps specified by
-;; the MAPS argument to `easy-menu-define' are activated.
-;;
-;; XEmacs will bind the map to button3 in each MAPS, but you must
-;; explicitly call `easy-menu-add' and `easy-menu-remove' to add and
-;; remove menus from the menu bar.
-
-;;; Code:
-
-;;;###autoload
-(defmacro easy-menu-define (symbol maps doc menu)
- "Define a menu bar submenu in maps MAPS, according to MENU.
-The arguments SYMBOL and DOC are ignored; they are present for
-compatibility only. SYMBOL is not evaluated. In other Emacs versions
-these arguments may be used as a variable to hold the menu data, and a
-doc string for that variable.
-
-The first element of MENU must be a string. It is the menu bar item name.
-The rest of the elements are menu items.
-
-A menu item is usually a vector of three elements: [NAME CALLBACK ENABLE]
-
-NAME is a string--the menu item name.
-
-CALLBACK is a command to run when the item is chosen,
-or a list to evaluate when the item is chosen.
-
-ENABLE is an expression; the item is enabled for selection
-whenever this expression's value is non-nil.
-
-Alternatively, a menu item may have the form:
-
- [ NAME CALLBACK [ KEYWORD ARG ] ... ]
-
-Where KEYWORD is one of the symbol defined below.
-
- :keys KEYS
-
-KEYS is a string; a complex keyboard equivalent to this menu item.
-
- :active ENABLE
-
-ENABLE is an expression; the item is enabled for selection
-whenever this expression's value is non-nil.
-
- :suffix NAME
-
-NAME is a string; the name of an argument to CALLBACK.
-
- :style STYLE
-
-STYLE is a symbol describing the type of menu item. The following are
-defined:
-
-toggle: A checkbox.
- Currently just prepend the name with the string \"Toggle \".
-radio: A radio button.
-nil: An ordinary menu item.
-
- :selected SELECTED
-
-SELECTED is an expression; the checkbox or radio button is selected
-whenever this expression's value is non-nil.
-Currently just disable radio buttons, no effect on checkboxes.
-
-A menu item can be a string. Then that string appears in the menu as
-unselectable text. A string consisting solely of hyphens is displayed
-as a solid horizontal line.
-
-A menu item can be a list. It is treated as a submenu.
-The first element should be the submenu name. That's used as the
-menu item in the top-level menu. The cdr of the submenu list
-is a list of menu items, as above."
- (` (progn
- (defvar (, symbol) nil (, doc))
- (easy-menu-do-define (quote (, symbol)) (, maps) (, doc) (, menu)))))
-
-(defun easy-menu-do-define (symbol maps doc menu)
- (set symbol menu)
- (fset symbol (list 'lambda '(e)
- doc
- '(interactive "@e")
- '(run-hooks 'activate-menubar-hook)
- '(setq zmacs-region-stays 't)
- (list 'popup-menu symbol)))
- (mapcar (function (lambda (map) (define-key map 'button3 symbol)))
- (if (keymapp maps) (list maps) maps)))
-
-(fset 'easy-menu-change (symbol-function 'add-menu))
-
-(defun easy-menu-add (menu &optional map)
- "Add MENU to the current menu bar."
- (cond ((null current-menubar)
- ;; Don't add it to a non-existing menubar.
- nil)
- ((assoc (car menu) current-menubar)
- ;; Already present.
- nil)
- ((equal current-menubar '(nil))
- ;; Set at left if only contains right marker.
- (set-buffer-menubar (list menu nil)))
- (t
- ;; Add at right.
- (set-buffer-menubar (copy-sequence current-menubar))
- (add-menu nil (car menu) (cdr menu)))))
-
-(defun easy-menu-remove (menu)
- "Remove MENU from the current menu bar."
- (and current-menubar
- (assoc (car menu) current-menubar)
- (delete-menu-item (list (car menu)))))
-
-(provide 'easymenu)
-
-;;; easymenu.el ends here
-;;; easymenu.el - Easy menu support for Emacs 19 and XEmacs.
-;;
-;; $Id: x-easymenu.el,v 1.1 1995/11/26 04:01:08 steve Exp $
-;;
-;; LCD Archive Entry:
-;; easymenu|Per Abrahamsen|abraham@iesd.auc.dk|
-;; Easy menu support for XEmacs|
-;; $Date: 1995/11/26 04:01:08 $|$Revision: 1.1 $|~/misc/easymenu.el.gz|
+;; $Date: 1996/02/23 03:24:58 $|$Revision: 1.2 $|~/misc/easymenu.el.gz|
;; Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
;;
View
4 texi/ChangeLog
@@ -1,3 +1,7 @@
+Thu Feb 22 18:44:29 1996 Lars Ingebrigtsen <lars@eyesore.no>
+
+ * gnus.texi (Choosing Articles): Addition.
+
Mon Feb 19 00:17:01 1996 Lars Ingebrigtsen <lars@eyesore.no>
* gnus.texi (NoCeM): New.
View
12 texi/gnus.texi
@@ -2954,8 +2954,18 @@ exposes any threads hidden under the selected article.
@item gnus-mark-article-hook
@vindex gnus-mark-article-hook
+@findex gnus-summary-mark-unread-as-read
+@findex gnus-summary-mark-read-and-unread-as-read
+@findex gnus-unread-mark
This hook is called whenever an article is selected. It is intended to
-be used for marking articles as read.
+be used for marking articles as read. The default value is
+@code{gnus-summary-mark-unread-and-read-as-read}, and will change the
+mark of almost any article you read to @code{gnus-unread-mark}. The
+only articles not affected by this function are ticked, dormant, and
+expirable articles. If you'd instead like to just have unread articles
+marked as read, you can use @code{gnus-summary-mark-unread-as-read}
+instead. It will leave marks like @code{gnus-low-score-mark},
+@code{gnus-del-mark} (and so on) alone.
@end table
Please sign in to comment.
Something went wrong with that request. Please try again.