From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: compile.el: save compile-command Date: Fri, 23 Apr 2010 10:36:51 -0400 Message-ID: References: <87iq7ia7g6.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272033426 27877 80.91.229.12 (23 Apr 2010 14:37:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 23 Apr 2010 14:37:06 +0000 (UTC) Cc: ams@gnu.org, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 23 16:37:05 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 1O5K08-0004fz-OY for ged-emacs-devel@m.gmane.org; Fri, 23 Apr 2010 16:37:04 +0200 Original-Received: from localhost ([127.0.0.1]:39082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O5K08-0003HH-4u for ged-emacs-devel@m.gmane.org; Fri, 23 Apr 2010 10:37:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O5K03-0003GO-2C for emacs-devel@gnu.org; Fri, 23 Apr 2010 10:36:59 -0400 Original-Received: from [140.186.70.92] (port=48345 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O5K01-0003G1-DP for emacs-devel@gnu.org; Fri, 23 Apr 2010 10:36:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O5Jzz-00034t-Qx for emacs-devel@gnu.org; Fri, 23 Apr 2010 10:36:57 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:44297) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O5Jzz-00034l-OE; Fri, 23 Apr 2010 10:36:55 -0400 Original-Received: from alfajor.home (x-132-204-252-65.xtpr.umontreal.ca [132.204.252.65]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with SMTP id o3NEas6u018601; Fri, 23 Apr 2010 10:36:54 -0400 Original-Received: by alfajor.home (Postfix, from userid 20848) id DC2C14A0CA; Fri, 23 Apr 2010 10:36:51 -0400 (EDT) In-Reply-To: <87iq7ia7g6.fsf@mail.jurta.org> (Juri Linkov's message of "Fri, 23 Apr 2010 11:37:37 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3519=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:124124 Archived-At: >> (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