+2006-03-02 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gnus-art.el (gnus-article-browse-html-temp-list): Rename from
+ gnus-article-browse-html-temp.
+ (gnus-article-browse-delete-temp): Make it customizable. Add
+ `file'. Adjust doc string.
+ (gnus-article-browse-delete-temp-files): Add argument. Allow
+ query for each file. Adjust doc string.
+ (gnus-article-browse-html-parts): Add
+ `gnus-article-browse-delete-temp-files' to
+ `gnus-summary-prepare-exit-hook' and `gnus-exit-gnus-hook'.
+
+2006-03-02 Hynek Schlawack <hynek@ularx.de>
+
+ * gnus-art.el (gnus-article-browse-html-temp)
+ (gnus-article-browse-delete-temp): New variables.
+ (gnus-article-browse-delete-temp-files): New function.
+ (gnus-article-browse-html-parts): Use it.
+
+2006-03-02 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gnus-group.el (gnus-group-redraw-check): Remove redundant tests.
+
+ * gmm-utils.el (gmm-image-load-path): Mention ../etc search in doc
+ string.
+
+ * gnus-sum.el (gnus-summary-tool-bar-gnome): Don't use
+ gnus-summary-insert-new-articles when unplugged. Remove
+ gnus-summary-search-article-forward.
+
+ * gmm-utils.el (gmm-tool-bar-style): Test tool-bar-mode and
+ display-visual-class instead of display-color-cells.
+
2006-03-02 Katsumi Yamaoka <yamaoka@jpl.org>
* dgnushack.el: Autoload customize-group for XEmacs.
:tag "Other"
(symbol :tag "Icon item")))))
-(defcustom gmm-tool-bar-style (if (> (display-color-cells) 256)
- 'gnome
- 'retro)
+;; (defun gmm-color-cells (&optional display)
+;; "Return the number of color cells supported by DISPLAY.
+;; Compatibility function."
+;; ;; `display-color-cells' doesn't return more than 256 even if color depth is
+;; ;; > 8 in Emacs 21.
+;; ;;
+;; ;; Feel free to add proper XEmacs support.
+;; (let* ((cells (and (fboundp 'display-color-cells)
+;; (display-color-cells display)))
+;; (plane (and (fboundp 'x-display-planes)
+;; (ash 1 (x-display-planes))))
+;; (none -1))
+;; (max (if (integerp cells) cells none)
+;; (if (integerp plane) plane none))))
+
+(defcustom gmm-tool-bar-style
+ (if (and (boundp 'tool-bar-mode)
+ tool-bar-mode
+ (and (fboundp 'display-visual-class)
+ (not (memq (display-visual-class)
+ (list 'static-gray 'gray-scale
+ 'static-color 'pseudo-color)))))
+ 'gnome
+ 'retro)
"Prefered tool bar style."
:type '(choice (const :tag "GNOME style" 'gnome)
(const :tag "Retro look" 'retro))
(defun gmm-image-load-path (library image &optional path)
"Return a suitable search path for images of LIBRARY.
-Images for LIBRARY are found in \"../../etc/images\" relative to
-the files in \"lisp/LIBRARY\", in `image-load-path', or in
-`load-path'.
+Images for LIBRARY are searched for in \"../../etc/images\" and
+\"../etc/images\" relative to the files in \"lisp/LIBRARY\", in
+`image-load-path', or in `load-path'.
This function returns value of `load-path' augmented with the
path to IMAGE. If PATH is given, it is used instead of
(delete gmm-image-directory
(copy-sequence load-path))))))
-
(defun gmm-customize-mode (&optional mode)
"Customize customization group for MODE.
If mode is nil, use `major-mode' of the curent buffer."
"-I" (symbol-name charset) "-O" (symbol-name charset))))
(mm-inline-wash-with-stdin nil "w3m" "-dump" "-T" "text/html")))
+(defvar gnus-article-browse-html-temp-list nil
+ "List of temporary files created by `gnus-article-browse-html-parts'.
+Internal variable.")
+
+(defcustom gnus-article-browse-delete-temp 'ask
+ "What to do with temporary files from `gnus-article-browse-html-parts'.
+If nil, don't delete temporary files. If it is t, delete them on
+exit from the summary buffer. If it is the symbol `file', query
+on each file, if it is `ask' ask once when exiting from the
+summary buffer."
+ :group 'gnus-article
+ :type '(choice (const :tag "Don't delete" nil)
+ (const :tag "Don't ask" t)
+ (const :tag "Ask" ask)
+ (const :tag "Ask for each file" file)))
+
+(defun gnus-article-browse-delete-temp-files (&optional how)
+ "Delete temp-files created by `gnus-article-browse-html-parts'."
+ (unless how
+ (setq how gnus-article-browse-delete-temp))
+ (when (and gnus-article-browse-html-temp-list how)
+ (when (and (eq how 'ask)
+ (y-or-n-p (format
+ "Delete all %s temporary HTML file(s)? "
+ (length gnus-article-browse-html-temp-list)))
+ (setq how t)))
+ (dolist (file gnus-article-browse-html-temp-list)
+ (when (and (file-exists-p file)
+ (or (eq how t)
+ ;; `how' is neither `nil', `ask' nor `t' (i.e. `file'):
+ (gnus-y-or-n-p
+ (format "Delete temporary HTML file `%s'? " file))))
+ (delete-file file))
+ ;; Also remove file from the list when not deleted or if file doesn't
+ ;; exist anymore.
+ (setq gnus-article-browse-html-temp-list
+ (delete file gnus-article-browse-html-temp-list))))
+ gnus-article-browse-html-temp-list)
+
(defun gnus-article-browse-html-parts (list)
"View all \"text/html\" parts from LIST.
Recurse into multiparts."
;; Do we need to care for 8.3 filenames?
"mm-" nil ".html")))
(mm-save-part-to-file handle tmp-file)
+ (add-to-list 'gnus-article-browse-html-temp-list tmp-file)
+ (add-hook 'gnus-summary-prepare-exit-hook
+ 'gnus-article-browse-delete-temp-files)
+ (add-hook 'gnus-exit-gnus-hook
+ (lambda ()
+ (gnus-article-browse-delete-temp-files t)))
(browse-url tmp-file)
(setq showed t)))
;; If multipart, recurse
(gnus-article-browse-html-parts handle))))))))
showed))
-;; TODO: Key binding; Remove temp files.
+;; TODO: Key binding
(defun gnus-article-browse-html-article ()
"View \"text/html\" parts of the current article with a WWW browser."
(interactive)
(defvar gnus-group-tool-bar-map nil)
-;; Work around for Emacs not updating the tool bar, see
+;; Work around for Emacs not updating the tool bar automatically, see
; http://www.google.com/groups?as_umsgid=v9u0an3hti.fsf@marauder.physik.uni-ulm.de
+;; Don't make this customizable yet.
(defvar gnus-group-redraw-when-idle 2
"When non-nil, redraw the Group buffer frame when idle.
Internal variable.")
-;; Don't make this customizable yet.
(defun gnus-group-redraw-check ()
"Check if we need to redraw the frame."
- (when (and gnus-group-redraw-when-idle
- (not (featurep 'xemacs))
- (boundp 'tool-bar-mode)
- tool-bar-mode)
- ;;(run-with-idle-timer gnus-group-redraw-when-idle
- ;; nil 'redraw-frame (selected-frame))
+ (when gnus-group-redraw-when-idle
(run-with-idle-timer gnus-group-redraw-when-idle
- nil 'force-window-update)
- t))
+ nil 'force-window-update)))
(defun gnus-group-tool-bar-update (&optional symbol value)
"Update group buffer toolbar.
(defcustom gnus-summary-tool-bar-gnome
'((gnus-summary-post-news "mail/compose" nil)
- (gnus-summary-insert-new-articles "mail/inbox")
- ;;
+ (gnus-summary-insert-new-articles "mail/inbox" nil
+ :visible (or (not gnus-agent)
+ gnus-plugged))
(gnus-summary-reply-with-original "mail/reply")
(gnus-summary-reply "mail/reply" nil :visible nil)
(gnus-summary-followup-with-original "mail/reply-all")
(gnus-summary-followup "mail/reply-all" nil :visible nil)
(gnus-summary-mail-forward "mail/forward")
(gnus-summary-save-article "mail/save")
- (gnus-summary-search-article-forward "search")
+ (gnus-summary-search-article-forward "search" nil :visible nil)
(gnus-summary-print-article "print")
(gnus-summary-tick-article-forward "flag-followup" nil :visible nil)
;; Some new commands that may need more suitable icons: