annotate lisp/gnus-ems.el @ 17606:d8cd49a0529c

(set-variable): Check VALUE against type info if available. Don't evaluate VALUE. Use a separate history list for the values.
author Richard M. Stallman <rms@gnu.org>
date Wed, 30 Apr 1997 18:57:35 +0000
parents 530d0d516a42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1 ;;; gnus-ems.el --- functions for making Gnus work under different Emacsen
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
2 ;; Copyright (C) 1995,96 Free Software Foundation, Inc.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5 ;; Keywords: news
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12 ;; any later version.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17 ;; GNU General Public License for more details.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
18
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
22 ;; Boston, MA 02111-1307, USA.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
23
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
24 ;;; Commentary:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
25
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
26 ;;; Code:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
27
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
28 (eval-when-compile (require 'cl))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
29
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
30 (defvar gnus-mouse-2 [mouse-2])
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
31
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
32 (defalias 'gnus-make-overlay 'make-overlay)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
33 (defalias 'gnus-overlay-put 'overlay-put)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
34 (defalias 'gnus-move-overlay 'move-overlay)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
35 (defalias 'gnus-overlay-end 'overlay-end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
36 (defalias 'gnus-extent-detached-p 'ignore)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
37 (defalias 'gnus-extent-start-open 'ignore)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
38 (defalias 'gnus-set-text-properties 'set-text-properties)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
39 (defalias 'gnus-group-remove-excess-properties 'ignore)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
40 (defalias 'gnus-topic-remove-excess-properties 'ignore)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
41 (defalias 'gnus-appt-select-lowest-window 'appt-select-lowest-window)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
42 (defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
43 (defalias 'gnus-make-local-hook 'make-local-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
44 (defalias 'gnus-add-hook 'add-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
45 (defalias 'gnus-character-to-event 'identity)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
46 (defalias 'gnus-add-text-properties 'add-text-properties)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
47 (defalias 'gnus-put-text-property 'put-text-property)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
48 (defalias 'gnus-mode-line-buffer-identification 'identity)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
49
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
50
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
51 (eval-and-compile
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
52 (autoload 'gnus-xmas-define "gnus-xmas")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
53 (autoload 'gnus-xmas-redefine "gnus-xmas")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
54 (autoload 'appt-select-lowest-window "appt.el"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
55
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
56 (or (fboundp 'mail-file-babyl-p)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
57 (fset 'mail-file-babyl-p 'rmail-file-p))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
58
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
59 ;;; Mule functions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
60
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
61 (defun gnus-mule-cite-add-face (number prefix face)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
62 ;; At line NUMBER, ignore PREFIX and add FACE to the rest of the line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
63 (if face
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
64 (let ((inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
65 from to)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
66 (goto-line number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
67 (if (boundp 'MULE)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
68 (forward-char (chars-in-string prefix))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
69 (forward-char (length prefix)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
70 (skip-chars-forward " \t")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
71 (setq from (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
72 (end-of-line 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
73 (skip-chars-backward " \t")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
74 (setq to (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
75 (if (< from to)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
76 (gnus-overlay-put (gnus-make-overlay from to) 'face face)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
77
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
78 (defun gnus-mule-max-width-function (el max-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
79 (` (let* ((val (eval (, el)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
80 (valstr (if (numberp val)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
81 (int-to-string val) val)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
82 (if (> (length valstr) (, max-width))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
83 (truncate-string valstr (, max-width))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
84 valstr))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
85
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
86 (eval-and-compile
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
87 (if (string-match "XEmacs\\|Lucid" emacs-version)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
88 ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
89
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
90 (defvar gnus-mouse-face-prop 'mouse-face
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
91 "Property used for highlighting mouse regions.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
92
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
93 (defvar gnus-article-x-face-command
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
94 "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | xv -quit -"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
95 "String or function to be executed to display an X-Face header.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
96 If it is a string, the command will be executed in a sub-shell
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
97 asynchronously. The compressed face will be piped to this command.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
98
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
99 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
100 (defvar gnus-display-type
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
101 (condition-case nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
102 (let ((display-resource (x-get-resource ".displayType" "DisplayType")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
103 (cond (display-resource (intern (downcase display-resource)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
104 ((x-display-color-p) 'color)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
105 ((x-display-grayscale-p) 'grayscale)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
106 (t 'mono)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
107 (error 'mono))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
108 "A symbol indicating the display Emacs is running under.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
109 The symbol should be one of `color', `grayscale' or `mono'. If Emacs
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
110 guesses this display attribute wrongly, either set this variable in
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
111 your `~/.emacs' or set the resource `Emacs.displayType' in your
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
112 `~/.Xdefaults'. See also `gnus-background-mode'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
113
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
114 This is a meta-variable that will affect what default values other
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
115 variables get. You would normally not change this variable, but
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
116 pounce directly on the real variables themselves.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
117
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
118 (defvar gnus-background-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
119 (condition-case nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
120 (let ((bg-resource (x-get-resource ".backgroundMode"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
121 "BackgroundMode"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
122 (params (frame-parameters)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
123 (cond (bg-resource (intern (downcase bg-resource)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
124 ((and (cdr (assq 'background-color params))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
125 (< (apply '+ (x-color-values
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
126 (cdr (assq 'background-color params))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
127 (* (apply '+ (x-color-values "white")) .6)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
128 'dark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
129 (t 'light)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
130 (error 'light))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
131 "A symbol indicating the Emacs background brightness.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
132 The symbol should be one of `light' or `dark'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
133 If Emacs guesses this frame attribute wrongly, either set this variable in
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
134 your `~/.emacs' or set the resource `Emacs.backgroundMode' in your
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
135 `~/.Xdefaults'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
136 See also `gnus-display-type'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
137
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
138 This is a meta-variable that will affect what default values other
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
139 variables get. You would normally not change this variable, but
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
140 pounce directly on the real variables themselves."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
141
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
142 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
143 ((string-match "XEmacs\\|Lucid" emacs-version)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
144 (gnus-xmas-define))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
145
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
146 ((or (not (boundp 'emacs-minor-version))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
147 (< emacs-minor-version 30))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
148 ;; Remove the `intangible' prop.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
149 (let ((props (and (boundp 'gnus-hidden-properties)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
150 gnus-hidden-properties)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
151 (while (and props (not (eq (car (cdr props)) 'intangible)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
152 (setq props (cdr props)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
153 (and props (setcdr props (cdr (cdr (cdr props))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
154 (or (fboundp 'buffer-substring-no-properties)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
155 (defun buffer-substring-no-properties (beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
156 (format "%s" (buffer-substring beg end)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
157
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
158 ((boundp 'MULE)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
159 (provide 'gnusutil))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
160
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
161 (eval-and-compile
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
162 (cond
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
163 ((not window-system)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
164 (defun gnus-dummy-func (&rest args))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
165 (let ((funcs '(mouse-set-point set-face-foreground
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
166 set-face-background x-popup-menu)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
167 (while funcs
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
168 (or (fboundp (car funcs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
169 (fset (car funcs) 'gnus-dummy-func))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
170 (setq funcs (cdr funcs))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
171 (or (fboundp 'file-regular-p)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
172 (defun file-regular-p (file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
173 (and (not (file-directory-p file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
174 (not (file-symlink-p file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
175 (file-exists-p file))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
176 (or (fboundp 'face-list)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
177 (defun face-list (&rest args))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
178
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
179 (eval-and-compile
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
180 (let ((case-fold-search t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
181 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
182 ((string-match "windows-nt\\|os/2\\|emx" (format "%s" system-type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
183 (setq nnheader-file-name-translation-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
184 (append nnheader-file-name-translation-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
185 '((?: . ?_)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
186 (?+ . ?-))))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
187
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
188 (defvar gnus-tmp-unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
189 (defvar gnus-tmp-replied)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
190 (defvar gnus-tmp-score-char)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
191 (defvar gnus-tmp-indentation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
192 (defvar gnus-tmp-opening-bracket)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
193 (defvar gnus-tmp-lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
194 (defvar gnus-tmp-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
195 (defvar gnus-tmp-closing-bracket)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
196 (defvar gnus-tmp-subject-or-nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
197
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
198 (defun gnus-ems-redefine ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
199 (cond
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
200 ((string-match "XEmacs\\|Lucid" emacs-version)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
201 (gnus-xmas-redefine))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
202
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
203 ((boundp 'MULE)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
204 ;; Mule definitions
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
205 (defalias 'gnus-truncate-string 'truncate-string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
206
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
207 (fset 'gnus-summary-make-display-table (lambda () nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
208 (fset 'gnus-cite-add-face 'gnus-mule-cite-add-face)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
209 (fset 'gnus-max-width-function 'gnus-mule-max-width-function)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
210
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
211 (if (boundp 'gnus-check-before-posting)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
212 (setq gnus-check-before-posting
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
213 (delq 'long-lines
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
214 (delq 'control-chars gnus-check-before-posting))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
215
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
216 (defun gnus-summary-line-format-spec ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
217 (insert gnus-tmp-unread gnus-tmp-replied
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
218 gnus-tmp-score-char gnus-tmp-indentation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
219 (put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
220 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
221 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
222 (insert
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
223 gnus-tmp-opening-bracket
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
224 (format "%4d: %-20s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
225 gnus-tmp-lines
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
226 (if (> (length gnus-tmp-name) 20)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
227 (truncate-string gnus-tmp-name 20)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
228 gnus-tmp-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
229 gnus-tmp-closing-bracket)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
230 (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
231 gnus-mouse-face-prop gnus-mouse-face)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
232 (insert " " gnus-tmp-subject-or-nil "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
233 )))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15486
diff changeset
234
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
235
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
236 (provide 'gnus-ems)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
237
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
238 ;; Local Variables:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
239 ;; byte-compile-warnings: '(redefine callargs)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
240 ;; End:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
241
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
242 ;;; gnus-ems.el ends here