When I do this:
(defun my-dired-mark-for-byte-compile ()
"Mark all .el files which don't have up to date .elc files."
(interactive)
;;(dired-unmark-all-files-no-query)
(dired-mark-sexp '(and
(string-match "\\.el$" name)
(not (file-newer-than-file-p (concat name "c") name)))))
(add-hook 'dired-mode-hook
(defun my-dired-mode-hook ()
(define-key dired-mode-map "b" 'my-dired-mark-for-byte-compile)))
and then press "b" in a dired buffer ~\emacs\elisp containing .el and
.elc files on Win2000, XEmacs crashes. I think the problem is 2-fold:
1. While calling the form (file-newer-than-file-p (concat name "c")
name), dired binds "name" to the whole text in the dired buffer,
not to a single file name.
2. file-newer-than-file-p crashes with such unreasonable "file name".
------
Lisp backtrace follows:
file-newer-than-file-p("..." "..."))
# bind (inhibit-file-name-handlers inhibit-file-name-operation args op)
dired-handler-fn(file-newer-than-file-p "..." "...")
file-newer-than-file-p("\n -rw-rw-rw- 1 Administrator 0 3932 Apr
18 2000 all.elc...dbfrobs.el\n -rw-rw-rw- 1 Administrator 0 8224 Apr 18
2000 c"
"\n -rw-rw-rw- 1 Administrator 0 3932 Apr 18 2000
all.elc...dbfrobs.el\n -rw-rw-rw-
1 Administrator 0 8224 Apr 18 2000 ")
(not (file-newer-than-file-p (concat name "c") name))
(and (string-match "\\.el$" name) (not (file-newer-than-file-p ... name)))
eval((and (string-match "\\.el$" name) (not (file-newer-than-file-p ...
name))
))
# (unwind-protect ...)
# (unwind-protect ...)
# bind (msg count pt buffer-read-only dired-marker-char inode s mode nlink uid
gid size time name sym unflag-p predicate)
dired-mark-sexp((and (string-match "\\.el$" name) (not
(file-newer-than-file-p
... name))))
#<compiled-function nil "...(4)" [dired-mark-sexp (and ... ...)] 2
("c:\\Docum
ents and Settings\\Administrator\\emacs\\elisp\\vlib.elc" . 8163) nil>()
call-interactively(my-dired-mark-for-byte-compile)
command-execute(my-dired-mark-for-byte-compile t)
# bind (_execute_command_keys_ _execute_command_name_ prefix-arg)
execute-extended-command(nil)
# bind (command-debug-status)
call-interactively(execute-extended-command)
# (condition-case ... . error)
# (catch top-level ...)
--------
OS version:
Microsoft Windows 2000 [Version 5.00.2195]
OS: Windows_NT
XEmacs 21.4.8 \"Honest Recruiter (Windows)\" configured for
`i586-pc-win32'.
Building XEmacs in \"f:\\xemacs\\xemacs-21.4-release\\nt\".
Using compiler \"cl -nologo -W3 -O2 -G5 -ML\".
Installing XEmacs in \"c:\\Program Files\\XEmacs\\XEmacs-21.4.8\".
Package path is \"~\\.xemacs;;c:\\Program Files\\XEmacs\\site-packages;c:\\Program
Files\\XEmacs\\xemacs-packages\".
Compiling in support for Microsoft Windows native GUI.
Compiling in support for XPM images.
Compiling in support for GIF images.
Compiling in support for PNG images.
Compiling in support for TIFF images.
Compiling in support for JPEG images.
Compiling in support for X-Face message headers.
Compiling in support for toolbars.
Compiling in support for dialogs.
Compiling in support for widgets.
Compiling in support for native sounds.
Compiling in fast dired implementation.
Using minimal tagbits.
Using indexed lrecord implementation.
Using portable dumper.