|
From: | Stefan Monnier |
Subject: | Re: Why the odd interactive form in byte-compile-file? |
Date: | Wed, 15 Jan 2014 09:46:50 -0500 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
>> > Is there some deeper reason we're not using code that looks like this? >> > (interactive >> > (list (read-file-name (if current-prefix-arg >> > "Byte compile and load file: " >> > "Byte compile file: ")) >> > current-prefix-arg)) >> The current ‘interactive’ form supplies DIR and DEFAULT-FILENAME args to >> ‘read-file-name’ if the current buffer is Emacs Lisp (ish). Those are >> available to the user via ‘M-n’. > Why is that useful? Because you can compile the current buffer's file by just hitting RET. > The current interactive form results in filenames without paths being left > in file-name-history when accepting the default filename with RET. Yes, that's a bug. We shouldn't pass "file-name" to read-file-name but buffer-file-name instead. Stefan
[Prev in Thread] | Current Thread | [Next in Thread] |