unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Hanchrow <eric.hanchrow@gmail.com>
To: emacs-devel@gnu.org
Subject: [PATCH] * lisp/files.el (toggle-read-only): Mention in the doc-string that it's only for interactive use.
Date: Thu, 10 Nov 2011 08:45:05 -0800	[thread overview]
Message-ID: <CAHZoxq-Rbg2FBgPLPKNgidd8=4obTyCCJp4PHd3PtXUazamF_w@mail.gmail.com> (raw)

 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



             reply	other threads:[~2011-11-10 16:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-10 16:45 Eric Hanchrow [this message]
2011-11-10 17:20 ` [PATCH] * lisp/files.el (toggle-read-only): Mention in the doc-string that it's only for interactive use Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHZoxq-Rbg2FBgPLPKNgidd8=4obTyCCJp4PHd3PtXUazamF_w@mail.gmail.com' \
    --to=eric.hanchrow@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).