unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] * lisp/files.el (toggle-read-only): Mention in the doc-string that it's only for interactive use.
@ 2011-11-10 16:45 Eric Hanchrow
  2011-11-10 17:20 ` Glenn Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Hanchrow @ 2011-11-10 16:45 UTC (permalink / raw)
  To: emacs-devel

 lisp/ChangeLog              |    8 ++++++++
 lisp/emacs-lisp/bytecomp.el |    7 ++++---
 lisp/files.el               |    5 ++++-
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2b9edd0..fb01278 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2011-11-10  Eric Hanchrow  <eric.hanchrow@gmail.com>
+
+	* files.el (toggle-read-only): Mention in the doc-string that it's
+	only for interactive use.
+
+	* emacs-lisp/bytecomp.el
+	(byte-compile-interactive-only-functions): add toggle-read-only.
+
 2011-11-07  Stefan Monnier  <monnier@iro.umontreal.ca>

 	* files.el (find-file): Always use selected-window.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index fae402d..153bd93 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -353,9 +353,10 @@ else the global value will be modified."
                    (append byte-compile-warnings (list warning)))))))

 (defvar byte-compile-interactive-only-functions
-  '(beginning-of-buffer end-of-buffer replace-string replace-regexp
-    insert-file insert-buffer insert-file-literally previous-line next-line
-    goto-line comint-run delete-backward-char)
+  '(toggle-read-only beginning-of-buffer end-of-buffer
+  replace-string replace-regexp insert-file insert-buffer
+  insert-file-literally previous-line next-line goto-line
+  comint-run delete-backward-char)
   "List of commands that are not meant to be called from Lisp.")

 (defvar byte-compile-not-obsolete-vars nil
diff --git a/lisp/files.el b/lisp/files.el
index acff339..285a5cd 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4686,7 +4686,10 @@ prints a message in the minibuffer.  Instead,
use `set-buffer-modified-p'."
   "Change whether this buffer is read-only.
 With prefix argument ARG, make the buffer read-only if ARG is
 positive, otherwise make it writable.  If buffer is read-only
-and `view-read-only' is non-nil, enter view mode."
+and `view-read-only' is non-nil, enter view mode.
+
+Don't use this function in a Lisp program; use the variable
+`inhibit-read-only' instead."
   (interactive "P")
   (if (and arg
            (if (> (prefix-numeric-value arg) 0) buffer-read-only
-- 
1.7.7.rc0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] * lisp/files.el (toggle-read-only): Mention in the doc-string that it's only for interactive use.
  2011-11-10 16:45 [PATCH] * lisp/files.el (toggle-read-only): Mention in the doc-string that it's only for interactive use Eric Hanchrow
@ 2011-11-10 17:20 ` Glenn Morris
  0 siblings, 0 replies; 2+ messages in thread
From: Glenn Morris @ 2011-11-10 17:20 UTC (permalink / raw)
  To: Eric Hanchrow; +Cc: emacs-devel


Thanks, but I applied something similar to this yesterday.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-10 17:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-10 16:45 [PATCH] * lisp/files.el (toggle-read-only): Mention in the doc-string that it's only for interactive use Eric Hanchrow
2011-11-10 17:20 ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).