Fix a gdb-mi process filtering issue arising in ansi-color.el.
[bpt/emacs.git] / lisp / tutorial.el
index 6961faf..b512700 100644 (file)
@@ -1,6 +1,6 @@
 ;;; tutorial.el --- tutorial for Emacs
 
-;; Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2012 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: help, internal
@@ -182,7 +182,7 @@ LEFT and RIGHT are the elements to compare."
                 (equal (car x) (car y)))
       (setq x (cdr x))
       (setq y (cdr y)))
-    ;; Try to make a comparision that is useful for presentation (this
+    ;; Try to make a comparison that is useful for presentation (this
     ;; could be made nicer perhaps):
     (let ((cx (car x))
           (cy (car y)))
@@ -253,7 +253,7 @@ LEFT and RIGHT are the elements to compare."
              ;; * INSERTING AND DELETING
              ;; C-u 8 * to insert ********.
              (delete-backward-char "\d")
-             (delete-forward-char [?\C-d])
+             (delete-char [?\C-d])
              (backward-kill-word [?\M-\d])
              (kill-word [?\M-d])
              (kill-line [?\C-k])
@@ -298,7 +298,7 @@ LEFT and RIGHT are the elements to compare."
              (isearch-backward [?\C-r])
 
              ;; * MULTIPLE WINDOWS
-             (split-window-vertically [?\C-x ?2])
+             (split-window-below [?\C-x ?2])
              (scroll-other-window [?\C-\M-v])
              (other-window [?\C-x ?o])
              (find-file-other-window [?\C-x ?4 ?\C-f])
@@ -832,6 +832,8 @@ Run the Viper tutorial? "))
               (insert-file-contents (tutorial--saved-file))
              (let ((enable-local-variables :safe))
                (hack-local-variables))
+              ;; FIXME?  What we actually want is to ignore dir-locals (?).
+              (setq buffer-read-only nil) ; bug#11118
               (goto-char (point-min))
               (setq old-tut-point
                     (string-to-number
@@ -849,6 +851,8 @@ Run the Viper tutorial? "))
           (insert-file-contents (expand-file-name filename tutorial-directory))
          (let ((enable-local-variables :safe))
            (hack-local-variables))
+          ;; FIXME?  What we actually want is to ignore dir-locals (?).
+          (setq buffer-read-only nil) ; bug#11118
           (forward-line)
           (setq tutorial--point-before-chkeys (point-marker)))
 
@@ -889,6 +893,11 @@ Run the Viper tutorial? "))
                  (search-forward ">>")
                  (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))
                       (count-lines (point-min) (point))
                       6)))
@@ -897,7 +906,7 @@ Run the Viper tutorial? "))
                   ;; For a short gap, we don't need the [...] line,
                   ;; so delete it.
                   (delete-region (point) (progn (end-of-line) (point)))
-                  (newline n))
+                  (if (> n 0) (newline n)))
               ;; Some people get confused by the large gap.
               (newline (/ n 2))
 
@@ -963,5 +972,4 @@ Currently this feature is only used in `help-with-tutorial'."
 
 (provide 'tutorial)
 
-;; arch-tag: c8e80aef-c3bb-4ffb-8af6-22171bf0c100
 ;;; tutorial.el ends here