aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2007-07-11 19:38:21 +0000
committerMichael Albinus2007-07-11 19:38:21 +0000
commitdb8af973954fda8e7204929b6efbd82f41ca05f8 (patch)
tree0943f2db5411dde05d43882c509a41a4e0510d9f
parent82c4728d3b54cd752853c9a24c3bd7a1f507b68b (diff)
downloademacs-db8af973954fda8e7204929b6efbd82f41ca05f8.tar.gz
emacs-db8af973954fda8e7204929b6efbd82f41ca05f8.zip
* progmodes/compile.el (compilation-start): `start-process' must
still be redefined when calling `start-process-shell-command'. * progmodes/gud.el (gud-file-name): When `default-directory' is a remote file name, prepend its remote part to the filename. (gud-common-init): When `default-directory' is a remote file name, make the filename relative to it. Based on a patch by Nick Roberts <nickrob@snap.net.nz>.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/progmodes/compile.el31
-rw-r--r--lisp/progmodes/gud.el14
3 files changed, 45 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2bf592f7acd..b4ca74d8198 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12007-07-11 Michael Albinus <michael.albinus@gmx.de>
2
3 * progmodes/compile.el (compilation-start): `start-process' must
4 still be redefined when calling `start-process-shell-command'.
5
6 * progmodes/gud.el (gud-file-name): When `default-directory' is a
7 remote file name, prepend its remote part to the filename.
8 (gud-common-init): When `default-directory' is a remote file name,
9 make the filename relative to it.
10 Based on a patch by Nick Roberts <nickrob@snap.net.nz>.
11
12007-07-11 Dan Nicolaescu <dann@ics.uci.edu> 122007-07-11 Dan Nicolaescu <dann@ics.uci.edu>
2 13
3 * vc-hooks.el (vc-default-mode-line-string): Add a mouse face, 14 * vc-hooks.el (vc-default-mode-line-string): Add a mouse face,
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 31fd7741a25..94def936fb9 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1098,7 +1098,8 @@ Returns the compilation buffer created."
1098 (unless (getenv "EMACS") 1098 (unless (getenv "EMACS")
1099 (list "EMACS=t")) 1099 (list "EMACS=t"))
1100 (list "INSIDE_EMACS=t") 1100 (list "INSIDE_EMACS=t")
1101 (copy-sequence process-environment)))) 1101 (copy-sequence process-environment)))
1102 (start-process (symbol-function 'start-process)))
1102 (set (make-local-variable 'compilation-arguments) 1103 (set (make-local-variable 'compilation-arguments)
1103 (list command mode name-function highlight-regexp)) 1104 (list command mode name-function highlight-regexp))
1104 (set (make-local-variable 'revert-buffer-function) 1105 (set (make-local-variable 'revert-buffer-function)
@@ -1114,13 +1115,27 @@ Returns the compilation buffer created."
1114 (funcall compilation-process-setup-function)) 1115 (funcall compilation-process-setup-function))
1115 (compilation-set-window-height outwin) 1116 (compilation-set-window-height outwin)
1116 ;; Start the compilation. 1117 ;; Start the compilation.
1117 (let ((proc (if (eq mode t) 1118 (let ((proc
1118 (get-buffer-process 1119 (if (eq mode t)
1119 (with-no-warnings 1120 ;; comint uses `start-file-process'.
1120 (comint-exec outbuf (downcase mode-name) 1121 (get-buffer-process
1121 shell-file-name nil `("-c" ,command)))) 1122 (with-no-warnings
1122 (start-process-shell-command (downcase mode-name) 1123 (comint-exec outbuf (downcase mode-name)
1123 outbuf command)))) 1124 shell-file-name nil `("-c" ,command))))
1125 ;; Redefine temporarily `start-process' in order to
1126 ;; handle remote compilation.
1127 (fset 'start-process
1128 (lambda (name buffer program &rest program-args)
1129 (apply
1130 (if (file-remote-p default-directory)
1131 'start-file-process
1132 start-process)
1133 name buffer program program-args)))
1134 (unwind-protect
1135 (start-process-shell-command (downcase mode-name)
1136 outbuf command)
1137 ;; Unwindform: Reset original definition of `start-process'.
1138 (fset 'start-process start-process)))))
1124 ;; Make the buffer's mode line show process state. 1139 ;; Make the buffer's mode line show process state.
1125 (setq mode-line-process '(":%s")) 1140 (setq mode-line-process '(":%s"))
1126 (set-process-sentinel proc 'compilation-sentinel) 1141 (set-process-sentinel proc 'compilation-sentinel)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 57eed959f8b..97144fec83b 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -237,7 +237,7 @@ Used to grey out relevant toolbar icons.")
237 ([menu-bar run] menu-item 237 ([menu-bar run] menu-item
238 ,(propertize "run" 'face 'font-lock-doc-face) gud-run 238 ,(propertize "run" 'face 'font-lock-doc-face) gud-run
239 :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb))) 239 :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb)))
240 ([menu-bar go] menu-item 240 ([menu-bar go] menu-item
241 ,(propertize " go " 'face 'font-lock-doc-face) gud-go 241 ,(propertize " go " 'face 'font-lock-doc-face) gud-go
242 :visible (and (not gud-running) 242 :visible (and (not gud-running)
243 (eq gud-minor-mode 'gdba))) 243 (eq gud-minor-mode 'gdba)))
@@ -292,6 +292,11 @@ Used to grey out relevant toolbar icons.")
292(defun gud-file-name (f) 292(defun gud-file-name (f)
293 "Transform a relative file name to an absolute file name. 293 "Transform a relative file name to an absolute file name.
294Uses `gud-<MINOR-MODE>-directories' to find the source files." 294Uses `gud-<MINOR-MODE>-directories' to find the source files."
295 ;; When `default-directory' is a remote file name, prepend its
296 ;; remote part to f, which is the local file name. Fortunately,
297 ;; `file-remote-p' returns exactly this remote file name part (or
298 ;; nil otherwise).
299 (setq f (concat (or (file-remote-p default-directory) "") f))
295 (if (file-exists-p f) (expand-file-name f) 300 (if (file-exists-p f) (expand-file-name f)
296 (let ((directories (gud-val 'directories)) 301 (let ((directories (gud-val 'directories))
297 (result nil)) 302 (result nil))
@@ -2510,7 +2515,10 @@ comint mode, which see."
2510 (while (and w (not (eq (car w) t))) 2515 (while (and w (not (eq (car w) t)))
2511 (setq w (cdr w))) 2516 (setq w (cdr w)))
2512 (if w 2517 (if w
2513 (setcar w file))) 2518 (setcar w
2519 (if (file-remote-p default-directory)
2520 (setq file (file-name-nondirectory file))
2521 file))))
2514 (apply 'make-comint (concat "gud" filepart) program nil 2522 (apply 'make-comint (concat "gud" filepart) program nil
2515 (if massage-args (funcall massage-args file args) args)) 2523 (if massage-args (funcall massage-args file args) args))
2516 ;; Since comint clobbered the mode, we don't set it until now. 2524 ;; Since comint clobbered the mode, we don't set it until now.
@@ -3114,7 +3122,7 @@ class of the file (using s to separate nested class ids)."
3114 'syntax-table (eval-when-compile 3122 'syntax-table (eval-when-compile
3115 (string-to-syntax "> b"))) 3123 (string-to-syntax "> b")))
3116 ;; Make sure that rehighlighting the previous line won't erase our 3124 ;; Make sure that rehighlighting the previous line won't erase our
3117 ;; syntax-table property. 3125 ;; syntax-table property.
3118 (put-text-property (1- (match-beginning 0)) (match-end 0) 3126 (put-text-property (1- (match-beginning 0)) (match-end 0)
3119 'font-lock-multiline t) 3127 'font-lock-multiline t)
3120 nil))))) 3128 nil)))))