]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/derived.el
* mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
[gnu-emacs] / lisp / emacs-lisp / derived.el
index 8c8d37b21944f32c5f5469b4d732ec0bf0246a9a..684f9d90878d5ce5bfc1259737598567bc7eb5c1 100644 (file)
@@ -1,7 +1,8 @@
 ;;; derived.el --- allow inheritance of major modes
 ;; (formerly mode-clone.el)
 
-;; Copyright (C) 1993-1994, 1999, 2001-2012  Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 1999, 2001-2013 Free Software Foundation,
+;; Inc.
 
 ;; Author: David Megginson (dmeggins@aix1.uottawa.ca)
 ;; Maintainer: FSF
@@ -295,16 +296,32 @@ is not very useful."
       ;; Use a default docstring.
       (setq docstring
            (if (null parent)
-               (format "Major-mode.
-Uses keymap `%s', abbrev table `%s' and syntax-table `%s'." map abbrev syntax)
+               ;; FIXME filling.
+               (format "Major-mode.\nUses keymap `%s'%s%s." map
+                       (if abbrev (format "%s abbrev table `%s'"
+                                          (if syntax "," " and") abbrev) "")
+                       (if syntax (format " and syntax-table `%s'" syntax) ""))
              (format "Major mode derived from `%s' by `define-derived-mode'.
-It inherits all of the parent's attributes, but has its own keymap,
-abbrev table and syntax table:
-
-  `%s', `%s' and `%s'
-
-which more-or-less shadow %s's corresponding tables."
-                     parent map abbrev syntax parent))))
+It inherits all of the parent's attributes, but has its own keymap%s:
+
+  `%s'%s
+
+which more-or-less shadow%s %s's corresponding table%s."
+                     parent
+                     (cond ((and abbrev syntax)
+                            ",\nabbrev table and syntax table")
+                           (abbrev "\nand abbrev table")
+                           (syntax "\nand syntax table")
+                           (t ""))
+                     map
+                     (cond ((and abbrev syntax)
+                            (format ", `%s' and `%s'" abbrev syntax))
+                           ((or abbrev syntax)
+                            (format " and `%s'" (or abbrev syntax)))
+                           (t ""))
+                     (if (or abbrev syntax) "" "s")
+                     parent
+                     (if (or abbrev syntax) "s" "")))))
 
     (unless (string-match (regexp-quote (symbol-name hook)) docstring)
       ;; Make sure the docstring mentions the mode's hook.