From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: compile.el: save compile-command Date: Fri, 23 Apr 2010 11:37:37 +0300 Organization: JURTA Message-ID: <87iq7ia7g6.fsf@mail.jurta.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272012387 11991 80.91.229.12 (23 Apr 2010 08:46:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 23 Apr 2010 08:46:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: ams@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 23 10:46:23 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O5EWk-0006r3-2f for ged-emacs-devel@m.gmane.org; Fri, 23 Apr 2010 10:46:22 +0200 Original-Received: from localhost ([127.0.0.1]:35700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O5EWj-0000NA-EE for ged-emacs-devel@m.gmane.org; Fri, 23 Apr 2010 04:46:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O5EVb-000823-M8 for emacs-devel@gnu.org; Fri, 23 Apr 2010 04:45:11 -0400 Original-Received: from [140.186.70.92] (port=52233 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O5EVZ-00081H-LS for emacs-devel@gnu.org; Fri, 23 Apr 2010 04:45:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O5EVY-0001La-JZ for emacs-devel@gnu.org; Fri, 23 Apr 2010 04:45:09 -0400 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:38542 helo=mx2.starman.ee) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O5EVV-0001KW-3L; Fri, 23 Apr 2010 04:45:05 -0400 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.29.104.cable.starman.ee [82.131.29.104]) by mx2.starman.ee (Postfix) with ESMTP id A9DA43F412E; Fri, 23 Apr 2010 11:45:01 +0300 (EEST) In-Reply-To: (Alfred M. Szmidt's message of "Thu, 22 Apr 2010 10:57:04 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124108 Archived-At: > This patch stores the compile command in a variable, so that it can be > reused for M-x compile or M-x recompile. > > 2010-04-22 Alfred M. Szmidt > > * progmodes/compile.el (compilation-start): Save COMMAND in > file local variable. > > (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. 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? Then the first line doesn't become longer, and the compile command still is clearly visible where it currently is. -- Juri Linkov http://www.jurta.org/emacs/