diff options
| author | Stefan Monnier | 2016-05-27 12:33:57 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2016-05-27 12:33:57 -0400 |
| commit | 84f431224cdc1ee65b4662f3eb55f4da46066e3e (patch) | |
| tree | 115c4c4637314de14d712d9be679f467f666b90a | |
| parent | 01f375386d74af896d427e2c6899df20c78b3850 (diff) | |
| download | emacs-84f431224cdc1ee65b4662f3eb55f4da46066e3e.tar.gz emacs-84f431224cdc1ee65b4662f3eb55f4da46066e3e.zip | |
* lisp/subr.el (definition-prefixes): Expand docstring
* lisp/emacs-lisp/autoload.el (autoload--split-prefixes):
Remove unused function.
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/emacs-lisp/autoload.el | 16 | ||||
| -rw-r--r-- | lisp/subr.el | 11 |
3 files changed, 21 insertions, 10 deletions
| @@ -385,6 +385,10 @@ function 'check-declare-errmsg' has been removed. | |||
| 385 | 385 | ||
| 386 | * Lisp Changes in Emacs 25.2 | 386 | * Lisp Changes in Emacs 25.2 |
| 387 | 387 | ||
| 388 | ** New var `definition-prefixes' is a hashtable mapping prefixes to the | ||
| 389 | files where corresponding definitions can be found. This can be used | ||
| 390 | to fetch definitions that are not yet loaded, for example for `C-h f'. | ||
| 391 | |||
| 388 | ** New var syntax-ppss-table to control the syntax-table used in syntax-ppss. | 392 | ** New var syntax-ppss-table to control the syntax-table used in syntax-ppss. |
| 389 | 393 | ||
| 390 | +++ | 394 | +++ |
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 80f5c28f3ec..11316f1d9d6 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el | |||
| @@ -513,15 +513,6 @@ Return non-nil in the case where no autoloads were added at point." | |||
| 513 | (t (setcdr cell (cons tail (cdr cell))))))) | 513 | (t (setcdr cell (cons tail (cdr cell))))))) |
| 514 | prefixes)) | 514 | prefixes)) |
| 515 | 515 | ||
| 516 | (defun autoload--split-prefixes (prefixes) | ||
| 517 | (apply #'nconc | ||
| 518 | (mapcar (lambda (cell) | ||
| 519 | (let ((prefix (car cell))) | ||
| 520 | (mapcar (lambda (cell) | ||
| 521 | (cons (concat prefix (car cell)) (cdr cell))) | ||
| 522 | (autoload--split-prefixes-1 (cdr cell))))) | ||
| 523 | prefixes))) | ||
| 524 | |||
| 525 | (defvar autoload-compute-prefixes t | 516 | (defvar autoload-compute-prefixes t |
| 526 | "If non-nil, autoload will add code to register the prefixes used in a file. | 517 | "If non-nil, autoload will add code to register the prefixes used in a file. |
| 527 | Standard prefixes won't be registered anyway. I.e. if a file \"foo.el\" defines | 518 | Standard prefixes won't be registered anyway. I.e. if a file \"foo.el\" defines |
| @@ -538,6 +529,13 @@ cost more memory use).") | |||
| 538 | (defvar autoload-popular-prefixes nil) | 529 | (defvar autoload-popular-prefixes nil) |
| 539 | 530 | ||
| 540 | (defun autoload--make-defs-autoload (defs file) | 531 | (defun autoload--make-defs-autoload (defs file) |
| 532 | ;; FIXME: avoid redundant entries. E.g. opascal currently has | ||
| 533 | ;; "opascal-" "opascal--literal-start-re" "opascal--syntax-propertize" | ||
| 534 | ;; where only the first one should be kept. | ||
| 535 | ;; FIXME: Avoid keeping too-long-prefixes. E.g. ob-scheme currently has | ||
| 536 | ;; "org-babel-scheme-" "org-babel-default-header-args:scheme" | ||
| 537 | ;; "org-babel-expand-body:scheme" "org-babel-execute:scheme". | ||
| 538 | |||
| 541 | ;; Remove the defs that obey the rule that file foo.el (or | 539 | ;; Remove the defs that obey the rule that file foo.el (or |
| 542 | ;; foo-mode.el) uses "foo-" as prefix. | 540 | ;; foo-mode.el) uses "foo-" as prefix. |
| 543 | ;; FIXME: help--symbol-completion-table still doesn't know how to use | 541 | ;; FIXME: help--symbol-completion-table still doesn't know how to use |
diff --git a/lisp/subr.el b/lisp/subr.el index 7cbf0063ac1..44d7eaccf02 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -5155,7 +5155,16 @@ as a list.") | |||
| 5155 | 5155 | ||
| 5156 | (defvar definition-prefixes (make-hash-table :test 'equal) | 5156 | (defvar definition-prefixes (make-hash-table :test 'equal) |
| 5157 | "Hash table mapping prefixes to the files in which they're used. | 5157 | "Hash table mapping prefixes to the files in which they're used. |
| 5158 | This can be used to automatically fetch not-yet-loaded definitions.") | 5158 | This can be used to automatically fetch not-yet-loaded definitions. |
| 5159 | More specifically, if there is a value of the form (FILES...) for a string PREFIX | ||
| 5160 | it means that the FILES define variables or functions with names that start | ||
| 5161 | with PREFIX. | ||
| 5162 | |||
| 5163 | Note that it does not imply that all definitions starting with PREFIX can | ||
| 5164 | be found in those files. E.g. if prefix is \"gnus-article-\" there might | ||
| 5165 | still be definitions of the form \"gnus-article-toto-titi\" in other files, which would | ||
| 5166 | presumably appear in this table under another prefix such as \"gnus-\" | ||
| 5167 | or \"gnus-article-toto-\".") | ||
| 5159 | 5168 | ||
| 5160 | (defun register-definition-prefixes (file prefixes) | 5169 | (defun register-definition-prefixes (file prefixes) |
| 5161 | "Register that FILE uses PREFIXES." | 5170 | "Register that FILE uses PREFIXES." |