summaryrefslogtreecommitdiff
path: root/lisp/play
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2010-10-29 00:48:10 -0700
committerGlenn Morris <rgm@gnu.org>2010-10-29 00:48:10 -0700
commitd2ce10d221f16a8e03a7c4363d9ad61984087ff0 (patch)
tree224e2767aab81eea4613fa4c11dbf5a38e681400 /lisp/play
parent97af9a72d0935af2907d83ba330c1040f4df98cf (diff)
downloademacs-d2ce10d221f16a8e03a7c4363d9ad61984087ff0.tar.gz
Replace some inappropriate uses of toggle-read-only. (Bug#7292)
* lisp/speedbar.el (speedbar-mode): * lisp/play/fortune.el (fortune-in-buffer, fortune): * lisp/play/gomoku.el (gomoku-mode): * lisp/play/landmark.el (lm-mode): * lisp/textmodes/bibtex.el (bibtex-validate, bibtex-validate-globally): * lisp/cedet/mode-local.el (mode-local-augment-function-help): * lisp/semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons): * lisp/semantic/symref/list.el (semantic-symref-results-dump) (semantic-symref-rb-toggle-expand-tag): Replace inappropriate uses of toggle-read-only.
Diffstat (limited to 'lisp/play')
-rw-r--r--lisp/play/fortune.el43
-rw-r--r--lisp/play/gomoku.el9
-rw-r--r--lisp/play/landmark.el5
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 e18d4bdc292..1b11388a0d7 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
@@ -201,8 +201,8 @@ is non-nil."
(gomoku-display-statistics)
(use-local-map gomoku-mode-map)
(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)
(run-mode-hooks 'gomoku-mode-hook))
;;;
@@ -1213,5 +1213,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 2c82e8cd420..0c8fa7c261e 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))
@@ -1700,5 +1700,4 @@ Use \\[describe-mode] for more info."
(provide 'landmark)
-;; arch-tag: ae5031be-96e6-459e-a3df-1df53117d3f2
;;; landmark.el ends here