Commit graph

117 commits

Author SHA1 Message Date
Stefan Monnier
24b7f77581 Improve handling of doc-strings and describe-function for cl-generic
* lisp/help-fns.el (find-lisp-object-file-name): Accept any `type' as long
as it's a symbol.
(help-fns-short-filename): New function.
(describe-function-1): Use it.  Use autoload-do-load.

* lisp/help-mode.el (help-function-def): Add optional arg `type'.

* lisp/emacs-lisp/cl-generic.el (cl-generic-ensure-function): It's OK to
override an autoload.
(cl-generic-current-method-specializers): Replace dyn-bind variable
with a lexically-scoped macro.
(cl--generic-lambda): Update accordingly.
(cl-generic-define-method): Record manually in the load-history with
type `cl-defmethod'.
(cl--generic-get-dispatcher): Minor optimization.
(cl--generic-search-method): New function.
(find-function-regexp-alist): Add entry for `cl-defmethod' type.
(cl--generic-search-method): Add hyperlinks for methods.  Merge the
specializers and the function's arguments.

* lisp/emacs-lisp/eieio-core.el (eieio--defalias): Move to eieio-generic.el.
(eieio-defclass-autoload): Don't record the superclasses any more.
(eieio-defclass-internal): Reuse the old class object if it was just an
autoload stub.
(eieio--class-precedence-list): Load the class if it's autoloaded.

* lisp/emacs-lisp/eieio-generic.el (eieio--defalias): Move from eieio-core.
(eieio--defgeneric-init-form): Don't throw away a previous docstring.
(eieio--method-optimize-primary): Don't mess with the docstring.
(defgeneric): Keep the `args' in the docstring.
(defmethod): Don't use the method's docstring for the generic
function's docstring.

* lisp/emacs-lisp/find-func.el: Use lexical-binding.
(find-function-regexp): Don't rule out `defgeneric'.
(find-function-regexp-alist): Document new possibility of including
a function instead of a regexp.
(find-function-search-for-symbol): Implement that new possibility.
(find-function-library): Don't assume that `function' is a symbol.
(find-function-do-it): Remove unused var `orig-buf'.

* test/automated/cl-generic-tests.el (cl-generic-test-8-after/before):
Rename from cl-generic-test-7-after/before.
(cl--generic-test-advice): New function.
(cl-generic-test-9-advice): New test.

* test/automated/eieio-test-methodinvoke.el (eieio-test-cl-generic-1): Reset
eieio-test--1.
2015-01-16 22:52:15 -05:00
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Dmitry Gutov
381c0bfaf2 Unbreak jumping to an alias's definition
* lisp/emacs-lisp/find-func.el (find-function-library): Return a pair
(ORIG-FUNCTION . LIBRARY) instead of just its second element.
(find-function-noselect): Use it.

* lisp/progmodes/elisp-mode.el (elisp--xref-identifier-file): Rename to
`elisp--xref-identifier-location', incorporate logic from
`elisp--xref-find-definitions', use the changed
`find-function-library' return value.
2014-12-29 04:21:51 +02:00
Dmitry Gutov
6d14e0d361 elisp-xref-find: Don't create buffers eagerly
* lisp/emacs-lisp/find-func.el (find-function-library): New function,
extracted from `find-function-noselect'.

* lisp/progmodes/elisp-mode.el (elisp--identifier-location): Fold back
into `elisp--company-location'.
(elisp--identifier-completion-table): Rename to
`elisp--identifier-completion-table', and do not include just any
symbols with a property list.
(elisp-completion-at-point): Revert the 2014-12-25 change.
(elisp--xref-identifier-file): New function.
(elisp--xref-find-definitions): Use it.

* lisp/progmodes/xref.el (xref-elisp-location): New class.
(xref-make-elisp-location): New function.
(xref-location-marker): New implementation.
2014-12-27 16:07:31 +02:00
Glenn Morris
a0e2175a90 * find-func.el (find-function-C-source-directory): Use file-accessible-directory-p 2014-06-25 23:45:10 -07:00
Stefan Monnier
70e5a261ac * lisp/help-fns.el (help-C-file-name): Handle advised functions.
* lisp/emacs-lisp/find-func.el (find-function-C-source): Idem.
* lisp/emacs-lisp/nadvice.el (advice--cd*r): New function.
* help-fns.el (describe-function-1): Use it.

Fixes: debbugs:16478
2014-02-01 21:25:05 -05:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Paul Eggert
ab422c4d68 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
Stefan Monnier
7abaf5ccc9 Autoload more carefully from Lisp. Follow aliases for function properties.
* lisp/subr.el (autoloadp): New function.
(symbol-file): Use it.
(function-get): New function.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Use function-get and
autoload-do-load.
* lisp/emacs-lisp/lisp-mode.el (lisp-font-lock-syntactic-face-function)
(lisp-indent-function):
* lisp/emacs-lisp/gv.el (gv-get):
* lisp/emacs-lisp/edebug.el (get-edebug-spec, edebug-basic-spec):
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
* lisp/emacs-lisp/autoload.el (make-autoload, autoload-print-form):
Use function-get.
* lisp/emacs-lisp/cl.el: Don't propagate function properties any more.

* src/eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
add argument, tune behavior, and adjust all callers.

* lisp/speedbar.el (speedbar-add-localized-speedbar-support):
* lisp/emacs-lisp/disass.el (disassemble-internal):
* lisp/desktop.el (desktop-load-file):
* lisp/help-fns.el (help-function-arglist, find-lisp-object-file-name)
(describe-function-1):
* lisp/emacs-lisp/find-func.el (find-function-noselect):
* lisp/emacs-lisp/elp.el (elp-instrument-function):
* lisp/emacs-lisp/advice.el (ad-has-proper-definition):
* lisp/apropos.el (apropos-safe-documentation, apropos-macrop):
* lisp/emacs-lisp/debug.el (debug-on-entry):
* lisp/emacs-lisp/cl-macs.el (cl-compiler-macroexpand):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
* lisp/calc/calc.el (name): Use autoloadp & autoload-do-load.
2012-07-25 21:27:33 -04:00
Glenn Morris
acaf905b11 Add 2012 to FSF copyright years for Emacs files 2012-01-05 01:46:05 -08:00
thierry volpiatto
341cabd841 * emacs-lisp/find-func.el (find-function-read): Fix incorrect use of default argument in `completing-read'. 2011-11-08 16:06:47 +01:00
Stefan Monnier
77694924d8 * lisp/emacs-lisp/find-func.el (find-function-C-source): Only set
find-function-C-source-directory after checking that we found a source
file there.

