summaryrefslogtreecommitdiff
path: root/lisp/tutorial.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-08-20 15:53:00 -0700
committerGlenn Morris <rgm@gnu.org>2011-08-20 15:53:00 -0700
commitc21a496aed7c1b0a40312197ca4ccb7376e2d96f (patch)
tree201741b8c99b51579d2ff317601cb89ba04a17a4 /lisp/tutorial.el
parent59ee05427dbe2d7aaad260ea7c85515dd3c63bc0 (diff)
downloademacs-c21a496aed7c1b0a40312197ca4ccb7376e2d96f.tar.gz
* lisp/tutorial.el (help-with-tutorial): Avoid an error on short screens.
Diffstat (limited to 'lisp/tutorial.el')
-rw-r--r--lisp/tutorial.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/tutorial.el b/lisp/tutorial.el
index d47079af5af..c57ec33d2e2 100644
--- a/lisp/tutorial.el
+++ b/lisp/tutorial.el
@@ -889,6 +889,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 +902,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))