emacs-devel
[Top][All Lists]
Advanced

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

Re: Inserting "-*- mode: ..." before turning mode on in (compilation-sta


From: Markus Gritsch
Subject: Re: Inserting "-*- mode: ..." before turning mode on in (compilation-start)
Date: Sat, 28 May 2005 14:05:23 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.1) Gecko/20040707

Richard Stallman wrote:
Does this patch give good results?

Yes, it works perfectly now.

Thank you,
Markus

*** 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 ----





reply via email to

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