Fixes: debbugs:9440
2011-09-06 21:06:09 -04:00
Chong Yidong
23a8a5ab69 Improve Edebug error for attempting to instrument built-in functions.
* lisp/emacs-lisp/edebug.el (edebug-instrument-function): Use it to
signal an error for built-in functions.

* lisp/emacs-lisp/find-func.el (find-function-noselect): New arg
lisp-only.

Fixes: debbugs:6664
2011-08-21 13:43:31 -04:00
Stefan Monnier
6a2fb14596 * lisp/emacs-lisp/find-func.el (find-library--load-name): New fun.
(find-library-name): Use it to find relative load names when provided
absolute file name.

Fixes: debbugs:8803
2011-06-30 23:15:02 -04:00
Glenn Morris
73b0cd5003 Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
Glenn Morris
0d9f702fd0 Nuke arch-tags. 2011-01-15 15:16:57 -08:00
Stefan Monnier
77ab81d054 Merge from emacs-23 2011-01-14 12:18:41 -05:00
Glenn Morris
5df4f04cd3 Add 2011 to FSF/AIST copyright years. 2011-01-02 15:50:46 -08:00
Stefan Monnier
7c23d9e85b * lisp/emacs-lisp/find-func.el (find-library): Use test-completion. 2010-10-21 23:17:26 -04:00
Glenn Morris
114f9c9679 Add 2010 to copyright years. 2010-01-13 00:35:10 -08:00
Chong Yidong
352f6bff86 (find-library-name, find-library): Doc fixes. 2009-02-11 02:25:06 +00:00
Glenn Morris
ae940284fa Add 2009 to copyright years. 2009-01-05 03:18:22 +00:00
Glenn Morris
f5e7fdddfb (find-function-advised-original): New.
(find-function-C-source, find-function-noselect):
Use find-function-advised-original to handle advised funcs.  (Bug#789)

(find-function-noselect): Add missing "is" in alias message.
2008-11-15 23:36:26 +00:00
Adrian Robert
14f798ff7e apply patch from Seiji Zenitani to find doc strings in ns*.m files 2008-07-28 13:19:10 +00:00
Glenn Morris
d6cba7ae45 Switch to recommended form of GPLv3 permissions notice. 2008-05-06 03:21:21 +00:00
Stefan Monnier
e8dab97599 * files.el (locate-file-completion-table): Rename from
locate-file-completion and make it use `pred' in the normal way.
(locate-file-completion): New compatibility wrapper.
(load-library): Use locate-file-completion-table.
* emacs-lisp/find-func.el (find-library): Likewise.
* info.el: Use with-current-buffer and inhibit-read-only.
(Info-read-node-name-2): Change to use `predicate' in the normal way.
(Info-read-node-name-1): Adjust uses accordingly.
2008-04-19 03:33:13 +00:00
Martin Rudalics
5c8a04f1a9 (find-function-search-for-symbol): Strip extension
from .emacs.el to make sure symbol is searched in .emacs too.
2008-01-29 17:40:19 +00:00
Martin Rudalics
d454552ce3 (find-library): Wrap search for library name in condition-case
to avoid reporting a scan-error.
2008-01-25 17:48:59 +00:00
Miles Bader
59ce725a3b Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-987
2008-01-08 20:46:54 +00:00
Glenn Morris
8b72699e88 Add 2008 to copyright years. 2008-01-07 01:14:52 +00:00
Miles Bader
b17f53abc2 Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-966
2007-12-28 22:26:14 +00:00
Richard M. Stallman
d83b2f1415 (find-function-after-hook): Add :type. 2007-12-15 22:39:21 +00:00
Deepak Goel
8aa8da0595 Make `find-function' prefer ".el" over "" to fix a bug (see emacs-devel) 2007-12-05 22:16:17 +00:00
Vinicius Jose Latorre
59e1bd2913 Default argument for find-library 2007-10-31 12:46:29 +00:00
Vinicius Jose Latorre
c896ea9541 Default argument for find-library 2007-10-31 12:39:44 +00:00
Juanma Barranquero
77f698ef09 Don't require loadhist. 2007-10-17 23:49:26 +00:00
Glenn Morris
e0085d62fa Switch license to GPLv3 or later. 2007-07-25 04:14:29 +00:00
Glenn Morris
f0fa15c5e5 Add 2007 to copyright years. 2007-01-21 02:48:43 +00:00
Eli Zaretskii
ebfb5ed986 (find-variable): Doc fix. 2006-12-09 12:57:03 +00:00
Romain Francoise
fef1f0f2a5 (find-library-name): Don't strip ".el" from library name (reverts change
of 2005-10-25).
2006-11-21 20:06:53 +00:00
Juanma Barranquero
373ed13578 (find-function-noselect, find-function, find-variable-noselect, find-variable,
find-definition-noselect, find-face-definition): Use "non-nil" in docstrings.
2006-11-03 15:09:49 +00:00
Stefan Monnier
8f1a5a9b18 (find-function-regexp): Don't match "define-button-type". 2006-10-02 02:27:12 +00:00
Nick Roberts
35b6eb23c6 (find-function-search-for-symbol): Expand comment. 2006-07-23 21:21:29 +00:00
Nick Roberts
7358462606 (find-function-search-for-symbol): Handle "C-h f `". 2006-07-22 22:51:11 +00:00
Richard M. Stallman
39ff5f6495 (find-function-search-for-symbol):
If can't find definition, return nil for position.
(find-function-do-it): Handle new return value of find-definition-noselect.
(find-definition-noselect, find-variable-noselect): Doc fix.
(find-function-noselect): Doc fix.
2006-07-12 16:03:47 +00:00
Stefan Monnier
a04e10bc37 (find-function-search-for-symbol): Add comments. 2006-04-13 14:31:23 +00:00
Bill Wohler
1d22fabd46 (find-function-regexp): Allow dashes in defun name, in similar fashion
to find-variable-regexp.
2006-04-10 22:33:51 +00:00
Stefan Monnier
2b690e5b35 (find-function-search-for-symbol): Fix regexp so the defined var/fun doesn't
need to be quoted.
2006-04-10 18:45:34 +00:00
Luc Teirlinck
f352b9d773 (find-library-suffixes): Use get-load-suffixes' instead of load-suffixes'.
(find-library-name): Use `load-file-rep-suffixes' instead of '("").
2006-02-27 02:03:00 +00:00
Thien-Thi Nguyen
ceb4c4d303 Update years in copyright notice; nfc. 2006-02-06 12:31:40 +00:00