projects
/
gnus
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow using `gnus-parameters' while splitting mail
[gnus]
/
lisp
/
gnus-picon.el
diff --git
a/lisp/gnus-picon.el
b/lisp/gnus-picon.el
index
5d79018
..
83629df
100644
(file)
--- a/
lisp/gnus-picon.el
+++ b/
lisp/gnus-picon.el
@@
-1,27
+1,24
@@
;;; gnus-picon.el --- displaying pretty icons in Gnus
;;; gnus-picon.el --- displaying pretty icons in Gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1996-2014 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news xpm annotation glyph faces
;; This file is part of GNU Emacs.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news xpm annotation glyph faces
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software
;
you can redistribute it and/or modify
+;; GNU Emacs is free software
:
you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; 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.
+;; the Free Software Foundation
, either version 3 of the License, or
+;;
(at your option)
any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU Emacs 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
+;; 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
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Commentary:
@@
-40,6
+37,10
@@
;;
;;; Code:
;;
;;; Code:
+;; For Emacs <22.2 and XEmacs.
+(eval-and-compile
+ (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
+
(eval-when-compile (require 'cl))
(require 'gnus)
(eval-when-compile (require 'cl))
(require 'gnus)
@@
-74,6
+75,12
@@
Some people may want to add \"unknown\" to this list."
:type '(repeat string)
:group 'gnus-picon)
:type '(repeat string)
:group 'gnus-picon)
+(defcustom gnus-picon-properties '(:color-symbols (("None" . "white")))
+ "List of image properties applied to picons."
+ :type 'sexp
+ :version "24.3"
+ :group 'gnus-picon)
+
(defcustom gnus-picon-style 'inline
"How should picons be displayed.
If `inline', the textual representation is replaced. If `right', picons are
(defcustom gnus-picon-style 'inline
"How should picons be displayed.
If `inline', the textual representation is replaced. If `right', picons are
@@
-83,21
+90,15
@@
added right to the textual representation."
(const right))
:group 'gnus-picon)
(const right))
:group 'gnus-picon)
-(defface gnus-picon-xbm '((t (:foreground "black" :background "white")))
- "Face to show xbm picon in."
+(defcustom gnus-picon-inhibit-top-level-domains t
+ "If non-nil, don't piconify top-level domains.
+These are often not very interesting."
+ :version "24.1"
+ :type 'boolean
:group 'gnus-picon)
:group 'gnus-picon)
-;; backward-compatibility alias
-(put 'gnus-picon-xbm-face 'face-alias 'gnus-picon-xbm)
-
-(defface gnus-picon '((t (:foreground "black" :background "white")))
- "Face to show picon in."
- :group 'gnus-picon)
-;; backward-compatibility alias
-(put 'gnus-picon-face 'face-alias 'gnus-picon)
;;; Internal variables:
;;; Internal variables:
-(defvar gnus-picon-setup-p nil)
(defvar gnus-picon-glyph-alist nil
"Picon glyphs cache.
List of pairs (KEY . GLYPH) where KEY is either a filename or an URL.")
(defvar gnus-picon-glyph-alist nil
"Picon glyphs cache.
List of pairs (KEY . GLYPH) where KEY is either a filename or an URL.")
@@
-162,11
+163,15
@@
replacement is added."
(defun gnus-picon-create-glyph (file)
(or (cdr (assoc file gnus-picon-glyph-alist))
(defun gnus-picon-create-glyph (file)
(or (cdr (assoc file gnus-picon-glyph-alist))
- (cdar (push (cons file (gnus-create-image file))
+ (cdar (push (cons file (apply 'gnus-create-image
+ file nil nil
+ gnus-picon-properties))
gnus-picon-glyph-alist))))
;;; Functions that does picon transformations:
gnus-picon-glyph-alist))))
;;; Functions that does picon transformations:
+(declare-function image-size "image.c" (spec &optional pixels frame))
+
(defun gnus-picon-transform-address (header category)
(gnus-with-article-headers
(let ((addresses
(defun gnus-picon-transform-address (header category)
(gnus-with-article-headers
(let ((addresses
@@
-195,7
+200,9
@@
replacement is added."
(setcar spec (cons (gnus-picon-create-glyph file)
(car spec))))
(setcar spec (cons (gnus-picon-create-glyph file)
(car spec))))
- (dotimes (i (1- (length spec)))
+ (dotimes (i (- (length spec)
+ (if gnus-picon-inhibit-top-level-domains
+ 2 1)))
(when (setq file (gnus-picon-find-face
(concat "unknown@"
(mapconcat
(when (setq file (gnus-picon-find-face
(concat "unknown@"
(mapconcat
@@
-313,5
+320,4
@@
If picons are already displayed, remove them."
(provide 'gnus-picon)
(provide 'gnus-picon)
-;;; arch-tag: fe9aede0-1b1b-463a-b4ab-807f98bcb31f
;;; gnus-picon.el ends here
;;; gnus-picon.el ends here