changeset: 4571:69a1eda3da06721407d3085ed7aabd1112b22173
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Mon Dec 22 14:07:48 2008 +0000
files: lisp/ChangeLog lisp/cus-face.el lisp/help.el lisp/loadhist.el src/ChangeLog
src/eval.c src/symbols.c
description:
Distinguish vars and functions in #'symbol-file, #'describe-{function,variable}
lisp/ChangeLog addition:
2008-12-22 Aidan Kehoe <kehoea(a)parhasard.net>
* loadhist.el (symbol-file):
Add support for differentiating between variables and functions to
#'symbol-file.
* help.el (describe-function-1):
(describe-variable):
Call #'symbol-function explicitly with a 'defun or 'defvar
argument, depending on whether we're looking for a variable or a
function.
* cus-face.el (custom-declare-face):
Record information about the face in the load history; code taken
from GNU, pre-GPLv3 revision 1.45.
src/ChangeLog addition:
2008-12-22 Aidan Kehoe <kehoea(a)parhasard.net>
* symbols.c (Fdefine_function):
* eval.c (define_function):
Record explicitly that we're defining a function in the load
history, in both these files.
diff -r f32c7f843961dee21a36b15b232b8ee66c009bb4 -r
69a1eda3da06721407d3085ed7aabd1112b22173 lisp/ChangeLog
--- a/lisp/ChangeLog Mon Dec 22 12:09:08 2008 +0000
+++ b/lisp/ChangeLog Mon Dec 22 14:07:48 2008 +0000
@@ -1,3 +1,17 @@ 2008-10-29 Stephen J. Turnbull <stephe
+2008-12-22 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * loadhist.el (symbol-file):
+ Add support for differentiating between variables and functions to
+ #'symbol-file.
+ * help.el (describe-function-1):
+ (describe-variable):
+ Call #'symbol-function explicitly with a 'defun or 'defvar
+ argument, depending on whether we're looking for a variable or a
+ function.
+ * cus-face.el (custom-declare-face):
+ Record information about the face in the load history; code taken
+ from GNU, pre-GPLv3 revision 1.45.
+
2008-10-29 Stephen J. Turnbull <stephen(a)xemacs.org>
* bytecomp.el (byte-compile-file): Protect encoding from latin-unity.
diff -r f32c7f843961dee21a36b15b232b8ee66c009bb4 -r
69a1eda3da06721407d3085ed7aabd1112b22173 lisp/cus-face.el
--- a/lisp/cus-face.el Mon Dec 22 12:09:08 2008 +0000
+++ b/lisp/cus-face.el Mon Dec 22 14:07:48 2008 +0000
@@ -50,6 +50,9 @@
frames (cdr frames))
(face-display-set face value frame '(custom)))
(init-face-from-resources face)))
+ ;; Don't record SPEC until we see it causes no errors.
+ (put face 'face-defface-spec spec)
+ (push (cons 'defface face) current-load-list)
(when (and doc (null (face-doc-string face)))
(set-face-doc-string face doc))
(custom-handle-all-keywords face args 'custom-face)
diff -r f32c7f843961dee21a36b15b232b8ee66c009bb4 -r
69a1eda3da06721407d3085ed7aabd1112b22173 lisp/help.el
--- a/lisp/help.el Mon Dec 22 12:09:08 2008 +0000
+++ b/lisp/help.el Mon Dec 22 14:07:48 2008 +0000
@@ -1425,7 +1425,7 @@ part of the documentation of internal su
nil)))
(princ "\n")
(or file-name
- (setq file-name (symbol-file function)))
+ (setq file-name (symbol-file function 'defun)))
(when file-name
(princ " -- loaded from \"")
(if (not (bufferp standard-output))
@@ -1651,7 +1651,7 @@ there is no variable around that point,
(princ (built-in-variable-doc variable))
(princ ".\n")
(require 'hyper-apropos)
- (let ((file-name (symbol-file variable))
+ (let ((file-name (symbol-file variable 'defvar))
opoint e)
(when file-name
(princ " -- loaded from \"")
diff -r f32c7f843961dee21a36b15b232b8ee66c009bb4 -r
69a1eda3da06721407d3085ed7aabd1112b22173 lisp/loadhist.el
--- a/lisp/loadhist.el Mon Dec 22 12:09:08 2008 +0000
+++ b/lisp/loadhist.el Mon Dec 22 14:07:48 2008 +0000
@@ -48,11 +48,12 @@ are acceptable.
are acceptable.
If TYPE is `defvar', then variable definitions are acceptable.
-#### For the moment the difference is not implemented for non-autoloaded
-Lisp symbols."
+`defface' specifies a face definition only, and for the moment, it won't
+return faces created with `make-face' or `copy-face', just those created
+with `defface' and `custom-declare-face'."
(interactive "SFind source file for symbol: ") ; XEmacs
(block look-up-symbol-file
- (let (built-in-file autoload-cons)
+ (let (built-in-file autoload-cons symbol-details)
(when (and
(eq 'autoload
(car-safe (setq autoload-cons
@@ -64,9 +65,25 @@ Lisp symbols."
(memq (fifth autoload-cons) '(nil macro)))))
(return-from look-up-symbol-file
(locate-library (second autoload-cons))))
- (dolist (entry load-history)
- (when (memq sym (cdr entry))
- (return-from look-up-symbol-file (car entry))))
+ (cond ((eq 'defvar type)
+ ;; Load history entries corresponding to variables are just
+ ;; symbols.
+ (dolist (entry load-history)
+ (when (memq sym (cdr entry))
+ (return-from look-up-symbol-file (car entry)))))
+ ((not (null type))
+ ;; Non-variables have the type stored as the car of the entry.
+ (dolist (entry load-history)
+ (when (and (setq symbol-details (rassq sym (cdr entry)))
+ (eq type (car symbol-details)))
+ (return-from look-up-symbol-file (car entry)))))
+ (t
+ ;; If TYPE hasn't been specified, we need to check both for
+ ;; variables and other symbols.
+ (dolist (entry load-history)
+ (when (or (memq sym (cdr entry))
+ (rassq sym (cdr entry)))
+ (return-from look-up-symbol-file (car entry))))))
(setq built-in-file (built-in-symbol-file sym type))
(if built-in-file (concat source-directory "/src/" built-in-file)))))
diff -r f32c7f843961dee21a36b15b232b8ee66c009bb4 -r
69a1eda3da06721407d3085ed7aabd1112b22173 src/ChangeLog
--- a/src/ChangeLog Mon Dec 22 12:09:08 2008 +0000
+++ b/src/ChangeLog Mon Dec 22 14:07:48 2008 +0000
@@ -1,3 +1,10 @@ 2008-12-22 Aidan Kehoe <kehoea@parhasa
+2008-12-22 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * symbols.c (Fdefine_function):
+ * eval.c (define_function):
+ Record explicitly that we're defining a function in the load
+ history, in both these files.
+
2008-12-22 Aidan Kehoe <kehoea(a)parhasard.net>
* faces.c (Fbuilt_in_face_specifiers):
diff -r f32c7f843961dee21a36b15b232b8ee66c009bb4 -r
69a1eda3da06721407d3085ed7aabd1112b22173 src/eval.c
--- a/src/eval.c Mon Dec 22 12:09:08 2008 +0000
+++ b/src/eval.c Mon Dec 22 14:07:48 2008 +0000
@@ -1223,7 +1223,7 @@ define_function (Lisp_Object name, Lisp_
define_function (Lisp_Object name, Lisp_Object defn)
{
Ffset (name, defn);
- LOADHIST_ATTACH (name);
+ LOADHIST_ATTACH (Fcons (Qdefun, name));
return name;
}
diff -r f32c7f843961dee21a36b15b232b8ee66c009bb4 -r
69a1eda3da06721407d3085ed7aabd1112b22173 src/symbols.c
--- a/src/symbols.c Mon Dec 22 12:09:08 2008 +0000
+++ b/src/symbols.c Mon Dec 22 14:07:48 2008 +0000
@@ -718,7 +718,7 @@ Associates the function with the current
{
/* This function can GC */
Ffset (symbol, newdef);
- LOADHIST_ATTACH (symbol);
+ LOADHIST_ATTACH (Fcons (Qdefun, symbol));
return newdef;
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches