diff options
| author | Richard M. Stallman | 2004-12-27 16:23:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-12-27 16:23:34 +0000 |
| commit | 9e247d246e31afad6ce78c65c2e996a8be1fe933 (patch) | |
| tree | 1f319576089988147753d9d7e7786c2268f2159d | |
| parent | 654359e2e3cbae9727b2bf6a298054bee9e10d41 (diff) | |
| download | emacs-9e247d246e31afad6ce78c65c2e996a8be1fe933.tar.gz emacs-9e247d246e31afad6ce78c65c2e996a8be1fe933.zip | |
(messages-buffer-max-lines): Alias for message-log-max.
(symbol-file): Rewritten to handle new load-history format.
Now takes an arg TYPE to specify looking for a particular
type of definition only.
| -rw-r--r-- | lisp/subr.el | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 84129908fc7..7cfc390d84a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -823,7 +823,7 @@ is converted into a string by expressing it in decimal." | |||
| 823 | (defalias 'unfocus-frame 'ignore "") | 823 | (defalias 'unfocus-frame 'ignore "") |
| 824 | 824 | ||
| 825 | 825 | ||
| 826 | ;;;; Obsolescence declarations for variables. | 826 | ;;;; Obsolescence declarations for variables, and aliases. |
| 827 | 827 | ||
| 828 | (make-obsolete-variable 'directory-sep-char "do not use it." "21.1") | 828 | (make-obsolete-variable 'directory-sep-char "do not use it." "21.1") |
| 829 | (make-obsolete-variable 'mode-line-inverse-video "use the appropriate faces instead." "21.1") | 829 | (make-obsolete-variable 'mode-line-inverse-video "use the appropriate faces instead." "21.1") |
| @@ -840,6 +840,8 @@ is converted into a string by expressing it in decimal." | |||
| 840 | (make-obsolete-variable 'x-lost-selection-hooks 'x-lost-selection-functions "21.4") | 840 | (make-obsolete-variable 'x-lost-selection-hooks 'x-lost-selection-functions "21.4") |
| 841 | (defvaralias 'x-sent-selection-hooks 'x-sent-selection-functions) | 841 | (defvaralias 'x-sent-selection-hooks 'x-sent-selection-functions) |
| 842 | (make-obsolete-variable 'x-sent-selection-hooks 'x-sent-selection-functions "21.4") | 842 | (make-obsolete-variable 'x-sent-selection-hooks 'x-sent-selection-functions "21.4") |
| 843 | |||
| 844 | (defvaralias 'messages-buffer-max-lines 'message-log-max) | ||
| 843 | 845 | ||
| 844 | ;;;; Alternate names for functions - these are not being phased out. | 846 | ;;;; Alternate names for functions - these are not being phased out. |
| 845 | 847 | ||
| @@ -1012,19 +1014,33 @@ other hooks, such as major mode hooks, can do the job." | |||
| 1012 | ;;; nil nil t) | 1014 | ;;; nil nil t) |
| 1013 | ;;; (setq symbol-file-load-history-loaded t))) | 1015 | ;;; (setq symbol-file-load-history-loaded t))) |
| 1014 | 1016 | ||
| 1015 | (defun symbol-file (function) | 1017 | (defun symbol-file (symbol &optional type) |
| 1016 | "Return the input source from which FUNCTION was loaded. | 1018 | "Return the input source in which SYMBOL was defined. |
| 1017 | The value is normally a string that was passed to `load': | 1019 | The value is normally a string that was passed to `load': |
| 1018 | either an absolute file name, or a library name | 1020 | either an absolute file name, or a library name |
| 1019 | \(with no directory name and no `.el' or `.elc' at the end). | 1021 | \(with no directory name and no `.el' or `.elc' at the end). |
| 1020 | It can also be nil, if the definition is not associated with any file." | 1022 | It can also be nil, if the definition is not associated with any file. |
| 1021 | (if (and (symbolp function) (fboundp function) | 1023 | |
| 1022 | (eq 'autoload (car-safe (symbol-function function)))) | 1024 | If TYPE is nil, then any kind of definition is acceptable. |
| 1023 | (nth 1 (symbol-function function)) | 1025 | If type is `defun' or `defvar', that specifies function |
| 1026 | definition only or variable definition only." | ||
| 1027 | (if (and (or (null type) (eq type 'defun)) | ||
| 1028 | (symbolp symbol) (fboundp symbol) | ||
| 1029 | (eq 'autoload (car-safe (symbol-function symbol)))) | ||
| 1030 | (nth 1 (symbol-function symbol)) | ||
| 1024 | (let ((files load-history) | 1031 | (let ((files load-history) |
| 1025 | file) | 1032 | file) |
| 1026 | (while files | 1033 | (while files |
| 1027 | (if (member function (cdr (car files))) | 1034 | (if (if type |
| 1035 | (if (eq type 'defvar) | ||
| 1036 | ;; Variables are present just as their names. | ||
| 1037 | (member symbol (cdr (car files))) | ||
| 1038 | ;; Other types are represented as (TYPE . NAME). | ||
| 1039 | (member (cons type symbol) (cdr (car files)))) | ||
| 1040 | ;; We accept all types, so look for variable def | ||
| 1041 | ;; and then for any other kind. | ||
| 1042 | (or (member symbol (cdr (car files))) | ||
| 1043 | (rassq symbol (cdr (car files))))) | ||
| 1028 | (setq file (car (car files)) files nil)) | 1044 | (setq file (car (car files)) files nil)) |
| 1029 | (setq files (cdr files))) | 1045 | (setq files (cdr files))) |
| 1030 | file))) | 1046 | file))) |