-(defsubst derived-mode-abbrev-table-name (mode)
- "Construct an abbrev-table name based on a MODE name."
- (intern (concat (symbol-name mode) "-abbrev-table")))
+ (unless (string-match (regexp-quote (symbol-name hook)) docstring)
+ ;; Make sure the docstring mentions the mode's hook
+ (setq docstring
+ (concat docstring
+ (if (null parent)
+ "\n\nThis mode "
+ (concat
+ "\n\nIn addition to any hooks its parent mode "
+ (if (string-match (regexp-quote (format "`%s'" parent))
+ docstring) nil
+ (format "`%s' " parent))
+ "might have run,\nthis mode "))
+ (format "runs the hook `%s'" hook)
+ ", as the final step\nduring initialization.")))
+
+ (unless (string-match "\\\\[{[]" docstring)
+ ;; And don't forget to put the mode's keymap
+ (setq docstring (concat docstring "\n\n\\{" (symbol-name map) "}")))
+
+ docstring))
+
+\f
+;;; OBSOLETE
+;; The functions below are only provided for backward compatibility with
+;; code byte-compiled with versions of derived.el prior to Emacs-21.
+
+(defsubst derived-mode-setup-function-name (mode)
+ "Construct a setup-function name based on a MODE name."
+ (intern (concat (symbol-name mode) "-setup")))