changeset 85103:ee30e57a2bd8

(describe-variable): Slightly change the layout of meta-info to separate it better from the docstring. Standardize insertion of extra empty lines in various circumstances.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 09 Oct 2007 04:25:14 +0000
parents 1450635498a0
children 9befff1bc946
files lisp/ChangeLog lisp/help-fns.el
diffstat 2 files changed, 27 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Oct 09 04:22:36 2007 +0000
+++ b/lisp/ChangeLog	Tue Oct 09 04:25:14 2007 +0000
@@ -1,5 +1,9 @@
 2007-10-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* help-fns.el (describe-variable): Slightly change the layout of
+	meta-info to separate it better from the docstring.
+	Standardize insertion of extra empty lines in various circumstances.
+
 	* diff-mode.el (diff-hunk-style): New fun.
 	(diff-end-of-hunk): Use it.
 	(diff-context->unified): Use the new `apply' undo element,
@@ -7,6 +11,7 @@
 	(diff-fine-change): New face.
 	(diff-fine-highlight-preproc): New function.
 	(diff-fine-highlight): New command.
+	(diff-mode-map, diff-mode-menu): Add diff-fine-highlight.
 
 	* smerge-mode.el (smerge-refine-chopup-region): Add `preproc' argument.
 	(smerge-refine-highlight-change): Add `props' argument.
--- a/lisp/help-fns.el	Tue Oct 09 04:22:36 2007 +0000
+++ b/lisp/help-fns.el	Tue Oct 09 04:25:14 2007 +0000
@@ -566,13 +566,6 @@
 		      ;; (help-xref-on-pp from (point))
 		      (if (< (point) (+ from 20))
 			  (delete-region (1- from) from)))))))
-	    ;; Add a note for variables that have been make-var-buffer-local.
-	    (when (and (local-variable-if-set-p variable)
-		       (or (not (local-variable-p variable))
-			   (with-temp-buffer
-			     (local-variable-if-set-p variable))))
-	      (princ "\nAutomatically becomes buffer-local when set in any fashion.\n"))
-	    (terpri)
 
 	    ;; If the value is large, move it to the end.
 	    (with-current-buffer standard-output
@@ -597,34 +590,47 @@
 			       'follow-link t
 			       'help-echo "mouse-2, RET: show value")
 		(insert ".\n")))
+            (terpri)
 
- 	    ;; Mention if it's an alias
             (let* ((alias (condition-case nil
                              (indirect-variable variable)
                            (error variable)))
                    (obsolete (get variable 'byte-obsolete-variable))
 		   (safe-var (get variable 'safe-local-variable))
                    (doc (or (documentation-property variable 'variable-documentation)
-                            (documentation-property alias 'variable-documentation))))
+                            (documentation-property alias 'variable-documentation)))
+                   (extra-line nil))
+              ;; Add a note for variables that have been make-var-buffer-local.
+              (when (and (local-variable-if-set-p variable)
+                         (or (not (local-variable-p variable))
+                             (with-temp-buffer
+                               (local-variable-if-set-p variable))))
+                (setq extra-line t)
+                (princ "  Automatically becomes buffer-local when set in any fashion.\n"))
+
+              ;; Mention if it's an alias
               (unless (eq alias variable)
-                (princ (format "\nThis variable is an alias for `%s'.\n" alias)))
-	      (if (or obsolete safe-var)
-		  (terpri))
+                (setq extra-line t)
+                (princ (format "  This variable is an alias for `%s'.\n" alias)))
 
               (when obsolete
-                (princ "This variable is obsolete")
+                (setq extra-line t)
+                (princ "  This variable is obsolete")
                 (if (cdr obsolete) (princ (format " since %s" (cdr obsolete))))
                 (princ ";") (terpri)
                 (princ (if (stringp (car obsolete)) (car obsolete)
                          (format "use `%s' instead." (car obsolete))))
                 (terpri))
 	      (when safe-var
-		(princ "This variable is safe as a file local variable ")
-		(princ "if its value\nsatisfies the predicate ")
+                (setq extra-line t)
+		(princ "  This variable is safe as a file local variable ")
+		(princ "if its value\n  satisfies the predicate ")
 		(princ (if (byte-code-function-p safe-var)
 			   "which is byte-compiled expression.\n"
 			 (format "`%s'.\n" safe-var))))
-	      (princ "\nDocumentation:\n")
+
+              (if extra-line (terpri))
+	      (princ "Documentation:\n")
 	      (with-current-buffer standard-output
 		(insert (or doc "Not documented as a variable."))))
 	    ;; Make a link to customize if this variable can be customized.