carbon2-commit: Make functions in frame.el more general.
16 years, 8 months
Aidan Kehoe
changeset: 4583:44129f301385e892320cacced2696acdbdf6a1df
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Tue Dec 30 14:22:29 2008 +0000
files: lisp/ChangeLog lisp/frame.el
description:
Make functions in frame.el more general.
(This results in better behaviour on Carbon, notably.)
2008-12-30 Aidan Kehoe <kehoea(a)parhasard.net>
* frame.el (display-mouse-p):
(display-popup-menus-p):
(display-images-p):
(display-selections-p):
(display-visual-class):
Make all these functions more general, do not hard code device
type symbols where that is inappropriate.
diff -r 8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1 -r 44129f301385e892320cacced2696acdbdf6a1df lisp/ChangeLog
--- a/lisp/ChangeLog Mon Dec 29 23:36:00 2008 +0900
+++ b/lisp/ChangeLog Tue Dec 30 14:22:29 2008 +0000
@@ -1,3 +1,13 @@ 2008-12-27 Aidan Kehoe <kehoea@parhasa
+2008-12-30 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * frame.el (display-mouse-p):
+ (display-popup-menus-p):
+ (display-images-p):
+ (display-selections-p):
+ (display-visual-class):
+ Make all these functions more general, do not hard code device
+ type symbols where that is inappropriate.
+
2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
* loadhist.el (symbol-file):
diff -r 8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1 -r 44129f301385e892320cacced2696acdbdf6a1df lisp/frame.el
--- a/lisp/frame.el Mon Dec 29 23:36:00 2008 +0900
+++ b/lisp/frame.el Tue Dec 30 14:22:29 2008 +0000
@@ -1179,21 +1179,29 @@ that is beyond the control of Emacs and
"Return non-nil if DISPLAY has a mouse available.
DISPLAY can be a frame, a device, a console, or nil (meaning the
selected frame)."
- (case (framep-on-display display)
- ;; We assume X, NeXTstep, and GTK *always* have a pointing device
- ((x ns gtk) t)
- (mswindows (> (declare-boundp mswindows-num-mouse-buttons) 0))
- (tty
+ (let (type)
+ (setq display (display-device display)
+ type (device-type display))
+ (cond
+ ((eq 'mswindows type)
+ (> (declare-boundp mswindows-num-mouse-buttons) 0))
+ ((device-on-window-system-p display)
+ ;; We assume X, NeXTstep, and GTK and the rest always have a pointing
+ ;; device.
+ t)
+ ((eq 'tty type)
(and-fboundp 'gpm-is-supported-p
- (gpm-is-supported-p (display-device display))))
- (t nil)))
+ (gpm-is-supported-p display)))
+ (t nil))))
(defun display-popup-menus-p (&optional display)
"Return non-nil if popup menus are supported on DISPLAY.
DISPLAY can be a frame, a device, a console, or nil (meaning the selected
frame). Support for popup menus requires that the mouse be available."
+ (setq display (display-device display))
(and
- (memq (framep-on-display display) '(x ns gtk mswindows))
+ (featurep 'menubar)
+ (device-on-window-system-p display)
(display-mouse-p display)))
(defun display-graphic-p (&optional display)
@@ -1203,13 +1211,17 @@ that use a window system such as X, and
that use a window system such as X, and false for text-only terminals.
DISPLAY can be a frame, a device, a console, or nil (meaning the selected
frame)."
- (memq (framep-on-display display) '(x ns gtk mswindows)))
+ (device-on-window-system-p display))
(defun display-images-p (&optional display)
"Return non-nil if DISPLAY can display images.
DISPLAY can be a frame, a device, a console, or nil (meaning the selected
frame)."
- (display-graphic-p display))
+ (and (memq (image-instance-type (specifier-instance
+ (glyph-image xemacs-logo)
+ display))
+ '(color-pixmap mono-pixmap))
+ t))
(defalias 'display-multi-frame-p 'display-graphic-p)
(defalias 'display-multi-font-p 'display-graphic-p)
@@ -1221,7 +1233,11 @@ via special system buffers called `selec
`clipboard'.
DISPLAY can be a frame, a device, a console, or nil (meaning the selected
frame)."
- (memq (framep-on-display display) '(x ns gtk mswindows)))
+ (or
+ (device-on-window-system-p display)
+ ;; GPM supports #'get-selection-foreign, but not #'own-selection.
+ (and-fboundp 'gpm-is-supported-p
+ (gpm-is-supported-p display))))
(defun display-screens (&optional display)
"Return the number of screens associated with DISPLAY."
@@ -1269,15 +1285,21 @@ the question is inapplicable to a certai
"Returns the visual class of DISPLAY.
The value is one of the symbols `static-gray', `gray-scale',
`static-color', `pseudo-color', `true-color', or `direct-color'."
- (case (framep-on-display display)
- (x (declare-fboundp (x-display-visual-class (display-device display))))
- (gtk (declare-fboundp (gtk-display-visual-class (display-device display))))
- (mswindows (let ((planes (display-planes display)))
- (cond ((eq planes 1) 'static-gray)
- ((eq planes 4) 'static-color)
- ((> planes 8) 'true-color)
- (t 'pseudo-color))))
- (t 'static-gray)))
+ (let (type planes)
+ (setq display (display-device display)
+ type (device-type display))
+ (cond
+ ((eq 'x type)
+ (declare-fboundp (x-display-visual-class display)))
+ ((eq 'gtk type)
+ (declare-fboundp (gtk-display-visual-class display)))
+ ((device-on-window-system-p display)
+ (setq planes (display-planes display))
+ (cond ((eq planes 1) 'static-gray)
+ ((eq planes 4) 'static-color)
+ ((> planes 8) 'true-color)
+ (t 'pseudo-color)))
+ (t 'static-gray))))
;; XEmacs change: omit the Emacs 18 compatibility functions:
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Check absolute source file names against DOC with #'file-newer-than-file-p.
16 years, 8 months
Aidan Kehoe
changeset: 4584:ab9e8f0fb295d0d0a41062759eff5d77be652c64
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Tue Dec 30 16:09:59 2008 +0000
files: lisp/ChangeLog lisp/make-docfile.el
description:
Check absolute source file names against DOC with #'file-newer-than-file-p.
2008-12-30 Aidan Kehoe <kehoea(a)parhasard.net>
* make-docfile.el:
Use absolute source file names when checking if DOC is out of
date, don't use relative paths that may not be related to the
current directory.
diff -r 44129f301385e892320cacced2696acdbdf6a1df -r ab9e8f0fb295d0d0a41062759eff5d77be652c64 lisp/ChangeLog
--- a/lisp/ChangeLog Tue Dec 30 14:22:29 2008 +0000
+++ b/lisp/ChangeLog Tue Dec 30 16:09:59 2008 +0000
@@ -1,3 +1,10 @@ 2008-12-30 Aidan Kehoe <kehoea@parhasa
+2008-12-30 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * make-docfile.el:
+ Use absolute source file names when checking if DOC is out of
+ date, don't use relative paths that may not be related to the
+ current directory.
+
2008-12-30 Aidan Kehoe <kehoea(a)parhasard.net>
* frame.el (display-mouse-p):
diff -r 44129f301385e892320cacced2696acdbdf6a1df -r ab9e8f0fb295d0d0a41062759eff5d77be652c64 lisp/make-docfile.el
--- a/lisp/make-docfile.el Tue Dec 30 14:22:29 2008 +0000
+++ b/lisp/make-docfile.el Tue Dec 30 16:09:59 2008 +0000
@@ -151,7 +151,7 @@
(load "setup-paths.el")
(load "raw-process.el")
-(let (preloaded-file-list arg0 arg package-preloaded-file-list)
+(let (preloaded-file-list arg0 arg package-preloaded-file-list absolute)
(load (expand-file-name "dumped-lisp.el" source-lisp))
(setq package-preloaded-file-list
@@ -168,7 +168,8 @@
(while preloaded-file-list
(setq arg0 (packages-add-suffix (car preloaded-file-list))
- arg (locate-library arg0))
+ arg (locate-library arg0)
+ absolute arg)
(if (null arg)
(progn
(message "Error: dumped file %s does not exist" arg0)
@@ -191,7 +192,8 @@
(if (null (member arg processed))
(progn
(if (and (null docfile-out-of-date)
- (file-newer-than-file-p arg docfile))
+ ;; We need to check the absolute path here:
+ (file-newer-than-file-p absolute docfile))
(setq docfile-out-of-date t))
(setq processed (cons arg processed)))))
(setq preloaded-file-list (cdr preloaded-file-list))))
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Merge after pull.
16 years, 8 months
Aidan Kehoe
changeset: 4582:8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1
parent: 4581:dc578683fddde723911a5cc6ff7bf982a07e42fb
parent: 4578:0c410b5b387a7dc82a025a2fb386569a716ba59d
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Mon Dec 29 23:36:00 2008 +0900
files:
description:
Merge after pull.
diff -r dc578683fddde723911a5cc6ff7bf982a07e42fb -r 8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1 lib-src/ChangeLog
--- a/lib-src/ChangeLog Mon Dec 29 21:49:01 2008 +0900
+++ b/lib-src/ChangeLog Mon Dec 29 23:36:00 2008 +0900
@@ -1,3 +1,13 @@ 2008-05-21 Aidan Kehoe <kehoea@parhasa
+2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * make-docfile.c (main): Allow more than one -d argument, followed
+ by a directory to change to.
+ (put_filename): Don't strip directory information; with previous
+ change, allows retrieval of Lisp function and variable origin
+ files from #'built-in-symbol-file relative to lisp-directory.
+ (scan_lisp_file): Don't add an extraneous newline after the file
+ name, put_filename has added the newline already.
+
2008-05-21 Aidan Kehoe <kehoea(a)parhasard.net>
* make-mswin-unicode.pl:
diff -r dc578683fddde723911a5cc6ff7bf982a07e42fb -r 8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1 lib-src/make-docfile.c
--- a/lib-src/make-docfile.c Mon Dec 29 21:49:01 2008 +0900
+++ b/lib-src/make-docfile.c Mon Dec 29 23:36:00 2008 +0900
@@ -233,6 +233,15 @@ main (int argc, char **argv)
err_count += scan_file (arg);
}
}
+ else if (argc > i + 1 && !strcmp (argv[i], "-d"))
+ {
+ /* XEmacs change; allow more than one chdir.
+ The idea is that the second chdir is to source-lisp, and that
+ any Lisp files not under there have the full path specified. */
+ i += 1;
+ chdir (argv[i]);
+ continue;
+ }
else
{
int j;
@@ -269,14 +278,16 @@ static void
static void
put_filename (const char *filename)
{
+ /* XEmacs change; don't strip directory information. */
+#if 0
const char *tmp;
- /* Why are we cutting this off? */
for (tmp = filename; *tmp; tmp++)
{
if (IS_DIRECTORY_SEP(*tmp))
filename = tmp + 1;
}
+#endif
/* <= because sizeof includes the nul byte at the end. Not quite right,
because it should include the length of the symbol + "\037[VF]" instead
@@ -1390,7 +1401,6 @@ scan_lisp_file (const char *filename, co
backslash-newline) have already been read. */
put_filename (filename); /* XEmacs addition */
- putc ('\n', outfile); /* XEmacs addition */
putc (037, outfile);
putc (type, outfile);
fprintf (outfile, "%s\n", buffer);
diff -r dc578683fddde723911a5cc6ff7bf982a07e42fb -r 8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1 lisp/ChangeLog
--- a/lisp/ChangeLog Mon Dec 29 21:49:01 2008 +0900
+++ b/lisp/ChangeLog Mon Dec 29 23:36:00 2008 +0900
@@ -1,3 +1,39 @@ 2008-12-22 Aidan Kehoe <kehoea@parhasa
+2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * loadhist.el (symbol-file):
+ Use #'defun*, not #'defun, to allow the checks for autoloaded
+ functions and variables to call #'return-from correctly. Use
+ #'return-from instead of #'return throughout the function.
+
+2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * loadup.el (load-history):
+ Add the contents of current-load-list to load-history before
+ clearing it. Move the variable declarations earlier in the file to
+ a format understood by make-docfile.c.
+ * custom.el (custom-declare-variable): Add the variable's symbol
+ to the current file's load history entry correctly, don't use a
+ cons. Eliminate a comment that we don't need to worry about, we
+ don't need to check the `initialized' C variable in Lisp.
+ * bytecomp.el (byte-compile-output-file-form):
+ Merge Andreas Schwab's pre-GPLv3 GNU change of 19970831 here;
+ treat #'custom-declare-variable correctly, generating the
+ docstrings in a format understood by make-docfile.c.
+ * loadhist.el (symbol-file): Correct behaviour for checking
+ autoloaded macros and functions when supplied with a TYPE
+ argument. Accept fully-qualified paths from
+ #'built-in-symbol-file; if a path is not fully-qualified, return
+ it relative to lisp-directory if the filename corresponds to a
+ Lisp file, and relative to (concat source-directory "/src/")
+ otherwise.
+ * make-docfile.el (preloaded-file-list):
+ Rationalise some let bindings a little. Use the "-d" argument to
+ make-docfile.c to supply Lisp paths relative to lisp-directory,
+ not absolutely. Add in loadup.el explicitly to the list of files
+ to be processed by make-docfile.c--it doesn't make sense to add it
+ to preloaded-file-list, since that is used for purposes of
+ byte-compilation too.
+
2008-12-22 Aidan Kehoe <kehoea(a)parhasard.net>
* loadhist.el (symbol-file):
diff -r dc578683fddde723911a5cc6ff7bf982a07e42fb -r 8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1 lisp/bytecomp.el
--- a/lisp/bytecomp.el Mon Dec 29 21:49:01 2008 +0900
+++ b/lisp/bytecomp.el Mon Dec 29 23:36:00 2008 +0900
@@ -1881,10 +1881,12 @@ With argument, insert value in current b
;; defalias calls are output directly by byte-compile-file-form-defmumble;
;; it does not pay to first build the defalias in defmumble and then parse
;; it here.
- (if (and (memq (car-safe form) '(defun defmacro defvar defconst autoload))
+ (if (and (memq (car-safe form) '(defun defmacro defvar defconst autoload
+ custom-declare-variable))
(stringp (nth 3 form)))
(byte-compile-output-docform nil nil '("\n(" 3 ")") form nil
- (eq (car form) 'autoload))
+ (memq (car form)
+ '(autoload custom-declare-variable)))
(let ((print-escape-newlines t)
(print-length nil)
(print-level nil)
diff -r dc578683fddde723911a5cc6ff7bf982a07e42fb -r 8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1 lisp/custom.el
--- a/lisp/custom.el Mon Dec 29 21:49:01 2008 +0900
+++ b/lisp/custom.el Mon Dec 29 23:36:00 2008 +0900
@@ -203,9 +203,7 @@ keyword in your own programs. "
;; Do the actual initialization.
(unless custom-dont-initialize
(funcall initialize symbol default)))
- ;; #### This is a rough equivalent of LOADHIST_ATTACH. However,
- ;; LOADHIST_ATTACH also checks for `initialized'.
- (push (cons 'defvar symbol) current-load-list)
+ (push symbol current-load-list)
(run-hooks 'custom-define-hook)
symbol)
diff -r dc578683fddde723911a5cc6ff7bf982a07e42fb -r 8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1 lisp/loadhist.el
--- a/lisp/loadhist.el Mon Dec 29 21:49:01 2008 +0900
+++ b/lisp/loadhist.el Mon Dec 29 23:36:00 2008 +0900
@@ -39,7 +39,9 @@
;; load-history is a list of entries that look like this:
;; ("outline" outline-regexp ... (require . wid-edit) ... (provide . outline) ...)
-(defun symbol-file (sym &optional type)
+;; XEmacs; this function is in subr.el in GNU, and does not deal with
+;; built-in symbols.
+(defun* symbol-file (sym &optional type)
"Return the input source from which SYM was loaded.
This is a file name, or nil if the source was a buffer with no associated file.
@@ -52,40 +54,44 @@ return faces created with `make-face' or
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 symbol-details)
- (when (and
- (eq 'autoload
- (car-safe (setq autoload-cons
- (and (fboundp sym)
- (symbol-function sym)))))
- (or (and (or (null type) (eq 'defvar type))
- (eq (fifth autoload-cons) 'keymap))
- (and (or (null type) (eq 'defvar type))
- (memq (fifth autoload-cons) '(nil macro)))))
- (return-from look-up-symbol-file
- (locate-library (second autoload-cons))))
- (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)))))
+ (let (built-in-file autoload-cons symbol-details)
+ (cond ((and (eq 'autoload
+ (car-safe
+ (setq autoload-cons
+ (and (fboundp sym) (symbol-function sym)))))
+ (or (and (or (null type) (eq 'defvar type))
+ (eq (fifth autoload-cons) 'keymap))
+ (and (or (null type) (eq 'defun type))
+ (memq (fifth autoload-cons) '(nil macro)))))
+ (return-from symbol-file (locate-library (second autoload-cons))))
+ ((eq 'defvar type)
+ ;; Load history entries corresponding to variables are just
+ ;; symbols.
+ (dolist (entry load-history)
+ (when (memq sym (cdr entry))
+ (return-from 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 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 symbol-file (car entry))))))
+ (when (setq built-in-file (built-in-symbol-file sym type))
+ (if (equal built-in-file (file-truename built-in-file))
+ ;; Probably a full path name:
+ built-in-file
+ ;; This is a bit heuristic, but shouldn't realistically be a
+ ;; problem:
+ (if (string-match "\.elc?$" built-in-file)
+ (concat lisp-directory built-in-file)
+ (concat source-directory "/src/" built-in-file))))))
(defun feature-symbols (feature)
"Return the file and list of symbols associated with a given FEATURE."
diff -r dc578683fddde723911a5cc6ff7bf982a07e42fb -r 8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1 lisp/loadup.el
--- a/lisp/loadup.el Mon Dec 29 21:49:01 2008 +0900
+++ b/lisp/loadup.el Mon Dec 29 23:36:00 2008 +0900
@@ -31,6 +31,12 @@
;; If you are wanting to add files to be dumped into your local version of
;; XEmacs, DO NOT add them here. Use site-init.el or site-load.el instead.
+;; ***Note the docstrings for the variables in this file. They follow the
+;; conventions described in lib-src/make-docfile.c, and any new variables or
+;; functions added to this file should follow those conventions too, since
+;; this file is always loaded uncompiled, and the byte-compiler never gets a
+;; chance to format the docstrings in the way make-docfile.c understands.
+
;; This is loaded into a bare XEmacs to make a dumpable one.
;;; Code:
@@ -47,27 +53,27 @@
(when (fboundp 'error)
(error "loadup.el already loaded!"))
-(defconst running-xemacs t
- "Non-nil when the current emacs is XEmacs.")
+(defconst running-xemacs t "\
+Non-nil when the current emacs is XEmacs.")
;; Can't make this constant for now because it causes an error in
;; update-elc.el.
-(defvar source-lisp (file-name-directory (expand-file-name
- (nth 2 command-line-args)))
- "Root of tree containing the Lisp source code for the current build.
+(defvar source-lisp (file-name-directory (expand-file-name (nth 2 command-line-args))) "\
+Root of tree containing the Lisp source code for the current build.
Differs from `lisp-directory' if this XEmacs has been installed. ")
-(defconst build-directory (expand-file-name ".." invocation-directory)
- "Root of tree containing object files and executables produced by build.
+(defconst build-directory (expand-file-name ".." invocation-directory) "\
+Root of tree containing object files and executables produced by build.
Differs from `source-directory' if configured with --srcdir option, a practice
recommended for developers.")
-(defconst source-directory (expand-file-name ".." source-lisp)
- "Root of tree containing source code for the current build.
+(defconst source-directory (expand-file-name ".." source-lisp) "\
+Root of tree containing source code for the current build.
Used during loadup and for documenting source of symbols defined in C.")
-(defvar preloaded-file-list nil
- "List of files preloaded into the XEmacs binary image.")
+(defvar preloaded-file-list nil "\
+List of Lisp files preloaded into the XEmacs binary image,
+with the exception of `loadup.el'.")
;(start-profiling)
@@ -206,7 +212,15 @@ Used during loadup and for documenting s
;; See also "site-load" above.
(when (stringp site-start-file)
(load "site-init" t))
-(setq current-load-list nil)
+;; Add information from this file to the load history:
+(setq load-history (cons (nreverse current-load-list) load-history)
+ ;; Clear current-load-list; this (and adding information to
+ ;; load-history) is normally done in lread.c after reading the
+ ;; entirety of a file, something which never happens for loadup.el.
+ current-load-list nil)
+;; Make the path to this file look a little nicer:
+(setcar (car load-history) (file-truename (caar load-history)))
+
(garbage-collect)
;;; At this point, we're ready to resume undo recording for scratch.
diff -r dc578683fddde723911a5cc6ff7bf982a07e42fb -r 8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1 lisp/make-docfile.el
--- a/lisp/make-docfile.el Mon Dec 29 21:49:01 2008 +0900
+++ b/lisp/make-docfile.el Mon Dec 29 23:36:00 2008 +0900
@@ -151,36 +151,50 @@
(load "setup-paths.el")
(load "raw-process.el")
-(let (preloaded-file-list)
+(let (preloaded-file-list arg0 arg package-preloaded-file-list)
(load (expand-file-name "dumped-lisp.el" source-lisp))
- (let ((package-preloaded-file-list
- (packages-collect-package-dumped-lisps late-package-load-path)))
-
- (setq preloaded-file-list
- (append package-preloaded-file-list
- preloaded-file-list
- packages-hardcoded-lisp)))
+ (setq package-preloaded-file-list
+ (packages-collect-package-dumped-lisps late-package-load-path)
+ preloaded-file-list
+ (append package-preloaded-file-list
+ preloaded-file-list
+ packages-hardcoded-lisp)
+
+ processed (cons "-d" processed)
+ processed (cons source-lisp processed)
+ ;; Include loadup.el, which is never in preloaded-file-list:
+ processed (cons "loadup.el" processed))
(while preloaded-file-list
- (let ((arg0 (packages-add-suffix (car preloaded-file-list)))
- arg)
- (setq arg (locate-library arg0))
- (if (null arg)
- (progn
+ (setq arg0 (packages-add-suffix (car preloaded-file-list))
+ arg (locate-library arg0))
+ (if (null arg)
+ (progn
(message "Error: dumped file %s does not exist" arg0)
;; Uncomment in case of difficulties
- ;;(message "late-package-hierarchies: %S" late-package-hierarchies)
- ;;(message "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-root-p))
- ;;(message "guessed-data-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-data-root-p))
- )
- (if (null (member arg processed))
- (progn
- (if (and (null docfile-out-of-date)
- (file-newer-than-file-p arg docfile))
- (setq docfile-out-of-date t))
- (setq processed (cons arg processed)))))
- (setq preloaded-file-list (cdr preloaded-file-list)))))
+ ;(message "late-package-hierarchies: %S"
+ ; late-package-hierarchies)
+ ;(message "guessed-roots: %S" (paths-find-emacs-roots
+ ; invocation-directory
+ ; invocation-name
+ ; #'paths-emacs-root-p))
+ ;(message "guessed-data-roots: %S" (paths-find-emacs-roots
+ ; invocation-directory
+ ; invocation-name
+ ; #'paths-emacs-data-root-p))
+ )
+ (when (equal arg (expand-file-name arg0 source-lisp))
+ ;; Use relative paths where possible, since this makes file lookup
+ ;; in an installed XEmacs easier:
+ (setq arg arg0))
+ (if (null (member arg processed))
+ (progn
+ (if (and (null docfile-out-of-date)
+ (file-newer-than-file-p arg docfile))
+ (setq docfile-out-of-date t))
+ (setq processed (cons arg processed)))))
+ (setq preloaded-file-list (cdr preloaded-file-list))))
;; Finally process the list of site-loaded files.
(if site-file-list
diff -r dc578683fddde723911a5cc6ff7bf982a07e42fb -r 8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1 src/ChangeLog
--- a/src/ChangeLog Mon Dec 29 21:49:01 2008 +0900
+++ b/src/ChangeLog Mon Dec 29 23:36:00 2008 +0900
@@ -1,3 +1,13 @@ 2008-12-27 Vin Shelton <acs(a)xemacs.org
+2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * doc.c (Fbuilt_in_symbol_file):
+ Return a subr's filename immediately if we've found it. Check for
+ compiled function and compiled macro docstrings in DOC too, and
+ return them if they exist.
+ The branch of the if statement focused on functions may have
+ executed, but we may still want to check variable bindings; an
+ else clause isn't appropriate.
+
2008-12-27 Vin Shelton <acs(a)xemacs.org>
* syswindows.h: Don't define wide character interfaces for Cygwin
diff -r dc578683fddde723911a5cc6ff7bf982a07e42fb -r 8775d3b5487437a87fa8c75338b7c3fc6cb7a2e1 src/doc.c
--- a/src/doc.c Mon Dec 29 21:49:01 2008 +0900
+++ b/src/doc.c Mon Dec 29 23:36:00 2008 +0900
@@ -531,11 +531,33 @@ If TYPE is `defvar', then variable defin
return Qnil;
}
else
- filename = get_object_file_name
- (make_int (- (EMACS_INT) XSUBR (fun)->doc));
- }
- }
- else if (EQ(Fboundp(symbol), Qt) && (EQ(type, Qnil) || EQ(type, Qdefvar)))
+ {
+ filename = get_object_file_name
+ (make_int (- (EMACS_INT) XSUBR (fun)->doc));
+ return filename;
+ }
+ }
+
+ if (COMPILED_FUNCTIONP (fun) || (CONSP(fun) &&
+ (EQ (Qmacro, Fcar_safe (fun)))
+ && (fun = Fcdr_safe (fun),
+ COMPILED_FUNCTIONP (fun))))
+ {
+ Lisp_Object tem;
+ Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
+
+ if (! (f->flags.documentationp))
+ return Qnil;
+ tem = compiled_function_documentation (f);
+ if (NATNUMP (tem) || CONSP (tem))
+ {
+ filename = get_object_file_name (tem);
+ return filename;
+ }
+ }
+ }
+
+ if (EQ(Fboundp(symbol), Qt) && (EQ(type, Qnil) || EQ(type, Qdefvar)))
{
Lisp_Object doc_offset = Fget (symbol, Qvariable_documentation, Qnil);
@@ -551,9 +573,11 @@ If TYPE is `defvar', then variable defin
{
filename = get_object_file_name(doc_offset);
}
- }
- }
- return filename;
+ return filename;
+ }
+ }
+
+ return Qnil;
}
DEFUN ("documentation", Fdocumentation, 1, 2, 0, /*
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Add terminating newline to .hgignore.
16 years, 8 months
Aidan Kehoe
changeset: 4579:9b3f398ebfb72138e8c0776cc4d9d072e8e80c02
parent: 4575:112f6ed4429915e2b374be688228895bbfcbc18a
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Mon Dec 29 21:39:37 2008 +0900
files: .hgignore ChangeLog
description:
Add terminating newline to .hgignore.
diff -r 112f6ed4429915e2b374be688228895bbfcbc18a -r 9b3f398ebfb72138e8c0776cc4d9d072e8e80c02 .hgignore
--- a/.hgignore Sat Dec 27 21:23:16 2008 -0500
+++ b/.hgignore Mon Dec 29 21:39:37 2008 +0900
@@ -52,4 +52,4 @@ info/.*\.info(-[0-9]+)?$
^src/REBUILD_AUTOLOADS$
^src/(temacs|xemacs)\.(exe|exe\.manifest|pdb|map|bsc)$
^TAGS$
-^version\.sh$
\ No newline at end of file
+^version\.sh$
diff -r 112f6ed4429915e2b374be688228895bbfcbc18a -r 9b3f398ebfb72138e8c0776cc4d9d072e8e80c02 ChangeLog
--- a/ChangeLog Sat Dec 27 21:23:16 2008 -0500
+++ b/ChangeLog Mon Dec 29 21:39:37 2008 +0900
@@ -1,3 +1,7 @@ 2008-12-27 Aidan Kehoe <kehoea@parhasa
+2008-12-29 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * .hgignore: Add terminating newline to .hgignore.
+
2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
* configure.ac: Vladimir Ivanovic's change of 2008-09-17 was
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Fix my syntax errors.
16 years, 8 months
Aidan Kehoe
changeset: 4580:fe64f1351cbd8e5740d6722db26421f372b5868f
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Mon Dec 29 21:42:40 2008 +0900
files: ChangeLog configure.ac
description:
Fix my syntax errors.
diff -r 9b3f398ebfb72138e8c0776cc4d9d072e8e80c02 -r fe64f1351cbd8e5740d6722db26421f372b5868f ChangeLog
--- a/ChangeLog Mon Dec 29 21:39:37 2008 +0900
+++ b/ChangeLog Mon Dec 29 21:42:40 2008 +0900
@@ -1,3 +1,7 @@ 2008-12-29 Stephen J. Turnbull <stephe
+2008-12-29 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * configure.ac (xemacs_cc_cc_mismatch): Fix my syntax errors.
+
2008-12-29 Stephen J. Turnbull <stephen(a)xemacs.org>
* .hgignore: Add terminating newline to .hgignore.
diff -r 9b3f398ebfb72138e8c0776cc4d9d072e8e80c02 -r fe64f1351cbd8e5740d6722db26421f372b5868f configure.ac
--- a/configure.ac Mon Dec 29 21:39:37 2008 +0900
+++ b/configure.ac Mon Dec 29 21:42:40 2008 +0900
@@ -2247,16 +2247,21 @@ if test "$CC" != "$XEMACS_CC"; then
*g++* )
if test "$GCC" != "yes"; then
AC_MSG_WARN([CC and g++ are mismatched; XE_CFLAGS may be wrong])
- xemacs_cc_cc_mismatch=yes ;;
+ xemacs_cc_cc_mismatch=yes
+ fi
+ ;;
esac
if test -n "$GCC"; then
case $XEMACS_CC in
*g++* )
+ # it's as expected, do nothing
;;
* )
AC_MSG_WARN([gcc and XEMACS_CC are mismatched; XE_CFLAGS may be wrong])
- xemacs_cc_cc_mismatch=yes ;;
+ xemacs_cc_cc_mismatch=yes
+ ;;
esac
+ fi
dnl #### Add other detectable mismatches here.
fi
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Correct a misunderstanding of the semantics of #'return in #'symbol-file.
16 years, 8 months
Aidan Kehoe
changeset: 4577:7e01763ea6560a1ee82ba950ddd47bd62d769b8a
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sat Dec 27 16:02:25 2008 +0000
files: lisp/ChangeLog lisp/loadhist.el
description:
Correct a misunderstanding of the semantics of #'return in #'symbol-file.
2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
* loadhist.el (symbol-file):
Use #'defun*, not #'defun, to allow the checks for autoloaded
functions and variables to call #'return-from correctly. Use
#'return-from instead of #'return throughout the function.
diff -r 061e030e3270035d8cde0206b6e34cff27c697bd -r 7e01763ea6560a1ee82ba950ddd47bd62d769b8a lisp/ChangeLog
--- a/lisp/ChangeLog Sat Dec 27 14:05:50 2008 +0000
+++ b/lisp/ChangeLog Sat Dec 27 16:02:25 2008 +0000
@@ -1,3 +1,10 @@ 2008-12-27 Aidan Kehoe <kehoea@parhasa
+2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * loadhist.el (symbol-file):
+ Use #'defun*, not #'defun, to allow the checks for autoloaded
+ functions and variables to call #'return-from correctly. Use
+ #'return-from instead of #'return throughout the function.
+
2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
* loadup.el (load-history):
diff -r 061e030e3270035d8cde0206b6e34cff27c697bd -r 7e01763ea6560a1ee82ba950ddd47bd62d769b8a lisp/loadhist.el
--- a/lisp/loadhist.el Sat Dec 27 14:05:50 2008 +0000
+++ b/lisp/loadhist.el Sat Dec 27 16:02:25 2008 +0000
@@ -41,7 +41,7 @@
;; XEmacs; this function is in subr.el in GNU, and does not deal with
;; built-in symbols.
-(defun symbol-file (sym &optional type)
+(defun* symbol-file (sym &optional type)
"Return the input source from which SYM was loaded.
This is a file name, or nil if the source was a buffer with no associated file.
@@ -63,26 +63,26 @@ with `defface' and `custom-declare-face'
(eq (fifth autoload-cons) 'keymap))
(and (or (null type) (eq 'defun type))
(memq (fifth autoload-cons) '(nil macro)))))
- (return (locate-library (second autoload-cons))))
+ (return-from symbol-file (locate-library (second autoload-cons))))
((eq 'defvar type)
;; Load history entries corresponding to variables are just
;; symbols.
(dolist (entry load-history)
(when (memq sym (cdr entry))
- (return (car entry)))))
+ (return-from 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 (car entry)))))
+ (return-from 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 (car entry))))))
+ (return-from symbol-file (car entry))))))
(when (setq built-in-file (built-in-symbol-file sym type))
(if (equal built-in-file (file-truename built-in-file))
;; Probably a full path name:
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Fix some bugs in load-history construction, built-in symbol file names.
16 years, 8 months
Aidan Kehoe
changeset: 4576:061e030e3270035d8cde0206b6e34cff27c697bd
parent: 4571:69a1eda3da06721407d3085ed7aabd1112b22173
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sat Dec 27 14:05:50 2008 +0000
files: lib-src/ChangeLog lib-src/make-docfile.c lisp/ChangeLog lisp/bytecomp.el lisp/custom.el lisp/loadhist.el lisp/loadup.el lisp/make-docfile.el src/ChangeLog src/doc.c
description:
Fix some bugs in load-history construction, built-in symbol file names.
lib-src/ChangeLog addition:
2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
* make-docfile.c (main): Allow more than one -d argument, followed
by a directory to change to.
(put_filename): Don't strip directory information; with previous
change, allows retrieval of Lisp function and variable origin
files from #'built-in-symbol-file relative to lisp-directory.
(scan_lisp_file): Don't add an extraneous newline after the file
name, put_filename has added the newline already.
lisp/ChangeLog addition:
2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
* loadup.el (load-history):
Add the contents of current-load-list to load-history before
clearing it. Move the variable declarations earlier in the file to
a format understood by make-docfile.c.
* custom.el (custom-declare-variable): Add the variable's symbol
to the current file's load history entry correctly, don't use a
cons. Eliminate a comment that we don't need to worry about, we
don't need to check the `initialized' C variable in Lisp.
* bytecomp.el (byte-compile-output-file-form):
Merge Andreas Schwab's pre-GPLv3 GNU change of 19970831 here;
treat #'custom-declare-variable correctly, generating the
docstrings in a format understood by make-docfile.c.
* loadhist.el (symbol-file): Correct behaviour for checking
autoloaded macros and functions when supplied with a TYPE
argument. Accept fully-qualified paths from
#'built-in-symbol-file; if a path is not fully-qualified, return
it relative to lisp-directory if the filename corresponds to a
Lisp file, and relative to (concat source-directory "/src/")
otherwise.
* make-docfile.el (preloaded-file-list):
Rationalise some let bindings a little. Use the "-d" argument to
make-docfile.c to supply Lisp paths relative to lisp-directory,
not absolutely. Add in loadup.el explicitly to the list of files
to be processed by make-docfile.c--it doesn't make sense to add it
to preloaded-file-list, since that is used for purposes of
byte-compilation too.
src/ChangeLog addition:
2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
* doc.c (Fbuilt_in_symbol_file):
Return a subr's filename immediately if we've found it. Check for
compiled function and compiled macro docstrings in DOC too, and
return them if they exist.
The branch of the if statement focused on functions may have
executed, but we may still want to check variable bindings; an
else clause isn't appropriate.
diff -r 69a1eda3da06721407d3085ed7aabd1112b22173 -r 061e030e3270035d8cde0206b6e34cff27c697bd lib-src/ChangeLog
--- a/lib-src/ChangeLog Mon Dec 22 14:07:48 2008 +0000
+++ b/lib-src/ChangeLog Sat Dec 27 14:05:50 2008 +0000
@@ -1,3 +1,13 @@ 2008-05-21 Aidan Kehoe <kehoea@parhasa
+2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * make-docfile.c (main): Allow more than one -d argument, followed
+ by a directory to change to.
+ (put_filename): Don't strip directory information; with previous
+ change, allows retrieval of Lisp function and variable origin
+ files from #'built-in-symbol-file relative to lisp-directory.
+ (scan_lisp_file): Don't add an extraneous newline after the file
+ name, put_filename has added the newline already.
+
2008-05-21 Aidan Kehoe <kehoea(a)parhasard.net>
* make-mswin-unicode.pl:
diff -r 69a1eda3da06721407d3085ed7aabd1112b22173 -r 061e030e3270035d8cde0206b6e34cff27c697bd lib-src/make-docfile.c
--- a/lib-src/make-docfile.c Mon Dec 22 14:07:48 2008 +0000
+++ b/lib-src/make-docfile.c Sat Dec 27 14:05:50 2008 +0000
@@ -233,6 +233,15 @@ main (int argc, char **argv)
err_count += scan_file (arg);
}
}
+ else if (argc > i + 1 && !strcmp (argv[i], "-d"))
+ {
+ /* XEmacs change; allow more than one chdir.
+ The idea is that the second chdir is to source-lisp, and that
+ any Lisp files not under there have the full path specified. */
+ i += 1;
+ chdir (argv[i]);
+ continue;
+ }
else
{
int j;
@@ -269,14 +278,16 @@ static void
static void
put_filename (const char *filename)
{
+ /* XEmacs change; don't strip directory information. */
+#if 0
const char *tmp;
- /* Why are we cutting this off? */
for (tmp = filename; *tmp; tmp++)
{
if (IS_DIRECTORY_SEP(*tmp))
filename = tmp + 1;
}
+#endif
/* <= because sizeof includes the nul byte at the end. Not quite right,
because it should include the length of the symbol + "\037[VF]" instead
@@ -1390,7 +1401,6 @@ scan_lisp_file (const char *filename, co
backslash-newline) have already been read. */
put_filename (filename); /* XEmacs addition */
- putc ('\n', outfile); /* XEmacs addition */
putc (037, outfile);
putc (type, outfile);
fprintf (outfile, "%s\n", buffer);
diff -r 69a1eda3da06721407d3085ed7aabd1112b22173 -r 061e030e3270035d8cde0206b6e34cff27c697bd lisp/ChangeLog
--- a/lisp/ChangeLog Mon Dec 22 14:07:48 2008 +0000
+++ b/lisp/ChangeLog Sat Dec 27 14:05:50 2008 +0000
@@ -1,3 +1,32 @@ 2008-12-22 Aidan Kehoe <kehoea@parhasa
+2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * loadup.el (load-history):
+ Add the contents of current-load-list to load-history before
+ clearing it. Move the variable declarations earlier in the file to
+ a format understood by make-docfile.c.
+ * custom.el (custom-declare-variable): Add the variable's symbol
+ to the current file's load history entry correctly, don't use a
+ cons. Eliminate a comment that we don't need to worry about, we
+ don't need to check the `initialized' C variable in Lisp.
+ * bytecomp.el (byte-compile-output-file-form):
+ Merge Andreas Schwab's pre-GPLv3 GNU change of 19970831 here;
+ treat #'custom-declare-variable correctly, generating the
+ docstrings in a format understood by make-docfile.c.
+ * loadhist.el (symbol-file): Correct behaviour for checking
+ autoloaded macros and functions when supplied with a TYPE
+ argument. Accept fully-qualified paths from
+ #'built-in-symbol-file; if a path is not fully-qualified, return
+ it relative to lisp-directory if the filename corresponds to a
+ Lisp file, and relative to (concat source-directory "/src/")
+ otherwise.
+ * make-docfile.el (preloaded-file-list):
+ Rationalise some let bindings a little. Use the "-d" argument to
+ make-docfile.c to supply Lisp paths relative to lisp-directory,
+ not absolutely. Add in loadup.el explicitly to the list of files
+ to be processed by make-docfile.c--it doesn't make sense to add it
+ to preloaded-file-list, since that is used for purposes of
+ byte-compilation too.
+
2008-12-22 Aidan Kehoe <kehoea(a)parhasard.net>
* loadhist.el (symbol-file):
diff -r 69a1eda3da06721407d3085ed7aabd1112b22173 -r 061e030e3270035d8cde0206b6e34cff27c697bd lisp/bytecomp.el
--- a/lisp/bytecomp.el Mon Dec 22 14:07:48 2008 +0000
+++ b/lisp/bytecomp.el Sat Dec 27 14:05:50 2008 +0000
@@ -1881,10 +1881,12 @@ With argument, insert value in current b
;; defalias calls are output directly by byte-compile-file-form-defmumble;
;; it does not pay to first build the defalias in defmumble and then parse
;; it here.
- (if (and (memq (car-safe form) '(defun defmacro defvar defconst autoload))
+ (if (and (memq (car-safe form) '(defun defmacro defvar defconst autoload
+ custom-declare-variable))
(stringp (nth 3 form)))
(byte-compile-output-docform nil nil '("\n(" 3 ")") form nil
- (eq (car form) 'autoload))
+ (memq (car form)
+ '(autoload custom-declare-variable)))
(let ((print-escape-newlines t)
(print-length nil)
(print-level nil)
diff -r 69a1eda3da06721407d3085ed7aabd1112b22173 -r 061e030e3270035d8cde0206b6e34cff27c697bd lisp/custom.el
--- a/lisp/custom.el Mon Dec 22 14:07:48 2008 +0000
+++ b/lisp/custom.el Sat Dec 27 14:05:50 2008 +0000
@@ -203,9 +203,7 @@ keyword in your own programs. "
;; Do the actual initialization.
(unless custom-dont-initialize
(funcall initialize symbol default)))
- ;; #### This is a rough equivalent of LOADHIST_ATTACH. However,
- ;; LOADHIST_ATTACH also checks for `initialized'.
- (push (cons 'defvar symbol) current-load-list)
+ (push symbol current-load-list)
(run-hooks 'custom-define-hook)
symbol)
diff -r 69a1eda3da06721407d3085ed7aabd1112b22173 -r 061e030e3270035d8cde0206b6e34cff27c697bd lisp/loadhist.el
--- a/lisp/loadhist.el Mon Dec 22 14:07:48 2008 +0000
+++ b/lisp/loadhist.el Sat Dec 27 14:05:50 2008 +0000
@@ -39,6 +39,8 @@
;; load-history is a list of entries that look like this:
;; ("outline" outline-regexp ... (require . wid-edit) ... (provide . outline) ...)
+;; XEmacs; this function is in subr.el in GNU, and does not deal with
+;; built-in symbols.
(defun symbol-file (sym &optional type)
"Return the input source from which SYM was loaded.
This is a file name, or nil if the source was a buffer with no associated file.
@@ -52,40 +54,44 @@ return faces created with `make-face' or
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 symbol-details)
- (when (and
- (eq 'autoload
- (car-safe (setq autoload-cons
- (and (fboundp sym)
- (symbol-function sym)))))
- (or (and (or (null type) (eq 'defvar type))
- (eq (fifth autoload-cons) 'keymap))
- (and (or (null type) (eq 'defvar type))
- (memq (fifth autoload-cons) '(nil macro)))))
- (return-from look-up-symbol-file
- (locate-library (second autoload-cons))))
- (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)))))
+ (let (built-in-file autoload-cons symbol-details)
+ (cond ((and (eq 'autoload
+ (car-safe
+ (setq autoload-cons
+ (and (fboundp sym) (symbol-function sym)))))
+ (or (and (or (null type) (eq 'defvar type))
+ (eq (fifth autoload-cons) 'keymap))
+ (and (or (null type) (eq 'defun type))
+ (memq (fifth autoload-cons) '(nil macro)))))
+ (return (locate-library (second autoload-cons))))
+ ((eq 'defvar type)
+ ;; Load history entries corresponding to variables are just
+ ;; symbols.
+ (dolist (entry load-history)
+ (when (memq sym (cdr entry))
+ (return (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 (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 (car entry))))))
+ (when (setq built-in-file (built-in-symbol-file sym type))
+ (if (equal built-in-file (file-truename built-in-file))
+ ;; Probably a full path name:
+ built-in-file
+ ;; This is a bit heuristic, but shouldn't realistically be a
+ ;; problem:
+ (if (string-match "\.elc?$" built-in-file)
+ (concat lisp-directory built-in-file)
+ (concat source-directory "/src/" built-in-file))))))
(defun feature-symbols (feature)
"Return the file and list of symbols associated with a given FEATURE."
diff -r 69a1eda3da06721407d3085ed7aabd1112b22173 -r 061e030e3270035d8cde0206b6e34cff27c697bd lisp/loadup.el
--- a/lisp/loadup.el Mon Dec 22 14:07:48 2008 +0000
+++ b/lisp/loadup.el Sat Dec 27 14:05:50 2008 +0000
@@ -31,6 +31,12 @@
;; If you are wanting to add files to be dumped into your local version of
;; XEmacs, DO NOT add them here. Use site-init.el or site-load.el instead.
+;; ***Note the docstrings for the variables in this file. They follow the
+;; conventions described in lib-src/make-docfile.c, and any new variables or
+;; functions added to this file should follow those conventions too, since
+;; this file is always loaded uncompiled, and the byte-compiler never gets a
+;; chance to format the docstrings in the way make-docfile.c understands.
+
;; This is loaded into a bare XEmacs to make a dumpable one.
;;; Code:
@@ -47,27 +53,27 @@
(when (fboundp 'error)
(error "loadup.el already loaded!"))
-(defconst running-xemacs t
- "Non-nil when the current emacs is XEmacs.")
+(defconst running-xemacs t "\
+Non-nil when the current emacs is XEmacs.")
;; Can't make this constant for now because it causes an error in
;; update-elc.el.
-(defvar source-lisp (file-name-directory (expand-file-name
- (nth 2 command-line-args)))
- "Root of tree containing the Lisp source code for the current build.
+(defvar source-lisp (file-name-directory (expand-file-name (nth 2 command-line-args))) "\
+Root of tree containing the Lisp source code for the current build.
Differs from `lisp-directory' if this XEmacs has been installed. ")
-(defconst build-directory (expand-file-name ".." invocation-directory)
- "Root of tree containing object files and executables produced by build.
+(defconst build-directory (expand-file-name ".." invocation-directory) "\
+Root of tree containing object files and executables produced by build.
Differs from `source-directory' if configured with --srcdir option, a practice
recommended for developers.")
-(defconst source-directory (expand-file-name ".." source-lisp)
- "Root of tree containing source code for the current build.
+(defconst source-directory (expand-file-name ".." source-lisp) "\
+Root of tree containing source code for the current build.
Used during loadup and for documenting source of symbols defined in C.")
-(defvar preloaded-file-list nil
- "List of files preloaded into the XEmacs binary image.")
+(defvar preloaded-file-list nil "\
+List of Lisp files preloaded into the XEmacs binary image,
+with the exception of `loadup.el'.")
;(start-profiling)
@@ -206,7 +212,15 @@ Used during loadup and for documenting s
;; See also "site-load" above.
(when (stringp site-start-file)
(load "site-init" t))
-(setq current-load-list nil)
+;; Add information from this file to the load history:
+(setq load-history (cons (nreverse current-load-list) load-history)
+ ;; Clear current-load-list; this (and adding information to
+ ;; load-history) is normally done in lread.c after reading the
+ ;; entirety of a file, something which never happens for loadup.el.
+ current-load-list nil)
+;; Make the path to this file look a little nicer:
+(setcar (car load-history) (file-truename (caar load-history)))
+
(garbage-collect)
;;; At this point, we're ready to resume undo recording for scratch.
diff -r 69a1eda3da06721407d3085ed7aabd1112b22173 -r 061e030e3270035d8cde0206b6e34cff27c697bd lisp/make-docfile.el
--- a/lisp/make-docfile.el Mon Dec 22 14:07:48 2008 +0000
+++ b/lisp/make-docfile.el Sat Dec 27 14:05:50 2008 +0000
@@ -151,36 +151,50 @@
(load "setup-paths.el")
(load "raw-process.el")
-(let (preloaded-file-list)
+(let (preloaded-file-list arg0 arg package-preloaded-file-list)
(load (expand-file-name "dumped-lisp.el" source-lisp))
- (let ((package-preloaded-file-list
- (packages-collect-package-dumped-lisps late-package-load-path)))
-
- (setq preloaded-file-list
- (append package-preloaded-file-list
- preloaded-file-list
- packages-hardcoded-lisp)))
+ (setq package-preloaded-file-list
+ (packages-collect-package-dumped-lisps late-package-load-path)
+ preloaded-file-list
+ (append package-preloaded-file-list
+ preloaded-file-list
+ packages-hardcoded-lisp)
+
+ processed (cons "-d" processed)
+ processed (cons source-lisp processed)
+ ;; Include loadup.el, which is never in preloaded-file-list:
+ processed (cons "loadup.el" processed))
(while preloaded-file-list
- (let ((arg0 (packages-add-suffix (car preloaded-file-list)))
- arg)
- (setq arg (locate-library arg0))
- (if (null arg)
- (progn
+ (setq arg0 (packages-add-suffix (car preloaded-file-list))
+ arg (locate-library arg0))
+ (if (null arg)
+ (progn
(message "Error: dumped file %s does not exist" arg0)
;; Uncomment in case of difficulties
- ;;(message "late-package-hierarchies: %S" late-package-hierarchies)
- ;;(message "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-root-p))
- ;;(message "guessed-data-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-data-root-p))
- )
- (if (null (member arg processed))
- (progn
- (if (and (null docfile-out-of-date)
- (file-newer-than-file-p arg docfile))
- (setq docfile-out-of-date t))
- (setq processed (cons arg processed)))))
- (setq preloaded-file-list (cdr preloaded-file-list)))))
+ ;(message "late-package-hierarchies: %S"
+ ; late-package-hierarchies)
+ ;(message "guessed-roots: %S" (paths-find-emacs-roots
+ ; invocation-directory
+ ; invocation-name
+ ; #'paths-emacs-root-p))
+ ;(message "guessed-data-roots: %S" (paths-find-emacs-roots
+ ; invocation-directory
+ ; invocation-name
+ ; #'paths-emacs-data-root-p))
+ )
+ (when (equal arg (expand-file-name arg0 source-lisp))
+ ;; Use relative paths where possible, since this makes file lookup
+ ;; in an installed XEmacs easier:
+ (setq arg arg0))
+ (if (null (member arg processed))
+ (progn
+ (if (and (null docfile-out-of-date)
+ (file-newer-than-file-p arg docfile))
+ (setq docfile-out-of-date t))
+ (setq processed (cons arg processed)))))
+ (setq preloaded-file-list (cdr preloaded-file-list))))
;; Finally process the list of site-loaded files.
(if site-file-list
diff -r 69a1eda3da06721407d3085ed7aabd1112b22173 -r 061e030e3270035d8cde0206b6e34cff27c697bd src/ChangeLog
--- a/src/ChangeLog Mon Dec 22 14:07:48 2008 +0000
+++ b/src/ChangeLog Sat Dec 27 14:05:50 2008 +0000
@@ -1,3 +1,13 @@ 2008-12-22 Aidan Kehoe <kehoea@parhasa
+2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * doc.c (Fbuilt_in_symbol_file):
+ Return a subr's filename immediately if we've found it. Check for
+ compiled function and compiled macro docstrings in DOC too, and
+ return them if they exist.
+ The branch of the if statement focused on functions may have
+ executed, but we may still want to check variable bindings; an
+ else clause isn't appropriate.
+
2008-12-22 Aidan Kehoe <kehoea(a)parhasard.net>
* symbols.c (Fdefine_function):
diff -r 69a1eda3da06721407d3085ed7aabd1112b22173 -r 061e030e3270035d8cde0206b6e34cff27c697bd src/doc.c
--- a/src/doc.c Mon Dec 22 14:07:48 2008 +0000
+++ b/src/doc.c Sat Dec 27 14:05:50 2008 +0000
@@ -531,11 +531,33 @@ If TYPE is `defvar', then variable defin
return Qnil;
}
else
- filename = get_object_file_name
- (make_int (- (EMACS_INT) XSUBR (fun)->doc));
- }
- }
- else if (EQ(Fboundp(symbol), Qt) && (EQ(type, Qnil) || EQ(type, Qdefvar)))
+ {
+ filename = get_object_file_name
+ (make_int (- (EMACS_INT) XSUBR (fun)->doc));
+ return filename;
+ }
+ }
+
+ if (COMPILED_FUNCTIONP (fun) || (CONSP(fun) &&
+ (EQ (Qmacro, Fcar_safe (fun)))
+ && (fun = Fcdr_safe (fun),
+ COMPILED_FUNCTIONP (fun))))
+ {
+ Lisp_Object tem;
+ Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
+
+ if (! (f->flags.documentationp))
+ return Qnil;
+ tem = compiled_function_documentation (f);
+ if (NATNUMP (tem) || CONSP (tem))
+ {
+ filename = get_object_file_name (tem);
+ return filename;
+ }
+ }
+ }
+
+ if (EQ(Fboundp(symbol), Qt) && (EQ(type, Qnil) || EQ(type, Qdefvar)))
{
Lisp_Object doc_offset = Fget (symbol, Qvariable_documentation, Qnil);
@@ -551,9 +573,11 @@ If TYPE is `defvar', then variable defin
{
filename = get_object_file_name(doc_offset);
}
- }
- }
- return filename;
+ return filename;
+ }
+ }
+
+ return Qnil;
}
DEFUN ("documentation", Fdocumentation, 1, 2, 0, /*
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Allow compilation under Cygwin 1.7
16 years, 8 months
Aidan Kehoe
changeset: 4575:112f6ed4429915e2b374be688228895bbfcbc18a
parent: 4573:7ca6d57ce12d6c3b7ee6c297ae1122d179277db4
user: acs@samwise
date: Sat Dec 27 21:23:16 2008 -0500
files: src/ChangeLog src/syswindows.h
description:
Allow compilation under Cygwin 1.7
diff -r 7ca6d57ce12d6c3b7ee6c297ae1122d179277db4 -r 112f6ed4429915e2b374be688228895bbfcbc18a src/ChangeLog
--- a/src/ChangeLog Sat Dec 27 15:30:50 2008 +0000
+++ b/src/ChangeLog Sat Dec 27 21:23:16 2008 -0500
@@ -1,3 +1,8 @@ 2008-12-22 Aidan Kehoe <kehoea@parhasa
+2008-12-27 Vin Shelton <acs(a)xemacs.org>
+
+ * syswindows.h: Don't define wide character interfaces for Cygwin
+ 1.7 and up.
+
2008-12-22 Aidan Kehoe <kehoea(a)parhasard.net>
* symbols.c (Fdefine_function):
diff -r 7ca6d57ce12d6c3b7ee6c297ae1122d179277db4 -r 112f6ed4429915e2b374be688228895bbfcbc18a src/syswindows.h
--- a/src/syswindows.h Sat Dec 27 15:30:50 2008 +0000
+++ b/src/syswindows.h Sat Dec 27 21:23:16 2008 -0500
@@ -479,7 +479,7 @@ typedef LPCDLGTEMPLATE LPCDLGTEMPLATEA;
#define BIF_NEWDIALOGSTYLE 64
#endif
-#ifdef CYGWIN
+#if defined (CYGWIN) && (CYGWIN_VERSION_DLL_COMBINED < 190)
/* All but wcscmp and wcslen left out of Cygwin headers -- but present
in /usr/include/mingw/string.h! */
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
carbon2-commit: Clarify syntax in configure.ac following Vladimir Ivanovic's change.
16 years, 8 months
Aidan Kehoe
changeset: 4573:7ca6d57ce12d6c3b7ee6c297ae1122d179277db4
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sat Dec 27 15:30:50 2008 +0000
files: ChangeLog configure.ac
description:
Clarify syntax in configure.ac following Vladimir Ivanovic's change.
2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
* configure.ac: Vladimir Ivanovic's change of 2008-09-17 was
effective, but not correct. The original issue was that m4
stripped [], so "char *v[]" in configure.ac became "char *v" in
configure. His change to configure.ac rendered the declaration
"char **v[]", which is effective but confusing; this change
renders it "char **v".
* configure: Regenerate.
diff -r 0ed907d0f1e9a1106751a8e192b2f7d9578ec016 -r 7ca6d57ce12d6c3b7ee6c297ae1122d179277db4 ChangeLog
--- a/ChangeLog Sat Dec 27 15:28:43 2008 +0000
+++ b/ChangeLog Sat Dec 27 15:30:50 2008 +0000
@@ -1,3 +1,13 @@ 2008-10-25 Stephen J. Turnbull <stephe
+2008-12-27 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * configure.ac: Vladimir Ivanovic's change of 2008-09-17 was
+ effective, but not correct. The original issue was that m4
+ stripped [], so "char *v[]" in configure.ac became "char *v" in
+ configure. His change to configure.ac rendered the declaration
+ "char **v[]", which is effective but confusing; this change
+ renders it "char **v".
+ * configure: Regenerate.
+
2008-10-25 Stephen J. Turnbull <stephen(a)xemacs.org>
* INSTALL: Give better pointers to package documentation.
diff -r 0ed907d0f1e9a1106751a8e192b2f7d9578ec016 -r 7ca6d57ce12d6c3b7ee6c297ae1122d179277db4 configure.ac
--- a/configure.ac Sat Dec 27 15:28:43 2008 +0000
+++ b/configure.ac Sat Dec 27 15:30:50 2008 +0000
@@ -3434,7 +3434,7 @@ dnl Avoid re-AC_DEFINE-ing xmkmf symbols
AC_MSG_CHECKING(the version of X11 being used)
AC_RUN_IFELSE([AC_LANG_SOURCE([#include <X11/Intrinsic.h>
- int main(int c, char **v[]) { return c>1 ? XlibSpecificationRelease : 0; }])],
+ int main(int c, char **v) { return c>1 ? XlibSpecificationRelease : 0; }])],
[./conftest foobar; x11_release=$?],[x11_release=4],[x11_release=4])
AC_MSG_RESULT(R${x11_release})
AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release})
@@ -5582,7 +5582,7 @@ dnl One of the above link tests may have
dnl One of the above link tests may have succeeded but caused resulting
dnl executables to fail to run. Also any tests using AC_RUN_IFELSE will
dnl have reported incorrect results.
-AC_RUN_IFELSE([AC_LANG_SOURCE([int main(int c,char **v[]){return 0;}])],[:],[
+AC_RUN_IFELSE([AC_LANG_SOURCE([int main(int c,char **v){return 0;}])],[:],[
echo ""
echo "*** PANIC *** The C compiler can no longer build working executables."
echo "*** PANIC *** Please examine the tail of config.log for runtime errors."
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches