1999-12-13 Per Abrahamsen <abraham@dina.kvl.dk>
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Fri, 21 Apr 2000 18:01:08 +0000 (18:01 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Fri, 21 Apr 2000 18:01:08 +0000 (18:01 +0000)
* rfc2047.el (rfc2047-fold-region): Don't use the same break twice.

1999-12-14 04:14:44  Katsumi Yamaoka  <yamaoka@jpl.org>

* dgnushack.el (last, mapcon, member-if, union): New compiler
macros for emulating cl functions.

1999-12-21  Jan Vroonhof  <vroonhof@math.ethz.ch>

* message.el (message-shorten-references): Only cater to broken
INN for news. This caters for broken smtpd.

2000-04-21 18:20:10  Lars Magne Ingebrigtsen  <larsi@gnus.org>

* mailcap.el (mailcap-mime-info): Use the first match; not the
last.

* gnus-agent.el (gnus-category-kill): Save the category list.

lisp/ChangeLog
lisp/dgnushack.el
lisp/gnus-agent.el
lisp/gnus-art.el
lisp/gnus-group.el
lisp/gnus-sum.el
lisp/mailcap.el
lisp/message.el
lisp/rfc2047.el

index 90608b4..126e693 100644 (file)
@@ -1,3 +1,36 @@
+1999-12-13  Per Abrahamsen  <abraham@dina.kvl.dk>
+
+       * rfc2047.el (rfc2047-fold-region): Don't use the same break twice.
+
+1999-12-14 04:14:44  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * dgnushack.el (last, mapcon, member-if, union): New compiler
+       macros for emulating cl functions.
+
+1999-12-21  Jan Vroonhof  <vroonhof@math.ethz.ch>
+
+       * message.el (message-shorten-references): Only cater to broken
+       INN for news. This caters for broken smtpd.
+
+2000-04-21 18:20:10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * mailcap.el (mailcap-mime-info): Use the first match; not the
+       last. 
+
+       * gnus-agent.el (gnus-category-kill): Save the category list.
+
+2000-04-21 16:41:50  Chris Brierley  <brierley@pobox.com>
+
+       * gnus-sum.el (gnus-summary-move-article): Do something or other. 
+
+2000-04-21 16:07:07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-group.el (gnus-group-add-icon): Fixed indentation.
+
+2000-04-21 16:07:07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-group.el (gnus-group-add-icon): Fixed indentation.
+
 2000-04-21 10:43:16  Shenghuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus-group.el (gnus-group-prepare-flat-predicate): New function.
@@ -424,6 +457,21 @@ Thu Apr 20 01:39:25 2000  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
 
        * base64.el: Require cl when compiling.
 
+2000-01-05  BrYan P. Johnson  <beej@mindspring.net>
+
+       * gnus-group.el (gnus-group-line-format-alist): Added %E for
+       eyecandy.
+       (gnus-group-insert-group-line): Now groks %E and inserts icon in
+       group line using gnus-group-add-icon.
+       (gnus-group-icons): Added customize group.
+       (gnus-group-icon-list): Added variable.
+       (gnus-group-glyph-directory): Added variable.
+       (gnus-group-icon-cache): Added variable.
+       (gnus-group-running-xemacs): Added variable.
+       (gnus-group-add-icon): Added function. Add an icon to the current
+       line according to gnus-group-icon-list.
+       (gnus-group-icon-create-glyph): Added function.
+
 2000-01-05 17:31:52  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-sum.el (gnus-summary-select-article): Return whether we
index 755ba98..b41d06a 100644 (file)
 
 (require 'cl)
 
+(unless (featurep 'xemacs)
+  (define-compiler-macro last (&whole form x &optional n)
+    (if (and (fboundp 'last)
+            (subrp (symbol-function 'last)))
+       form
+      (if n
+         `(let* ((x ,x)
+                 (n ,n)
+                 (m 0)
+                 (p x))
+            (while (consp p)
+              (incf m)
+              (pop p))
+            (if (<= n 0)
+                p
+              (if (< n m)
+                  (nthcdr (- m n) x)
+                x)))
+       `(let ((x ,x))
+          (while (consp (cdr x))
+            (pop x))
+          x))))
+
+  (define-compiler-macro mapcon (&whole form fn seq &rest rest)
+    (if (and (fboundp 'mapcon)
+            (subrp (symbol-function 'mapcon)))
+       form
+      (if rest
+         `(let (res
+                (args (list ,seq ,@rest))
+                p)
+            (while (not (memq nil args))
+              (push (apply ,fn args) res)
+              (setq p args)
+              (while p
+                (setcar p (cdr (pop p)))
+                ))
+            (apply (function nconc) (nreverse res)))
+       `(let (res
+              (arg ,seq))
+          (while arg
+            (push (funcall ,fn arg) res)
+            (setq arg (cdr arg)))
+          (apply (function nconc) (nreverse res))))))
+
+  (define-compiler-macro member-if (&whole form pred list)
+    (if (and (fboundp 'member-if)
+            (subrp (symbol-function 'member-if)))
+       form
+      `(let ((fn ,pred)
+            (seq ,list))
+        (while (and seq
+                    (not (funcall fn (car seq))))
+          (pop seq))
+        seq)))
+
+  (define-compiler-macro union (&whole form list1 list2)
+    (if (and (fboundp 'union)
+            (subrp (symbol-function 'union)))
+       form
+      `(let ((a ,list1)
+            (b ,list2))
+        (cond ((null a) b)
+              ((null b) a)
+              ((equal a b) a)
+              (t
+               (or (>= (length a) (length b))
+                   (setq a (prog1 b (setq b a))))
+               (while b
+                 (or (memq (car b) a)
+                     (push (car b) a))
+                 (pop b))
+               a)))))
+  )
+
 ;; If we are building w3 in a different directory than the source
 ;; directory, we must read *.el from source directory and write *.elc
 ;; into the building directory.  For that, we define this function
index 7ae1354..7792c2f 100644 (file)
@@ -1308,8 +1308,8 @@ The following commands are available:
   (let ((info (assq category gnus-category-alist))
        (buffer-read-only nil))
     (gnus-delete-line)
-    (gnus-category-write)
-    (setq gnus-category-alist (delq info gnus-category-alist))))
+    (setq gnus-category-alist (delq info gnus-category-alist))
+    (gnus-category-write)))
 
 (defun gnus-category-copy (category to)
   "Copy the current category."
index 90a3cdb..3932f64 100644 (file)
@@ -4580,7 +4580,10 @@ For example:
        val elem)
     (gnus-run-hooks 'gnus-part-display-hook)
     (while (setq elem (pop alist))
-      (setq val (symbol-value (car elem)))
+      (setq val
+           (save-excursion
+             (set-buffer gnus-summary-buffer)
+             (symbol-value (car elem))))
       (when (and (or (consp val)
                     treated-type)
                 (gnus-treat-predicate val)
index f9e95f1..e4bb8c3 100644 (file)
@@ -161,6 +161,7 @@ with some simple extensions.
 %n    Select from where (string)
 %z    A string that look like `<%s:%n>' if a foreign select method is used
 %d    The date the group was last entered.
+%E    Icon as defined by `gnus-group-icon-list'.
 %u    User defined specifier.  The next character in the format string should
       be a letter.  Gnus will call the function gnus-user-format-function-X,
       where X is the letter following %u.  The function will be passed the
@@ -360,6 +361,45 @@ ticked: The number of ticked articles."
   :group 'gnus-group-visual
   :type 'character)
 
+(defgroup gnus-group-icons nil
+  "Add Icons to your group buffer.  "
+  :group 'gnus-group-visual)
+
+(defcustom gnus-group-icon-list
+  nil
+  "*Controls the insertion of icons into group buffer lines.
+
+Below is a list of `Form'/`File' pairs.  When deciding how a
+particular group line should be displayed, each form is evaluated.
+The icon from the file field after the first true form is used.  You
+can change how those group lines are displayed by editing the file
+field.  The File will either be found in the
+`gnus-group-glyph-directory' or by designating absolute path to the
+file.
+
+It is also possible to change and add form fields, but currently that
+requires an understanding of Lisp expressions.  Hopefully this will
+change in a future release.  For now, you can use the following
+variables in the Lisp expression:
+
+group: The name of the group.
+unread: The number of unread articles in the group.
+method: The select method used.
+mailp: Whether it's a mail group or not.
+newsp: Whether it's a news group or not
+level: The level of the group.
+score: The score of the group.
+ticked: The number of ticked articles."
+  :group 'gnus-group-icons
+  :type '(repeat (cons (sexp :tag "Form") file)))
+
+(defcustom gnus-group-glyph-directory gnus-xmas-glyph-directory
+  "*Directory where gnus group icons are located.
+Defaults to `gnus-xmas-glyph-directory'."
+  :group 'gnus-group-icons
+  :type 'directory)
+
+
 ;;; Internal variables
 
 (defvar gnus-group-sort-alist-function 'gnus-group-sort-flat
@@ -404,6 +444,7 @@ ticked: The number of ticked articles."
     (?s gnus-tmp-news-server ?s)
     (?n gnus-tmp-news-method ?s)
     (?P gnus-group-indentation ?s)
+    (?E gnus-tmp-group-icon ?s)
     (?l gnus-tmp-grouplens ?s)
     (?z gnus-tmp-news-method-string ?s)
     (?m (gnus-group-new-mail gnus-tmp-group) ?c)
@@ -426,6 +467,10 @@ ticked: The number of ticked articles."
 
 (defvar gnus-group-list-mode nil)
 
+
+(defvar gnus-group-icon-cache nil)
+(defvar gnus-group-running-xemacs (string-match "XEmacs" emacs-version))
+
 ;;;
 ;;; Gnus group mode
 ;;;
@@ -1067,6 +1112,7 @@ If REGEXP, only list groups matching REGEXP."
              ?m ? ))
         (gnus-tmp-moderated-string
          (if (eq gnus-tmp-moderated ?m) "(m)" ""))
+        (gnus-tmp-group-icon "==&&==")
         (gnus-tmp-method
          (gnus-server-get-method gnus-tmp-group gnus-tmp-method)) ;
         (gnus-tmp-news-server (or (cadr gnus-tmp-method) ""))
@@ -1102,13 +1148,84 @@ If REGEXP, only list groups matching REGEXP."
                  gnus-marked ,gnus-tmp-marked-mark
                  gnus-indentation ,gnus-group-indentation
                  gnus-level ,gnus-tmp-level))
-    (when (inline (gnus-visual-p 'group-highlight 'highlight))
       (forward-line -1)
+      (gnus-group-add-icon)
+    (when (inline (gnus-visual-p 'group-highlight 'highlight))
       (gnus-run-hooks 'gnus-group-update-hook)
       (forward-line))
     ;; Allow XEmacs to remove front-sticky text properties.
     (gnus-group-remove-excess-properties)))
 
+(defun gnus-group-add-icon ()
+  "Add an icon to the current line according to `gnus-group-icon-list'."
+  (let* ((p (point))
+        (end (progn (end-of-line) (point)))
+        ;; now find out where the line starts and leave point there.
+        (beg (progn (beginning-of-line) (point))))
+    (save-restriction
+      (narrow-to-region beg end)
+      (goto-char beg)
+      (when (search-forward "==&&==" nil t)
+       (let* ((group (gnus-group-group-name))
+              (entry (gnus-group-entry group))
+              (unread (if (numberp (car entry)) (car entry) 0))
+              (active (gnus-active group))
+              (total (if active (1+ (- (cdr active) (car active))) 0))
+              (info (nth 2 entry))
+              (method (gnus-server-get-method group (gnus-info-method info)))
+              (marked (gnus-info-marks info))
+              (mailp (memq 'mail (assoc (symbol-name
+                                         (car (or method gnus-select-method)))
+                                        gnus-valid-select-methods)))
+              (level (or (gnus-info-level info) gnus-level-killed))
+              (score (or (gnus-info-score info) 0))
+              (ticked (gnus-range-length (cdr (assq 'tick marked))))
+              (group-age (gnus-group-timestamp-delta group))
+              (inhibit-read-only t)
+              (list gnus-group-icon-list)
+              (mystart (match-beginning 0))
+              (myend (match-end 0)))
+         (goto-char (point-min))
+         (while (and list
+                     (not (eval (caar list))))
+           (setq list (cdr list)))
+         (if list
+             (let* ((file (cdar list))
+                    (glyph (gnus-group-icon-create-glyph
+                            (buffer-substring mystart myend)
+                            file)))
+               (if glyph
+                   (progn
+                     (mapcar 'delete-annotation (annotations-at myend))
+                     (let ((ext (make-extent mystart myend))
+                           (ant (make-annotation glyph myend 'text)))
+                       ;; set text extent params
+                       (set-extent-property ext 'end-open t)
+                       (set-extent-property ext 'start-open t)
+                       (set-extent-property ext 'invisible t)))
+                 (delete-region mystart myend)))
+           (delete-region mystart myend))))
+      (widen))
+    (goto-char p)))
+
+(defun gnus-group-icon-create-glyph (substring pixmap)
+  "Create a glyph for insertion into a group line."
+  (and
+   gnus-group-running-xemacs
+   (or
+    (cdr-safe (assoc pixmap gnus-group-icon-cache))
+    (let* ((glyph (make-glyph
+                  (list
+                   (cons 'x
+                         (expand-file-name pixmap gnus-group-glyph-directory))
+                   (cons 'mswindows
+                         (expand-file-name pixmap gnus-group-glyph-directory))
+                   (cons 'tty substring)))))
+      (setq gnus-group-icon-cache
+           (cons (cons pixmap glyph) gnus-group-icon-cache))
+      (set-glyph-face glyph 'default)
+      glyph))))
+
 (defun gnus-group-highlight-line ()
   "Highlight the current line according to `gnus-group-highlight'."
   (let* ((list gnus-group-highlight)
index 9f29c49..9e2f29f 100644 (file)
@@ -7331,7 +7331,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
             articles prefix))
       (set (intern (format "gnus-current-%s-group" action)) to-newsgroup))
     (setq to-method (or select-method
-                       (gnus-group-name-to-method to-newsgroup)))
+                       (gnus-group-method to-newsgroup)))
     ;; Check the method we are to move this article to...
     (unless (gnus-check-backend-function
             'request-accept-article (car to-method))
@@ -9036,14 +9036,15 @@ save those articles instead."
       (unless to-newsgroup
        (error "No group name entered"))
       (or (gnus-active to-newsgroup)
-         (gnus-activate-group to-newsgroup)
+         (gnus-activate-group to-newsgroup nil nil
+                              (gnus-group-method to-newsgroup))
          (if (gnus-y-or-n-p (format "No such group: %s.  Create it? "
                                     to-newsgroup))
              (or (and (gnus-request-create-group
-                       to-newsgroup (gnus-group-name-to-method to-newsgroup))
+                       to-newsgroup (gnus-group-method to-newsgroup))
                       (gnus-activate-group
                        to-newsgroup nil nil
-                       (gnus-group-name-to-method to-newsgroup))
+                       (gnus-group-method to-newsgroup))
                       (gnus-subscribe-group to-newsgroup))
                  (error "Couldn't create group %s" to-newsgroup)))
          (error "No such group: %s" to-newsgroup)))
index 56eb75c..6b9e39e 100644 (file)
@@ -672,6 +672,7 @@ this type is returned."
            (setq viewers (cdr viewers)))
          (setq passed (sort (nreverse passed) 'mailcap-viewer-lessp))
          (setq viewer (car passed))))
+      (setq passed (nreverse passed))
       (when (and (stringp (cdr (assq 'viewer viewer)))
                 passed)
        (setq viewer (car passed)))
@@ -713,6 +714,7 @@ this type is returned."
     (".cdf"      . "application/x-netcdr")
     (".cpio"     . "application/x-cpio")
     (".csh"      . "application/x-csh")
+    (".css"      . "text/css")
     (".dvi"      . "application/x-dvi")
     (".diff"     . "text/x-patch")
     (".el"       . "application/emacs-lisp")
index 26870b8..c8fda3d 100644 (file)
@@ -3245,7 +3245,10 @@ than 988 characters long, and if they are not, trim them until they are."
 
     ;; If folding is disallowed, make sure the total length (including
     ;; the spaces between) will be less than MAXSIZE characters.
-    (when message-cater-to-broken-inn
+    ;;
+    ;; Only disallow folding for News messages. At this point the headers
+    ;; have not been generated, thus we use message-this-is-news directly.
+    (when (and message-this-is-news message-cater-to-broken-inn)
       (let ((maxsize 988)
            (totalsize (+ (apply #'+ (mapcar #'length refs))
                          (1- count)))
@@ -3263,7 +3266,7 @@ than 988 characters long, and if they are not, trim them until they are."
     ;; Finally, collect the references back into a string and insert
     ;; it into the buffer.
     (let ((refstring (mapconcat #'identity refs " ")))
-      (if message-cater-to-broken-inn
+      (if (and message-this-is-news message-cater-to-broken-inn)
          (insert (capitalize (symbol-name header)) ": "
                  refstring "\n")
        (message-fill-header header refstring)))))
index e8bfebf..2dd333a 100644 (file)
@@ -266,7 +266,8 @@ Should be called narrowed to the head of the message."
         ((and (not break)
               (looking-at "=\\?"))
          (setq break (point)))
-        ((and (looking-at "\\?=")
+        ((and break
+              (looking-at "\\?=")
               (> (- (point) (save-excursion (beginning-of-line) (point))) 76))
          (goto-char break)
          (setq break nil)