]> git.eshelyaron.com Git - emacs.git/commitdiff
(help-with-tutorial): Allow various ways
authorRichard M. Stallman <rms@gnu.org>
Mon, 1 Apr 2002 12:32:02 +0000 (12:32 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 1 Apr 2002 12:32:02 +0000 (12:32 +0000)
to specify the text in the [...] line, in handling the <...> line.

lisp/ChangeLog
lisp/help-fns.el

index 8757ef5440dd39da436cfdeb02f5b3fdcc09b461..97118b4b1511f5451db6863b289956edd924ab4f 100644 (file)
@@ -1,5 +1,8 @@
 2002-04-01  Richard M. Stallman  <rms@gnu.org>
 
+       * help-fns.el (help-with-tutorial): Allow various ways
+       to specify the text in the [...] line, in handling the <...> line.
+
        * progmodes/idlw-rinfo.el (idlwave-system-routines): 
        WOLRDTITLE => WORLDTITLE.  SUPRESS_VALUE => SUPPRESS_VALUE.
 
index 4b4f78c084717e41f74310353aa969eeb8b8d5af..e27e6fc119a11c2d81f693f8ba16a35336552d77 100644 (file)
@@ -63,16 +63,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 "<<Blank lines inserted.*>>")
+            (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))))