aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-11-27 11:40:04 -0500
committerGlenn Morris2012-11-27 11:40:04 -0500
commit48d6d9c01917c8dc7b29dfb208962224bf1d3035 (patch)
treeeae704c09a88127582f7d5fb07a491aee28e454f
parent45d0fdd8f0a7e4679931a9703fd0bb715552288b (diff)
downloademacs-48d6d9c01917c8dc7b29dfb208962224bf1d3035.tar.gz
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.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/emacs-lisp/derived.el34
2 files changed, 30 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b6d7c082a88..6a1ac6f680d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-11-27 Glenn Morris <rgm@gnu.org>
2
3 * emacs-lisp/derived.el (derived-mode-make-docstring):
4 Don't mention "abbrev" or "syntax" if nil. (Bug#11277)
5
12012-11-27 Stefan Monnier <monnier@iro.umontreal.ca> 62012-11-27 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * textmodes/table.el (table-insert): Don't use `symbol-name' on 8 * textmodes/table.el (table-insert): Don't use `symbol-name' on
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."
295 ;; Use a default docstring. 295 ;; Use a default docstring.
296 (setq docstring 296 (setq docstring
297 (if (null parent) 297 (if (null parent)
298 (format "Major-mode. 298 ;; FIXME filling.
299Uses keymap `%s', abbrev table `%s' and syntax-table `%s'." map abbrev syntax) 299 (format "Major-mode.\nUses keymap `%s'%s%s." map
300 (if abbrev (format "%s abbrev table `%s'"
301 (if syntax "," " and") abbrev) "")
302 (if syntax (format " and syntax-table `%s'" syntax) ""))
300 (format "Major mode derived from `%s' by `define-derived-mode'. 303 (format "Major mode derived from `%s' by `define-derived-mode'.
301It inherits all of the parent's attributes, but has its own keymap, 304It inherits all of the parent's attributes, but has its own keymap%s:
302abbrev table and syntax table: 305
303 306 `%s'%s
304 `%s', `%s' and `%s' 307
305 308which more-or-less shadow%s %s's corresponding table%s."
306which more-or-less shadow %s's corresponding tables." 309 parent
307 parent map abbrev syntax parent)))) 310 (cond ((and abbrev syntax)
311 ",\nabbrev table and syntax table")
312 (abbrev "\nand abbrev table")
313 (syntax "\nand syntax table")
314 (t ""))
315 map
316 (cond ((and abbrev syntax)
317 (format ", `%s' and `%s'" abbrev syntax))
318 ((or abbrev syntax)
319 (format " and `%s'" (or abbrev syntax)))
320 (t ""))
321 (if (or abbrev syntax) "" "s")
322 parent
323 (if (or abbrev syntax) "s" "")))))
308 324
309 (unless (string-match (regexp-quote (symbol-name hook)) docstring) 325 (unless (string-match (regexp-quote (symbol-name hook)) docstring)
310 ;; Make sure the docstring mentions the mode's hook. 326 ;; Make sure the docstring mentions the mode's hook.