Add hooks for gcc handling
[gnus] / lisp / gnus-art.el
index 0abc802..32399e1 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gnus-art.el --- article mode commands for Gnus
 
-;; Copyright (C) 1996-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2012 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -268,11 +268,14 @@ This can also be a list of the above values."
       (if (or (gnus-image-type-available-p 'xface)
              (gnus-image-type-available-p 'pbm))
          'gnus-display-x-face-in-from
-       "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | ee -")
+       "{ echo \
+'/* Format_version=1, Width=48, Height=48, Depth=1, Valid_bits_per_item=16 */'\
+; uncompface; } | icontopbm | ee -")
     (if (gnus-image-type-available-p 'pbm)
        'gnus-display-x-face-in-from
-      "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | \
-display -"))
+      "{ echo \
+'/* Format_version=1, Width=48, Height=48, Depth=1, Valid_bits_per_item=16 */'\
+; uncompface; } | icontopbm | display -"))
   "*String or function to be executed to display an X-Face header.
 If it is a string, the command will be executed in a sub-shell
 asynchronously.  The compressed face will be piped to this command."
@@ -666,7 +669,7 @@ non-nil.
 If the match is a string, it is used as a regexp match on the
 article.  If the match is a symbol, that symbol will be funcalled
 from the buffer of the article to be saved with the newsgroup as the
-parameter.  If it is a list, it will be evaled in the same buffer.
+parameter.  If it is a list, it will be evalled in the same buffer.
 
 If this form or function returns a string, this string will be used as a
 possible file name; and if it returns a non-nil list, that list will be
@@ -2782,10 +2785,11 @@ summary buffer."
               (or how (setq how gnus-article-browse-delete-temp))
               (if (eq how 'ask)
                   (let ((files (length gnus-article-browse-html-temp-list)))
-                    (gnus-y-or-n-p (format
-                                    "Delete all %s temporary HTML file%s? "
-                                    files
-                                    (if (> files 1) "s" ""))))
+                    (gnus-y-or-n-p
+                     (if (= files 1)
+                         "Delete the temporary HTML file? "
+                       (format "Delete all %s temporary HTML files? "
+                               files))))
                 how)))
     (dolist (file gnus-article-browse-html-temp-list)
       (cond ((file-directory-p file)
@@ -2879,6 +2883,14 @@ message header will be added to the bodies of the \"text/html\" parts."
                                (with-current-buffer gnus-article-buffer
                                  gnus-article-mime-handles)
                                cid-dir))
+                    (when (eq system-type 'cygwin)
+                      (setq cid-file
+                            (concat "/" (substring
+                                         (with-output-to-string
+                                           (call-process "cygpath" nil
+                                                         standard-output
+                                                         nil "-m" cid-file))
+                                         0 -1))))
                     (replace-match (concat "file://" cid-file)
                                    nil nil nil 1))))
               (unless content (setq content (buffer-string))))
@@ -3228,9 +3240,16 @@ always hide."
 Point is left at the beginning of the narrowed-to region."
   (narrow-to-region
    (goto-char (point-min))
-   (if (search-forward "\n\n" nil 1)
-       (1- (point))
-     (point-max)))
+   (cond
+    ;; Absolutely no headers displayed.
+    ((looking-at "\n")
+     (point))
+    ;; Normal headers.
+    ((search-forward "\n\n" nil 1)
+     (1- (point)))
+    ;; Nothing but headers.
+    (t
+     (point-max))))
   (goto-char (point-min)))
 
 (defun article-goto-body ()
@@ -4563,6 +4582,10 @@ commands:
     (when (eq (elt timer 5) 'image-animate-timeout)
       (cancel-timer timer))))
 
+(defun gnus-stop-downloads ()
+  (when (boundp 'url-queue)
+    (set (intern "url-queue" obarray) nil)))
+
 ;; Set article window start at LINE, where LINE is the number of lines
 ;; from the head of the article.
 (defun gnus-article-set-window-start (&optional line)
@@ -5304,9 +5327,8 @@ Compressed files like .gz and .bz2 are decompressed."
                (or (cdr (assq arg
                               gnus-summary-show-article-charset-alist))
                    (mm-read-coding-system "Charset: "))))
-        (t
-         (if (mm-handle-undisplayer handle)
-             (mm-remove-part handle))))
+        ((mm-handle-undisplayer handle)
+         (mm-remove-part handle)))
        (forward-line 2)
         (mm-display-inline handle)
        (goto-char b)))))
@@ -6175,12 +6197,13 @@ Provided for backwards compatibility."
             (not gnus-inhibit-hiding))
     (gnus-article-hide-headers)))
 
-(declare-function shr-put-image "shr" (data alt))
+(declare-function shr-put-image "shr" (data alt &optional flags))
 
-(defun gnus-shr-put-image (data alt)
+(defun gnus-shr-put-image (data alt &optional flags)
   "Put image DATA with a string ALT.  Enable image to be deleted."
   (let ((image (shr-put-image data (propertize (or alt "*")
-                                              'gnus-image-category 'shr))))
+                                              'gnus-image-category 'shr)
+                             flags)))
     (when image
       (gnus-add-image 'shr image))))