diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/derived.el | 34 |
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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-11-27 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2012-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. |
| 299 | Uses 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'. |
| 301 | It inherits all of the parent's attributes, but has its own keymap, | 304 | It inherits all of the parent's attributes, but has its own keymap%s: |
| 302 | abbrev table and syntax table: | 305 | |
| 303 | 306 | `%s'%s | |
| 304 | `%s', `%s' and `%s' | 307 | |
| 305 | 308 | which more-or-less shadow%s %s's corresponding table%s." | |
| 306 | which 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. |