[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [h-e-w] Help with defadvice
From: |
Sunil S. Patel |
Subject: |
Re: [h-e-w] Help with defadvice |
Date: |
Wed, 18 Jun 2003 10:16:53 -0400 |
Try my snippet below...it does something similiar to what you want..
I am by far, an idiot with elisp....and after much struggle I came up with
this below, which work pretty well for me...for VC++ 6.0...issue the M-x
compile, once and the compile line is made, and then you can hit F7 to
recompile just like you do in DevStudio....only drawback with what I have
below, is that you must be visiting a file in the directory, or it doesn't
work...like have a dired of the files is not good enough....I wish I knew
enough to fix that....
; Set up for Visual C++ compiling
(define-key global-map [f7] 'recompile)
(define-key global-map [C-cancel] 'kill-compilation)
(defun my-compile()
"Sets up 'compile-command' to the VC++ .dsp in the current directory"
(interactive)
(make-variable-buffer-local 'compile-command)
; look for the first .dsp file we find
(setq proj-dsp (car (directory-files "./" nil "\\.dsp$")))
; strip off .dsp extension
(if (equal proj-dsp nil)
(setq proj-dsp "PROJ.dsp"))
;(message "project name is '%s'" proj-dsp)
(setq proj-name (file-name-sans-extension proj-dsp))
(setq compile-command
(format "MSDEV %s /MAKE \"%s - Win32 Debug\"" proj-dsp proj-name))
)
(add-hook 'c++-mode-hook 'my-compile)