Mercurial > emacs
comparison lisp/play/fortune.el @ 98271:7aacb688e121
Remove leading `*' from defcustom docs.
(fortune-program-options): Doc fix. Allow to be a string again. Add :version.
(fortune-in-buffer): Handle fortune-program-options as a string.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 20 Sep 2008 21:09:27 +0000 |
parents | c4f6098c0914 |
children | 1943be2bc7c2 |
comparison
equal
deleted
inserted
replaced
98270:8bd02489da8d | 98271:7aacb688e121 |
---|---|
1 ;;; fortune.el --- use fortune to create signatures | 1 ;;; fortune.el --- use fortune to create signatures |
2 | 2 |
3 ;; Copyright (C) 1999, 2001, 2002, 2003, 2004, | 3 ;; Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | 4 ;; 2008 Free Software Foundation, Inc. |
5 | 5 |
6 ;; Author: Holger Schauer <Holger.Schauer@gmx.de> | 6 ;; Author: Holger Schauer <Holger.Schauer@gmx.de> |
7 ;; Keywords: games utils mail | 7 ;; Keywords: games utils mail |
8 | 8 |
9 ;; This file is part of GNU Emacs. | 9 ;; This file is part of GNU Emacs. |
68 "Settings for use of fortune for signatures." | 68 "Settings for use of fortune for signatures." |
69 :group 'fortune | 69 :group 'fortune |
70 :group 'mail) | 70 :group 'mail) |
71 | 71 |
72 (defcustom fortune-dir "~/docs/ascii/misc/fortunes/" | 72 (defcustom fortune-dir "~/docs/ascii/misc/fortunes/" |
73 "*The directory to look in for local fortune cookies files." | 73 "The directory to look in for local fortune cookies files." |
74 :type 'directory | 74 :type 'directory |
75 :group 'fortune) | 75 :group 'fortune) |
76 (defcustom fortune-file | 76 (defcustom fortune-file |
77 (expand-file-name "usenet" fortune-dir) | 77 (expand-file-name "usenet" fortune-dir) |
78 "*The file in which local fortune cookies will be stored." | 78 "The file in which local fortune cookies will be stored." |
79 :type 'file | 79 :type 'file |
80 :group 'fortune) | 80 :group 'fortune) |
81 (defcustom fortune-database-extension ".dat" | 81 (defcustom fortune-database-extension ".dat" |
82 "The extension of the corresponding fortune database. | 82 "The extension of the corresponding fortune database. |
83 Normally you won't have a reason to change it." | 83 Normally you won't have a reason to change it." |
86 (defcustom fortune-program "fortune" | 86 (defcustom fortune-program "fortune" |
87 "Program to select a fortune cookie." | 87 "Program to select a fortune cookie." |
88 :type 'string | 88 :type 'string |
89 :group 'fortune) | 89 :group 'fortune) |
90 (defcustom fortune-program-options () | 90 (defcustom fortune-program-options () |
91 "Options to pass to the fortune program." | 91 "List of options to pass to the fortune program." |
92 :type '(repeat string) | 92 :type '(choice (repeat (string :tag "Option")) |
93 (string :tag "Obsolete string of options")) | |
94 :version "23.1" | |
93 :group 'fortune) | 95 :group 'fortune) |
94 (defcustom fortune-strfile "strfile" | 96 (defcustom fortune-strfile "strfile" |
95 "Program to compute a new fortune database." | 97 "Program to compute a new fortune database." |
96 :type 'string | 98 :type 'string |
97 :group 'fortune) | 99 :group 'fortune) |
105 Set this to \"\" if you would like to see the output." | 107 Set this to \"\" if you would like to see the output." |
106 :type 'string | 108 :type 'string |
107 :group 'fortune) | 109 :group 'fortune) |
108 | 110 |
109 (defcustom fortune-always-compile t | 111 (defcustom fortune-always-compile t |
110 "*Non-nil means automatically compile fortune files. | 112 "Non-nil means automatically compile fortune files. |
111 If nil, you must invoke `fortune-compile' manually to do that." | 113 If nil, you must invoke `fortune-compile' manually to do that." |
112 :type 'boolean | 114 :type 'boolean |
113 :group 'fortune) | 115 :group 'fortune) |
114 (defcustom fortune-author-line-prefix " -- " | 116 (defcustom fortune-author-line-prefix " -- " |
115 "Prefix to put before the author name of a fortunate." | 117 "Prefix to put before the author name of a fortunate." |
123 "String to use to characterize that the fortune comes from an e-mail. | 125 "String to use to characterize that the fortune comes from an e-mail. |
124 No need to add an `in'." | 126 No need to add an `in'." |
125 :type 'string | 127 :type 'string |
126 :group 'fortune-signature) | 128 :group 'fortune-signature) |
127 (defcustom fortune-sigstart "" | 129 (defcustom fortune-sigstart "" |
128 "*Some text to insert before the fortune cookie, in a mail signature." | 130 "Some text to insert before the fortune cookie, in a mail signature." |
129 :type 'string | 131 :type 'string |
130 :group 'fortune-signature) | 132 :group 'fortune-signature) |
131 (defcustom fortune-sigend "" | 133 (defcustom fortune-sigend "" |
132 "*Some text to insert after the fortune cookie, in a mail signature." | 134 "Some text to insert after the fortune cookie, in a mail signature." |
133 :type 'string | 135 :type 'string |
134 :group 'fortune-signature) | 136 :group 'fortune-signature) |
135 | 137 |
136 | 138 |
137 ;; not customizable settings | 139 ;; not customizable settings |
298 | 300 |
299 (if fortune-always-compile | 301 (if fortune-always-compile |
300 (fortune-compile fort-file)) | 302 (fortune-compile fort-file)) |
301 | 303 |
302 (apply 'call-process | 304 (apply 'call-process |
303 fortune-program ;; program to call | 305 fortune-program ; program to call |
304 nil fortune-buffer nil ;; INFILE BUFFER DISPLAYP | 306 nil fortune-buffer nil ; INFILE BUFFER DISPLAY |
305 fort-file fortune-program-options)))) | 307 (append (if (stringp fortune-program-options) |
308 (split-string fortune-program-options) | |
309 fortune-program-options) (list fortune-file)))))) | |
306 | 310 |
307 ;;;###autoload | 311 ;;;###autoload |
308 (defun fortune (&optional file) | 312 (defun fortune (&optional file) |
309 "Display a fortune cookie. | 313 "Display a fortune cookie. |
310 | 314 |