From c21a496aed7c1b0a40312197ca4ccb7376e2d96f Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 20 Aug 2011 15:53:00 -0700 Subject: [PATCH] * lisp/tutorial.el (help-with-tutorial): Avoid an error on short screens. --- lisp/ChangeLog | 2 ++ lisp/tutorial.el | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4763c83c5a3..c655c4968df 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2011-08-20 Glenn Morris + * tutorial.el (help-with-tutorial): Avoid an error on short screens. + * tutorial.el (tutorial--default-keys): Update some default bindings. * files.el (hack-local-variables): Fully ignore case for "mode:". 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)) -- 2.11.4.GIT