• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/play/

Lines Matching +defs:mail +defs:signature +defs:file

7 ;; Keywords: games utils mail
9 ;; This file is part of GNU Emacs.
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
28 ;; file. In case that the region stems from an article buffer (mail or
32 ;; signature.
39 ;; modify the values of `fortune-dir' and `fortune-file'.
42 ;;(message "Making new signature: %s" (fortune-to-signature "~/fortunes/"))
43 ;; This automagically creates a new signature when starting up Gnus.
44 ;; Note that the call to fortune-to-signature specifies a directory in which
47 ;; If you like to get a new signature for every message, you can also hook
49 ;; (add-hook 'message-setup-hook 'fortune-to-signature)
50 ;; This time no fortune-file is specified, so fortune-to-signature would use
51 ;; the default-file as specified by fortune-file.
58 ;; region will be automatically added to my favourite fortune-file.
69 (defgroup fortune-signature nil
72 :group 'mail)
78 (defcustom fortune-file
79 (expand-file-name "usenet" fortune-dir)
80 "*The file in which local fortune cookies will be stored."
81 :type 'file
119 :group 'fortune-signature)
123 :group 'fortune-signature)
124 (defcustom fortune-from-mail "private e-mail"
125 "String to use to characterize that the fortune comes from an e-mail.
128 :group 'fortune-signature)
130 "*Some text to insert before the fortune cookie, in a mail signature."
132 :group 'fortune-signature)
134 "*Some text to insert after the fortune cookie, in a mail signature."
136 :group 'fortune-signature)
146 (defun fortune-append (string &optional interactive file)
149 If INTERACTIVE is non-nil, don't compile the fortune file afterwards."
150 (setq file (expand-file-name
151 (substitute-in-file-name (or file fortune-file))))
152 (if (file-directory-p file)
153 (error "Cannot append fortune to directory %s" file))
154 (if interactive ; switch to file and return buffer
155 (find-file-other-frame file)
156 (find-file-noselect file))
157 (let ((fortune-buffer (get-file-buffer file)))
168 (fortune-compile file)))))
170 (defun fortune-ask-file ()
171 "Asks the user for a file-name."
172 (expand-file-name
173 (read-file-name
174 "Fortune file to use: "
178 (defun fortune-add-fortune (string file)
179 "Add STRING to a fortune file FILE.
182 read the file name to use. Otherwise use the value of `fortune-file'."
185 (if current-prefix-arg (fortune-ask-file))))
186 (fortune-append string t file))
189 (defun fortune-from-region (beg end file)
190 "Append the current region to a local fortune-like data file.
193 read the file name to use. Otherwise use the value of `fortune-file'."
196 (if current-prefix-arg (fortune-ask-file))))
221 fortune-from-mail
224 ;; append entry to end of fortune file, and display result
229 (fortune-append string t file)))
235 (defun fortune-compile (&optional file)
236 "Compile fortune file.
239 the value of `fortune-file'. This currently cannot handle directories."
243 (fortune-ask-file)
244 fortune-file)))
245 (let* ((fortune-file (expand-file-name (substitute-in-file-name file)))
246 (fortune-dat (expand-file-name
247 (substitute-in-file-name
248 (concat fortune-file fortune-database-extension)))))
249 (cond ((file-exists-p fortune-file)
250 (if (file-exists-p fortune-dat)
251 (cond ((file-newer-than-file-p fortune-file fortune-dat)
255 " " fortune-file fortune-quiet-strfile-options))))))
256 (t (error "Can't compile fortune file %s" fortune-file)))))
260 ;;; Use fortune for signature
262 (defun fortune-to-signature (&optional file)
263 "Create signature from output of the fortune program.
266 otherwise uses the value of `fortune-file'. If you want to have fortune
268 and choose the directory as the fortune-file."
272 (fortune-ask-file)
273 fortune-file)))
275 (fortune-in-buffer t file)
278 (signature (concat fortune-sigstart fortune fortune-sigend)))
279 (setq mail-signature signature)
280 (if (boundp 'message-signature)
281 (setq message-signature signature)))))
286 (defun fortune-in-buffer (interactive &optional file)
290 when supplied, specifies the file to choose the fortune from."
293 (fort-file (expand-file-name
294 (substitute-in-file-name
295 (or file fortune-file)))))
302 (fortune-compile fort-file))
307 (concat fortune-program-options fort-file)))))
311 (defun fortune (&optional file)
315 otherwise uses the value of `fortune-file'. If you want to have fortune
317 and choose the directory as the fortune-file."
321 (fortune-ask-file)
322 fortune-file)))
323 (fortune-in-buffer t file)