Kevin Rodgers wrote:


Sometimes it is useful for files to supply local values for this variable.
You might also use mode hooks to specify it in certain modes, like this:

    (add-hook 'c-mode-hook
       (lambda ()
     (unless (or (file-exists-p "makefile")
             (file-exists-p "Makefile"))
       (set (make-local-variable 'compile-command)
        (concat "make -k "
                (file-name-sans-extension buffer-file-name))))))


Thanks a lot. I added the following lines in my .emacs and it's working.

(if
    (or (file-exists-p "makefile") (file-exists-p "Makefile"))
    (set 'compile-command "make -k ")
  (set 'compile-command (concat "gcc " buffer-file-name)))


Regards, GVK _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to