aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2022-07-26 15:12:19 +0200
committerStefan Kangas2022-08-05 10:47:18 +0200
commitf3b9bccb45965d288f5e14448eacb2f2980a0bfa (patch)
tree0b3916fa957ace507432d571b606f664f8e8d737
parentf484da5fcba2c362ef4511db9d11f825bcea16e4 (diff)
downloademacs-f3b9bccb45965d288f5e14448eacb2f2980a0bfa.tar.gz
emacs-f3b9bccb45965d288f5e14448eacb2f2980a0bfa.zip
* lisp/play/fortune.el: Doc fixes.
-rw-r--r--lisp/play/fortune.el56
1 files changed, 33 insertions, 23 deletions
diff --git a/lisp/play/fortune.el b/lisp/play/fortune.el
index 3bc51f6d68e..d6360e50227 100644
--- a/lisp/play/fortune.el
+++ b/lisp/play/fortune.el
@@ -1,6 +1,6 @@
1;;; fortune.el --- use fortune to create signatures -*- lexical-binding: t -*- 1;;; fortune.el --- use fortune to create signatures -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1999, 2001-2022 Free Software Foundation, Inc. 3;; Copyright (C) 1999-2022 Free Software Foundation, Inc.
4 4
5;; Author: Holger Schauer <Holger.Schauer@gmx.de> 5;; Author: Holger Schauer <Holger.Schauer@gmx.de>
6;; Keywords: games utils mail 6;; Keywords: games utils mail
@@ -21,38 +21,48 @@
21;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. 21;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
22 22
23;;; Commentary: 23;;; Commentary:
24
24;; This utility allows you to automatically cut regions to a fortune 25;; This utility allows you to automatically cut regions to a fortune
25;; file. In case that the region stems from an article buffer (mail or 26;; file. In case that the region stems from an article buffer (mail or
26;; news), it will try to automatically determine the author of the 27;; news), it will try to automatically determine the author of the
27;; fortune. It will also allow you to compile your fortune-database 28;; fortune. It will also allow you to compile your fortune database
28;; as well as providing a function to extract a fortune for use as your 29;; as well as providing a function to extract a fortune for use as your
29;; signature. 30;; signature.
31;;
30;; Of course, it can simply display a fortune, too. 32;; Of course, it can simply display a fortune, too.
31;; Use prefix arguments to specify different fortune databases. 33;; Use prefix arguments to specify different fortune databases.
32 34;;
33;;; Installation: 35;;; Installation:
34 36;;
35;; Please check the customize settings -- you will at least have to 37;; Please type `M-x customize-group RET fortune RET' -- you will at
36;; modify the values of `fortune-dir' and `fortune-file'. 38;; least have to modify the user options `fortune-dir' and
37 39;; `fortune-file'.
40;;
38;; I then use this in my .gnus: 41;; I then use this in my .gnus:
39;;(message "Making new signature: %s" (fortune-to-signature "~/fortunes/")) 42;;
43;; (message "Making new signature: %s"
44;; (fortune-to-signature "~/fortunes/"))
45;;
40;; This automagically creates a new signature when starting up Gnus. 46;; This automagically creates a new signature when starting up Gnus.
41;; Note that the call to fortune-to-signature specifies a directory in which 47;; Note that the call to `fortune-to-signature' specifies a directory
42;; several fortune-files and their databases are stored. 48;; in which several fortune files and their databases are stored.
43 49;;
44;; If you like to get a new signature for every message, you can also hook 50;; To get a new signature for every message, you can hook it into
45;; it into message-mode: 51;; `message-mode':
46;; (add-hook 'message-setup-hook 'fortune-to-signature) 52;;
47;; This time no fortune-file is specified, so fortune-to-signature would use 53;; (add-hook 'message-setup-hook #'fortune-to-signature)
48;; the default-file as specified by fortune-file. 54;;
49 55;; This time no fortune file is specified, so `fortune-to-signature'
50;; I have also this in my .gnus: 56;; would use the default file as specified by `fortune-file'.
51;;(add-hook 'gnus-article-mode-hook 57;;
52;; (lambda () 58;; I also have this in my .gnus:
53;; (define-key gnus-article-mode-map "i" 'fortune-from-region))) 59;;
60;; (add-hook 'gnus-article-mode-hook
61;; (lambda ()
62;; (define-key gnus-article-mode-map "i" #'fortune-from-region)))
63;;
54;; which allows marking a region and then pressing "i" so that the marked 64;; which allows marking a region and then pressing "i" so that the marked
55;; region will be automatically added to my favorite fortune-file. 65;; region will be automatically added to my favorite fortune file.
56 66
57;;; Code: 67;;; Code:
58 68
@@ -166,7 +176,7 @@ If INTERACTIVE is non-nil, don't compile the fortune file afterwards."
166 (fortune-compile file))))) 176 (fortune-compile file)))))
167 177
168(defun fortune-ask-file () 178(defun fortune-ask-file ()
169 "Asks the user for a file-name." 179 "Asks the user for a file name."
170 (expand-file-name 180 (expand-file-name
171 (read-file-name 181 (read-file-name
172 "Fortune file to use: " 182 "Fortune file to use: "