]> code.delx.au - gnu-emacs/blobdiff - lisp/help-fns.el
(info-insert-file-contents): Inhibit jka-compr messages, which can be pretty annoying
[gnu-emacs] / lisp / help-fns.el
index 97ce7ca44efe207792195fba6a6239993e11ed0c..b13e6a77d5d929c0901db9856379285764a73b05 100644 (file)
@@ -222,7 +222,7 @@ if the variable `help-downcase-arguments' is non-nil."
 (defun help-do-arg-highlight (doc args)
   (with-syntax-table (make-syntax-table emacs-lisp-mode-syntax-table)
     (modify-syntax-entry ?\- "w")
-    (dolist (arg args doc)
+    (dolist (arg args)
       (setq doc (replace-regexp-in-string
                  ;; This is heuristic, but covers all common cases
                  ;; except ARG1-ARG2
@@ -236,7 +236,8 @@ if the variable `help-downcase-arguments' is non-nil."
                          "\\(?:-[{([<`\"].*?\\)?"; for ARG-{x}, (x), <x>, [x], `x'
                          "\\>")                  ; end of word
                  (help-highlight-arg arg)
-                 doc t t 1)))))
+                 doc t t 1)))
+    doc))
 
 (defun help-highlight-arguments (usage doc &rest args)
   (when (and usage (string-match "^(" usage))
@@ -557,6 +558,21 @@ suitable file is found, return nil."
                (insert (car high) "\n")
                (fill-region fill-begin (point)))
              (setq doc (cdr high))))
+
+         ;; If this is a derived mode, link to the parent.
+         (let ((parent-mode (and (symbolp real-function)
+                                 (get real-function
+                                      'derived-mode-parent))))
+           (when parent-mode
+             (with-current-buffer standard-output
+               (insert "\nParent mode: `")
+               (let ((beg (point)))
+                 (insert (format "%s" parent-mode))
+                 (make-text-button beg (point)
+                                   'type 'help-function
+                                   'help-args (list parent-mode))))
+             (princ "'.\n")))
+
          (let* ((obsolete (and
                            ;; function might be a lambda construct.
                            (symbolp function)
@@ -715,12 +731,18 @@ it is displayed along with the global value."
                          (delete-region (1- from) from)))))))
            (terpri)
            (when locus
-             (if (bufferp locus)
-                 (princ (format "%socal in buffer %s; "
-                                (if (get variable 'permanent-local)
-                                    "Permanently l" "L")
-                                (buffer-name)))
-               (princ (format "It is a frame-local variable; ")))
+             (cond
+               ((bufferp locus)
+                (princ (format "%socal in buffer %s; "
+                               (if (get variable 'permanent-local)
+                                   "Permanently l" "L")
+                               (buffer-name))))
+               ((framep locus)
+                (princ (format "It is a frame-local variable; ")))
+               ((terminal-live-p locus)
+                (princ (format "It is a terminal-local variable; ")))
+               (t
+                (princ (format "It is local to %S" locus))))
              (if (not (default-boundp variable))
                  (princ "globally void")
                (let ((val (default-value variable)))
@@ -789,7 +811,8 @@ it is displayed along with the global value."
               (when obsolete
                 (setq extra-line t)
                 (princ "  This variable is obsolete")
-                (if (cdr obsolete) (princ (format " since %s" (cdr obsolete))))
+                (if (nth 2 obsolete)
+                    (princ (format " since %s" (nth 2 obsolete))))
                (princ (cond ((stringp use) (concat ";\n  " use))
                             (use (format ";\n  use `%s' instead." (car obsolete)))
                             (t ".")))