summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2012-11-27 11:40:04 -0500
committerGlenn Morris <rgm@gnu.org>2012-11-27 11:40:04 -0500
commit48d6d9c01917c8dc7b29dfb208962224bf1d3035 (patch)
treeeae704c09a88127582f7d5fb07a491aee28e454f /lisp/emacs-lisp
parent45d0fdd8f0a7e4679931a9703fd0bb715552288b (diff)
downloademacs-48d6d9c01917c8dc7b29dfb208962224bf1d3035.tar.gz
emacs-48d6d9c01917c8dc7b29dfb208962224bf1d3035.tar.bz2
emacs-48d6d9c01917c8dc7b29dfb208962224bf1d3035.zip
derived-mode-make-docstring tweak for bug#11277
* lisp/emacs-lisp/derived.el (derived-mode-make-docstring): Don't mention "abbrev" or "syntax" if nil.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/derived.el34
1 files changed, 25 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index 8c8d37b2194..f4b79eb3016 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -295,16 +295,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.