diff options
| -rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 5e7b29eddf8..ccdb25ef60e 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el | |||
| @@ -95,10 +95,18 @@ if ARG is `toggle'; disable the mode otherwise.") | |||
| 95 | \\{%s}" mode-pretty-name keymap-sym)))) | 95 | \\{%s}" mode-pretty-name keymap-sym)))) |
| 96 | (if (string-match-p "\\bARG\\b" doc) | 96 | (if (string-match-p "\\bARG\\b" doc) |
| 97 | doc | 97 | doc |
| 98 | (let ((argdoc (format easy-mmode--arg-docstring | 98 | (let* ((fill-prefix nil) |
| 99 | mode-pretty-name))) | 99 | (docs-fc (bound-and-true-p emacs-lisp-docstring-fill-column)) |
| 100 | (fill-column (if (integerp docs-fc) docs-fc 65)) | ||
| 101 | (argdoc (format easy-mmode--arg-docstring mode-pretty-name)) | ||
| 102 | (filled (if (fboundp 'fill-region) | ||
| 103 | (with-temp-buffer | ||
| 104 | (insert argdoc) | ||
| 105 | (fill-region (point-min) (point-max) 'left t) | ||
| 106 | (buffer-string)) | ||
| 107 | argdoc))) | ||
| 100 | (replace-regexp-in-string "\\(\n\n\\|\\'\\)\\(.\\|\n\\)*\\'" | 108 | (replace-regexp-in-string "\\(\n\n\\|\\'\\)\\(.\\|\n\\)*\\'" |
| 101 | (concat argdoc "\\1") | 109 | (concat filled "\\1") |
| 102 | doc nil nil 1))))) | 110 | doc nil nil 1))))) |
| 103 | 111 | ||
| 104 | ;;;###autoload | 112 | ;;;###autoload |