From: Richard M. Stallman Date: Thu, 5 Sep 2002 22:47:16 +0000 (+0000) Subject: (help-with-tutorial): Allow various ways X-Git-Tag: emacs-pretest-21.2.91~75 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a15a4942d2fe519778b3bd4389cdd7b475e4269d;p=emacs.git (help-with-tutorial): Allow various ways to specify the text in the [...] line, in handling the <...> line. --- diff --git a/lisp/help.el b/lisp/help.el index 3bea912dc35..3418f1047e2 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -192,16 +192,34 @@ With arg, you are asked to choose which language." (goto-char (point-min)) (search-forward "\n<<") (beginning-of-line) - (delete-region (point) (progn (end-of-line) (point))) + ;; Convert the <<...>> line to the proper [...] line, + ;; or just delete the <<...>> line if a [...] line follows. + (cond ((save-excursion + (forward-line 1) + (looking-at "\\[")) + (delete-region (point) (progn (forward-line 1) (point)))) + ((looking-at "<>") + (replace-match "[Middle of page left blank for didactic purposes. Text continues below]")) + (t + (looking-at "<<") + (replace-match "[") + (search-forward ">>") + (replace-match "]"))) + (beginning-of-line) (let ((n (- (window-height (selected-window)) (count-lines (point-min) (point)) 6))) - (if (< n 12) - (newline n) + (if (< n 8) + (progn + ;; For a short gap, we don't need the [...] line, + ;; so delete it. + (delete-region (point) (progn (end-of-line) (point))) + (newline n)) ;; Some people get confused by the large gap. (newline (/ n 2)) - (insert "[Middle of page left blank for didactic purposes. " - "Text continues below]") + + ;; Skip the [...] line (don't delete it). + (forward-line 1) (newline (- n (/ n 2))))) (goto-char (point-min)) (set-buffer-modified-p nil))))