diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2010-10-31 10:40:01 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2010-10-31 10:40:01 -0400 |
commit | 2699a55464f7b43171c7b0e64d095640904e9e21 (patch) | |
tree | d99ebc74b0a108dac964f0fbcd9f9d3592ac5c6f /lisp/play | |
parent | e6ef5dd9ce13d346c7bbdcd6794b29045b4e0e63 (diff) | |
parent | 46eadc7aeedf0fe3944291e2631d8604b38fe25f (diff) | |
download | emacs-2699a55464f7b43171c7b0e64d095640904e9e21.tar.gz |
Merge changes from emacs-23 branch
Diffstat (limited to 'lisp/play')
-rw-r--r-- | lisp/play/fortune.el | 43 | ||||
-rw-r--r-- | lisp/play/gomoku.el | 9 | ||||
-rw-r--r-- | lisp/play/landmark.el | 5 |
3 files changed, 24 insertions, 33 deletions
diff --git a/lisp/play/fortune.el b/lisp/play/fortune.el index 10bf05b2201..e7bd013b2ab 100644 --- a/lisp/play/fortune.el +++ b/lisp/play/fortune.el @@ -1,7 +1,7 @@ ;;; fortune.el --- use fortune to create signatures -;; Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, -;; 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Free Software Foundation, Inc. ;; Author: Holger Schauer <Holger.Schauer@gmx.de> ;; Keywords: games utils mail @@ -285,48 +285,41 @@ and choose the directory as the fortune-file." ;;; Display fortune (defun fortune-in-buffer (interactive &optional file) "Put a fortune cookie in the *fortune* buffer. - -INTERACTIVE is ignored. Optional argument FILE, -when supplied, specifies the file to choose the fortune from." +INTERACTIVE is ignored. Optional argument FILE, when supplied, +specifies the file to choose the fortune from." (let ((fortune-buffer (or (get-buffer fortune-buffer-name) (generate-new-buffer fortune-buffer-name))) (fort-file (expand-file-name (substitute-in-file-name (or file fortune-file))))) (with-current-buffer fortune-buffer - (toggle-read-only 0) - (erase-buffer) - - (if fortune-always-compile - (fortune-compile fort-file)) - - (apply 'call-process - fortune-program ; program to call - nil fortune-buffer nil ; INFILE BUFFER DISPLAY - (append (if (stringp fortune-program-options) - (split-string fortune-program-options) - fortune-program-options) (list fort-file)))))) + (let ((inhibit-read-only t)) + (erase-buffer) + (if fortune-always-compile + (fortune-compile fort-file)) + (apply 'call-process + fortune-program ; program to call + nil fortune-buffer nil ; INFILE BUFFER DISPLAY + (append (if (stringp fortune-program-options) + (split-string fortune-program-options) + fortune-program-options) (list fort-file))))))) ;;;###autoload (defun fortune (&optional file) "Display a fortune cookie. - If called with a prefix asks for the FILE to choose the fortune from, otherwise uses the value of `fortune-file'. If you want to have fortune choose from a set of files in a directory, call interactively with prefix and choose the directory as the fortune-file." - (interactive - (list - (if current-prefix-arg - (fortune-ask-file) - fortune-file))) + (interactive (list (if current-prefix-arg + (fortune-ask-file) + fortune-file))) (fortune-in-buffer t file) (switch-to-buffer (get-buffer fortune-buffer-name)) - (toggle-read-only 1)) + (setq buffer-read-only t)) ;;; Provide ourselves. (provide 'fortune) -;; arch-tag: a1e4cb8a-3792-40e7-86a7-fc75ce094bcc ;;; fortune.el ends here diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el index dbe3317a020..bb77c5a33ea 100644 --- a/lisp/play/gomoku.el +++ b/lisp/play/gomoku.el @@ -1,7 +1,7 @@ ;;; gomoku.el --- Gomoku game between you and Emacs -;; Copyright (C) 1988, 1994, 1996, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1988, 1994, 1996, 2001, 2002, 2003, 2004, 2005, 2006, +;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Philippe Schnoebelen <phs@lsv.ens-cachan.fr> ;; Maintainer: FSF @@ -195,8 +195,8 @@ Other useful commands:\n \\{gomoku-mode-map}" (gomoku-display-statistics) (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults '(gomoku-font-lock-keywords t)) - (toggle-read-only t)) + (setq font-lock-defaults '(gomoku-font-lock-keywords t) + buffer-read-only t)) ;;; ;;; THE BOARD. @@ -1206,5 +1206,4 @@ If the game is finished, this command requests for another game." (provide 'gomoku) -;; arch-tag: b1b8205e-77fc-4597-b373-3ea2c04311eb ;;; gomoku.el ends here diff --git a/lisp/play/landmark.el b/lisp/play/landmark.el index dd8c554f6f5..9cc73960f6b 100644 --- a/lisp/play/landmark.el +++ b/lisp/play/landmark.el @@ -255,8 +255,8 @@ is non-nil. One interesting value is `turn-on-font-lock'." (lm-display-statistics) (use-local-map lm-mode-map) (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults '(lm-font-lock-keywords t)) - (toggle-read-only t) + (setq font-lock-defaults '(lm-font-lock-keywords t) + buffer-read-only t) (run-mode-hooks 'lm-mode-hook)) @@ -1702,5 +1702,4 @@ Use \\[describe-mode] for more info." (provide 'landmark) -;; arch-tag: ae5031be-96e6-459e-a3df-1df53117d3f2 ;;; landmark.el ends here |