unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#11127: 24.0.94; [PATCH] Tutorial breaks with modified key bindings
@ 2012-03-29 18:49 Aaron S. Hawley
  2012-03-29 20:17 ` Glenn Morris
  0 siblings, 1 reply; 12+ messages in thread
From: Aaron S. Hawley @ 2012-03-29 18:49 UTC (permalink / raw)
  To: 11127

2012-03-29  Aaron S. Hawley  <aaron.s.hawley@gmail.com>

        * tutorial.el (help-with-tutorial, tutorial--display-changes): If
        user has modified default key bindings then Emacs complains
        "Buffer is read-only: #<buffer TUTORIAL>" rather than adding the
        notice about "the most important standard Emacs commands".

--- tutorial.el	2012-02-13 11:13:25.000000000 -0500
+++ tutorial.el	2012-03-29 14:25:01.667926700 -0400
@@ -538,7 +538,8 @@
 If some of the default key bindings that the tutorial depends on
 have been changed then display the changes in the tutorial buffer
 with some explanatory links."
-  (let* ((changed-keys (tutorial--find-changed-keys
+  (let* ((inhibit-read-only t)
+         (changed-keys (tutorial--find-changed-keys
 			tutorial--default-keys))
 	 ;; Alist of element (DESC . CK) where DESC is the
 	 ;; key-description of a changed key and CK is the
@@ -828,7 +829,7 @@
           (setq old-tut-file
                 (y-or-n-p "Resume your last saved tutorial? ")))
         (if old-tut-file
-            (progn
+            (let ((inhibit-read-only t))
               (insert-file-contents (tutorial--saved-file))
 	      (let ((enable-local-variables :safe))
 		(hack-local-variables))
@@ -846,7 +847,8 @@
               (delete-region (point-min) (point))
               (goto-char tutorial--point-before-chkeys)
               (setq tutorial--point-before-chkeys (point-marker)))
-          (insert-file-contents (expand-file-name filename tutorial-directory))
+          (let ((inhibit-read-only t))
+            (insert-file-contents (expand-file-name filename
tutorial-directory)))
 	  (let ((enable-local-variables :safe))
 	    (hack-local-variables))
           (forward-line)
@@ -871,12 +873,14 @@
           ;; Delete the arch-tag line, so as not to confuse readers.
           (goto-char (point-max))
           (if (search-backward ";;; arch-tag: " nil t)
-              (delete-region (point) (point-max)))
+              (let ((inhibit-read-only t))
+                (delete-region (point) (point-max))))
           (goto-char (point-min))
           (search-forward "\n<<")
           (beginning-of-line)
           ;; Convert the <<...>> line to the proper [...] line,
           ;; or just delete the <<...>> line if a [...] line follows.
+          (let ((inhibit-read-only t))
           (cond ((save-excursion
                    (forward-line 1)
                    (looking-at "\\["))
@@ -887,18 +891,19 @@
                  (looking-at "<<")
                  (replace-match "[")
                  (search-forward ">>")
-                 (replace-match "]")))
+                 (replace-match "]"))))
           (beginning-of-line)
           ;; FIXME: if the window is not tall, and especially if the
           ;; big red "NOTICE: The main purpose..." text has been
           ;; inserted at the start of the buffer, the "type C-v to
           ;; move to the next screen" might not be visible on the
           ;; first screen (n < 0).  How will the novice know what to do?
-          (let ((n (- (window-height (selected-window))
+          (let ((inhibit-read-only t)
+                (n (- (window-height (selected-window))
                       (count-lines (point-min) (point))
                       6)))
             (if (< n 8)
-                (progn
+                (let ((inhibit-read-only t))
                   ;; For a short gap, we don't need the [...] line,
                   ;; so delete it.
                   (delete-region (point) (progn (end-of-line) (point)))

Thanks for Emacs,
aaron

-- 
In general, we reserve the right to have a poor
memory--the computer, however, is supposed to
remember!  Poor computer.  -- Guy Lewis Steele Jr.





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

end of thread, other threads:[~2013-02-11  1:52 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-29 18:49 bug#11127: 24.0.94; [PATCH] Tutorial breaks with modified key bindings Aaron S. Hawley
2012-03-29 20:17 ` Glenn Morris
2012-03-29 21:31   ` Aaron S. Hawley
2012-03-30  3:58     ` Glenn Morris
2012-03-30 12:32       ` Stefan Monnier
2012-03-30 16:20         ` Glenn Morris
2012-03-30 18:12           ` Aaron S. Hawley
2012-03-31 18:35             ` Glenn Morris
2012-04-02 13:28               ` Aaron S. Hawley
2012-04-09 20:50                 ` Glenn Morris
2013-02-11  1:52               ` Glenn Morris
2012-03-30 17:23     ` 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).