From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Inserting "-*- mode: ..." before turning mode on in (compilation-start) Date: Sat, 28 May 2005 07:53:05 -0400 Message-ID: References: <429750D7.1080402@iue.tuwien.ac.at> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1117281925 28547 80.91.229.2 (28 May 2005 12:05:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 28 May 2005 12:05:25 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 28 14:05:20 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dc03u-0002uW-Vq for ged-emacs-devel@m.gmane.org; Sat, 28 May 2005 14:05:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dc08M-00071d-21 for ged-emacs-devel@m.gmane.org; Sat, 28 May 2005 08:09:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dc01o-0002sI-Bz for emacs-devel@gnu.org; Sat, 28 May 2005 08:02:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dc00x-0002Qh-2e for emacs-devel@gnu.org; Sat, 28 May 2005 08:02:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dc00u-0002Ib-9m for emacs-devel@gnu.org; Sat, 28 May 2005 08:02:00 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dbztr-0005AG-MB for emacs-devel@gnu.org; Sat, 28 May 2005 07:54:43 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1DbzsH-0004wM-Q8; Sat, 28 May 2005 07:53:05 -0400 Original-To: Markus Gritsch In-reply-to: <429750D7.1080402@iue.tuwien.ac.at> (message from Markus Gritsch on Fri, 27 May 2005 18:54:47 +0200) 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:37822 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37822 Does this patch give good results? *** compile.el 20 May 2005 17:56:45 -0400 1.356 --- compile.el 28 May 2005 05:02:27 -0400 *************** *** 935,946 **** (substitute-env-vars (match-string 1 command)) "~") default-directory)) (erase-buffer) ! ;; output a mode setter, for saving and later reloading this buffer (insert "-*- mode: " name-of-mode "; default-directory: " (prin1-to-string default-directory) ! " -*-\n" command "\n") ! (setq thisdir default-directory)) (set-buffer-modified-p nil)) ;; If we're already in the compilation buffer, go to the end ;; of the buffer, so point will track the compilation output. --- 935,954 ---- (substitute-env-vars (match-string 1 command)) "~") default-directory)) + ;; Select the desired mode. + (if (not (eq mode t)) + (funcall mode) + (setq buffer-read-only nil) + (with-no-warnings (comint-mode)) + (compilation-shell-minor-mode)) + (if highlight-regexp + (set (make-local-variable 'compilation-highlight-regexp) + highlight-regexp)) (erase-buffer) ! ;; Output a mode setter, for saving and later reloading this buffer. (insert "-*- mode: " name-of-mode "; default-directory: " (prin1-to-string default-directory) ! " -*-\n" command "\n") (setq thisdir default-directory)) (set-buffer-modified-p nil)) ;; If we're already in the compilation buffer, go to the end ;; of the buffer, so point will track the compilation output. *************** *** 963,976 **** ;; don't override users' setting of $EMACS. (unless (getenv "EMACS") '("EMACS=t")) (copy-sequence process-environment)))) - (if (not (eq mode t)) - (funcall mode) - (setq buffer-read-only nil) - (with-no-warnings (comint-mode)) - (compilation-shell-minor-mode)) - (if highlight-regexp - (set (make-local-variable 'compilation-highlight-regexp) - highlight-regexp)) (set (make-local-variable 'compilation-arguments) (list command mode name-function highlight-regexp)) (set (make-local-variable 'revert-buffer-function) --- 971,976 ----