emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compile.el: save compile-command


From: Stefan Monnier
Subject: Re: compile.el: save compile-command
Date: Fri, 23 Apr 2010 10:36:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux)

>> (insert "-*- mode: " name-of-mode
>> "; default-directory: " (prin1-to-string default-directory)
>> +            "; compile-command: " (prin1-to-string command)
>> " -*-\n"
>> -            (format "%s started at %s\n\n"
>> +            (format "%s started at %s\n"
>> mode-name
>> -                    (substring (current-time-string) 0 19))
>> -            command "\n")
>> +                    (substring (current-time-string) 0 19)) "\n")

> The idea is good, but the output is very ugly: the first line becomes
> too long, and the compile command is no more easy to find and read.

Actually, the other problem is that it's redundant: the compile command
is then printed twice at the beginning of the buffer.  I'd rather tweak
the current format so that the already printed command can be extracted
reliably and then -*- compilation -*- will be sufficient (assuming
compilation-mode can then look for the command and set the
compile-command var appropriately).

> Since your intention was to save the command as a file local variable,
> what do you think about putting an `invisible' property over the added
> `compile-command' in the first line?

Using `invisible' is always asking for trouble, so I'd rather try other
options first.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]