summaryrefslogtreecommitdiff
path: root/lisp/progmodes/sql.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2014-01-03 13:37:58 +0800
committerChong Yidong <cyd@gnu.org>2014-01-03 13:37:58 +0800
commit0d53f628be877abf2da4693df620d91d474ec058 (patch)
tree338b0147ef2192cb087849636437d287ea032012 /lisp/progmodes/sql.el
parent6ef9aed822746c3daf05313bbc0df7dfa9f08171 (diff)
downloademacs-0d53f628be877abf2da4693df620d91d474ec058.tar.gz
emacs-0d53f628be877abf2da4693df620d91d474ec058.tar.bz2
emacs-0d53f628be877abf2da4693df620d91d474ec058.zip
Remove the dynamic-docstring-function feature.
* emacs-lisp/advice.el (ad--make-advised-docstring): Change args. Ignore function-documentation property when getting documentation. (ad-activate-advised-definition): Use function-documentation generate the docstring. (ad-make-advised-definition): Don't call ad-make-advised-definition-docstring. (ad-make-advised-definition-docstring, ad-advised-definition-p): Delete functions. * emacs-lisp/nadvice.el (advice--make-docstring): Change args. (advice--docstring): Delete variable. (advice--make-1): Leave the docstring empty. (advice-add): Use function-documentation for advised docstring. * progmodes/sql.el (sql-help): Use function-documentation instead of dynamic-docstring-function property. No need to autoload now. (sql--help-docstring): New variable. (sql--make-help-docstring): Use it. * doc.c (Fdocumentation): Remove dynamic-docstring-function.
Diffstat (limited to 'lisp/progmodes/sql.el')
-rw-r--r--lisp/progmodes/sql.el46
1 files changed, 21 insertions, 25 deletions
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index d92d6a66ed2..eb8e0760e25 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -2826,14 +2826,14 @@ each line with INDENT."
"]\n"))))
doc))
-;;;###autoload
-(eval
- ;; FIXME: This dynamic-docstring-function trick doesn't work for byte-compiled
- ;; functions, because of the lazy-loading of docstrings, which strips away
- ;; text properties.
- '(defun sql-help ()
- #("Show short help for the SQL modes.
+(defun sql-help ()
+ "Show short help for the SQL modes."
+ (interactive)
+ (describe-function 'sql-help))
+(put 'sql-help 'function-documentation '(sql--make-help-docstring))
+(defvar sql--help-docstring
+ "Show short help for the SQL modes.
Use an entry function to open an interactive SQL buffer. This buffer is
usually named `*SQL*'. The name of the major mode is SQLi.
@@ -2862,24 +2862,20 @@ anything. The name of the major mode is SQL.
In this SQL buffer (SQL mode), you can send the region or the entire
buffer to the interactive SQL buffer (SQLi mode). The results are
-appended to the SQLi buffer without disturbing your SQL buffer."
- 0 1 (dynamic-docstring-function sql--make-help-docstring))
- (interactive)
- (describe-function 'sql-help)))
-
-(defun sql--make-help-docstring (doc _fun)
- "Insert references to loaded products into the help buffer string."
-
- ;; Insert FREE software list
- (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]FREE\\s-*\n" doc 0)
- (setq doc (replace-match (sql-help-list-products (match-string 1 doc) t)
- t t doc 0)))
-
- ;; Insert non-FREE software list
- (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]NONFREE\\s-*\n" doc 0)
- (setq doc (replace-match (sql-help-list-products (match-string 1 doc) nil)
- t t doc 0)))
- doc)
+appended to the SQLi buffer without disturbing your SQL buffer.")
+
+(defun sql--make-help-docstring ()
+ "Return a docstring for `sql-help' listing loaded SQL products."
+ (let ((doc sql--help-docstring))
+ ;; Insert FREE software list
+ (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]FREE\\s-*$" doc 0)
+ (setq doc (replace-match (sql-help-list-products (match-string 1 doc) t)
+ t t doc 0)))
+ ;; Insert non-FREE software list
+ (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]NONFREE\\s-*$" doc 0)
+ (setq doc (replace-match (sql-help-list-products (match-string 1 doc) nil)
+ t t doc 0)))
+ doc))
(defun sql-default-value (var)
"Fetch the value of a variable.