*** empty log message ***
[gnus] / lisp / gnus-vis.el
1 ;;; gnus-vis.el --- display-oriented parts of Gnus
2 ;; Copyright (C) 1995,96 Free Software Foundation, Inc.
3
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
5 ;;      Per Abrahamsen <abraham@iesd.auc.dk>
6 ;; Keywords: news
7
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Commentary:
26
27 ;;; Code:
28
29 (require 'gnus)
30 (require 'gnus-ems)
31 (require 'easymenu)
32 (require 'custom)
33 (require 'browse-url)
34 (require 'gnus-score)
35 (eval-when-compile (require 'cl))
36
37 (defvar gnus-group-menu-hook nil
38   "*Hook run after the creation of the group mode menu.")
39
40 (defvar gnus-summary-menu-hook nil
41   "*Hook run after the creation of the summary mode menu.")
42
43 (defvar gnus-article-menu-hook nil
44   "*Hook run after the creation of the article mode menu.")
45
46 ;;; Summary highlights.
47
48 ;(defvar gnus-summary-highlight-properties
49 ;  '((unread "ForestGreen" "green")
50 ;    (ticked "Firebrick" "pink")
51 ;    (read "black" "white")
52 ;    (low italic italic)
53 ;    (high bold bold)
54 ;    (canceled "yellow/black" "black/yellow")))
55
56 ;(defvar gnus-summary-highlight-translation
57 ;  '(((unread (= mark gnus-unread-mark))
58 ;     (ticked (or (= mark gnus-ticked-mark) (= mark gnus-dormant-mark)))
59 ;     (read (not (or (= mark gnus-unread-mark) (= mark gnus-dormant-mark)
60 ;                   (= mark gnus-ticked-mark) (= mark gnus-canceled-mark))))
61 ;     (canceled (= mark gnus-canceled-mark)))
62 ;    ((low (< score gnus-summary-default-score))
63 ;     (high (> score gnus-summary-default-score)))))
64
65 ;(defun gnus-visual-map-face-translation ()
66 ;  (let ((props gnus-summary-highlight-properties)
67 ;       (trans gnus-summary-highlight-translation)
68 ;       map)
69 ;    (while props)))
70       
71 ;see gnus-cus.el
72 ;(defvar gnus-summary-selected-face 'underline
73 ;  "*Face used for highlighting the current article in the summary buffer.")
74  
75 ;see gnus-cus.el
76 ;(defvar gnus-summary-highlight
77 ;  (cond ((not (eq gnus-display-type 'color))
78 ;        '(((> score default) . bold)
79 ;          ((< score default) . italic)))
80 ;       ((eq gnus-background-mode 'dark)
81 ;        (list (cons '(= mark gnus-canceled-mark)
82 ;                    (custom-face-lookup "yellow" "black" nil nil nil nil))
83 ;              (cons '(and (> score default) 
84 ;                          (or (= mark gnus-dormant-mark)
85 ;                              (= mark gnus-ticked-mark)))
86 ;                    (custom-face-lookup "pink" nil nil t nil nil))
87 ;              (cons '(and (< score default) 
88 ;                          (or (= mark gnus-dormant-mark)
89 ;                              (= mark gnus-ticked-mark)))
90 ;                    (custom-face-lookup "pink" nil nil nil t nil))
91 ;              (cons '(or (= mark gnus-dormant-mark)
92 ;                         (= mark gnus-ticked-mark))
93 ;                    (custom-face-lookup "pink" nil nil nil nil nil))
94
95 ;              (cons '(and (> score default) (= mark gnus-ancient-mark))
96 ;                    (custom-face-lookup "SkyBlue" nil nil t nil nil))
97 ;              (cons '(and (< score default) (= mark gnus-ancient-mark))
98 ;                    (custom-face-lookup "SkyBlue" nil nil nil t nil))
99 ;              (cons '(= mark gnus-ancient-mark)
100 ;                    (custom-face-lookup "SkyBlue" nil nil nil nil nil))
101
102 ;              (cons '(and (> score default) (= mark gnus-unread-mark))
103 ;                    (custom-face-lookup "white" nil nil t nil nil))
104 ;              (cons '(and (< score default) (= mark gnus-unread-mark))
105 ;                    (custom-face-lookup "white" nil nil nil t nil))
106 ;              (cons '(= mark gnus-unread-mark)
107 ;                    (custom-face-lookup "white" nil nil nil nil nil))
108
109 ;              (cons '(> score default) 'bold)
110 ;              (cons '(< score default) 'italic)))
111 ;       (t
112 ;        (list (cons '(= mark gnus-canceled-mark)
113 ;                    (custom-face-lookup "yellow" "black" nil nil nil nil))
114 ;              (cons '(and (> score default) 
115 ;                          (or (= mark gnus-dormant-mark)
116 ;                              (= mark gnus-ticked-mark)))
117 ;                    (custom-face-lookup "firebrick" nil nil t nil nil))
118 ;              (cons '(and (< score default) 
119 ;                          (or (= mark gnus-dormant-mark)
120 ;                              (= mark gnus-ticked-mark)))
121 ;                    (custom-face-lookup "firebrick" nil nil nil t nil))
122 ;              (cons '(or (= mark gnus-dormant-mark)
123 ;                         (= mark gnus-ticked-mark))
124 ;                    (custom-face-lookup "firebrick" nil nil nil nil nil))
125
126 ;              (cons '(and (> score default) (= mark gnus-ancient-mark))
127 ;                    (custom-face-lookup "RoyalBlue" nil nil t nil nil))
128 ;              (cons '(and (< score default) (= mark gnus-ancient-mark))
129 ;                    (custom-face-lookup "RoyalBlue" nil nil nil t nil))
130 ;              (cons '(= mark gnus-ancient-mark)
131 ;                    (custom-face-lookup "RoyalBlue" nil nil nil nil nil))
132
133 ;              (cons '(and (> score default) (/= mark gnus-unread-mark))
134 ;                    (custom-face-lookup "DarkGreen" nil nil t nil nil))
135 ;              (cons '(and (< score default) (/= mark gnus-unread-mark))
136 ;                    (custom-face-lookup "DarkGreen" nil nil nil t nil))
137 ;              (cons '(/= mark gnus-unread-mark)
138 ;                    (custom-face-lookup "DarkGreen" nil nil nil nil nil))
139
140 ;              (cons '(> score default) 'bold)
141 ;              (cons '(< score default) 'italic))))
142 ;  "*Alist of `(FORM . FACE)'.
143 ;Summary lines are highlighted with the FACE for the first FORM which
144 ;evaluate to a non-nil value.  
145
146 ;Point will be at the beginning of the line when FORM is evaluated.
147 ;The following can be used for convenience:
148
149 ;score:   (gnus-summary-article-score)
150 ;default: gnus-summary-default-score
151 ;below:   gnus-summary-mark-below
152 ;mark:    (gnus-summary-article-mark)
153
154 ;The latter can be used like this:
155 ;   ((= mark gnus-replied-mark) . underline)")
156
157 ;;; article highlights
158