summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2005-01-06 15:00:09 +0000
committerKaroly Lorentey <lorentey@elte.hu>2005-01-06 15:00:09 +0000
commit0feecea9fb7079a2c1fbfee32a992449a22cf478 (patch)
tree0826d68e3dc2ce370c7bd4dae7db3cffc3568321 /lisp/subr.el
parent17d51b68fb4e7da4f18eff72c589b7ffc4f9c22c (diff)
parent1a63439b34c3455a317feda5c271dfdb7af0296b (diff)
downloademacs-0feecea9fb7079a2c1fbfee32a992449a22cf478.tar.gz
emacs-0feecea9fb7079a2c1fbfee32a992449a22cf478.tar.bz2
emacs-0feecea9fb7079a2c1fbfee32a992449a22cf478.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-747 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-748 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-749 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-750 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-751 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-752 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-78 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-79 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-80 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-278
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el32
1 files changed, 24 insertions, 8 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index edc303bee8d..e7901f28852 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -823,7 +823,7 @@ is converted into a string by expressing it in decimal."
(defalias 'unfocus-frame 'ignore "")
-;;;; Obsolescence declarations for variables.
+;;;; Obsolescence declarations for variables, and aliases.
(make-obsolete-variable 'directory-sep-char "do not use it." "21.1")
(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."
(make-obsolete-variable 'x-lost-selection-hooks 'x-lost-selection-functions "21.4")
(defvaralias 'x-sent-selection-hooks 'x-sent-selection-functions)
(make-obsolete-variable 'x-sent-selection-hooks 'x-sent-selection-functions "21.4")
+
+(defvaralias 'messages-buffer-max-lines 'message-log-max)
;;;; Alternate names for functions - these are not being phased out.
@@ -1012,19 +1014,33 @@ other hooks, such as major mode hooks, can do the job."
;;; nil nil t)
;;; (setq symbol-file-load-history-loaded t)))
-(defun symbol-file (function)
- "Return the input source from which FUNCTION was loaded.
+(defun symbol-file (symbol &optional type)
+ "Return the input source in which SYMBOL was defined.
The value is normally a string that was passed to `load':
either an absolute file name, or a library name
\(with no directory name and no `.el' or `.elc' at the end).
-It can also be nil, if the definition is not associated with any file."
- (if (and (symbolp function) (fboundp function)
- (eq 'autoload (car-safe (symbol-function function))))
- (nth 1 (symbol-function function))
+It can also be nil, if the definition is not associated with any file.
+
+If TYPE is nil, then any kind of definition is acceptable.
+If type is `defun' or `defvar', that specifies function
+definition only or variable definition only."
+ (if (and (or (null type) (eq type 'defun))
+ (symbolp symbol) (fboundp symbol)
+ (eq 'autoload (car-safe (symbol-function symbol))))
+ (nth 1 (symbol-function symbol))
(let ((files load-history)
file)
(while files
- (if (member function (cdr (car files)))
+ (if (if type
+ (if (eq type 'defvar)
+ ;; Variables are present just as their names.
+ (member symbol (cdr (car files)))
+ ;; Other types are represented as (TYPE . NAME).
+ (member (cons type symbol) (cdr (car files))))
+ ;; We accept all types, so look for variable def
+ ;; and then for any other kind.
+ (or (member symbol (cdr (car files)))
+ (rassq symbol (cdr (car files)))))
(setq file (car (car files)) files nil))
(setq files (cdr files)))
file)))