comparison lisp/progmodes/cc-mode.el @ 61934:35953c818b05

(cc-mode-cpp-program): New user variable. (cc-create-define-alist): Use it instead of the hard-coded string.
author Sam Steingold <sds@gnu.org>
date Fri, 29 Apr 2005 18:23:33 +0000
parents aa748999b8b8
children 5512015ae158
comparison
equal deleted inserted replaced
61933:e555645f13f4 61934:35953c818b05
638 ;; currently no better mode for them, and besides this is legacy. 638 ;; currently no better mode for them, and besides this is legacy.
639 ;;;###autoload (add-to-list 'auto-mode-alist '("\\.y\\(acc\\)?\\'" . c-mode)) 639 ;;;###autoload (add-to-list 'auto-mode-alist '("\\.y\\(acc\\)?\\'" . c-mode))
640 ;;;###autoload (add-to-list 'auto-mode-alist '("\\.lex\\'" . c-mode)) 640 ;;;###autoload (add-to-list 'auto-mode-alist '("\\.lex\\'" . c-mode))
641 641
642 (defvar cc-define-alist nil "Alist of #define directives for GUD tooltips.") 642 (defvar cc-define-alist nil "Alist of #define directives for GUD tooltips.")
643 (defvar cc-mode-cpp-program "/lib/cpp"
644 "*The program name for the CPP pre-processor.")
643 645
644 (defun cc-create-define-alist () 646 (defun cc-create-define-alist ()
645 (let* ((file (buffer-file-name)) 647 (let* ((file (buffer-file-name))
646 (output 648 (output
647 (with-output-to-string 649 (with-output-to-string
648 (with-current-buffer standard-output 650 (with-current-buffer standard-output
649 (call-process "/lib/cpp" 651 (call-process cc-mode-cpp-program
650 file t nil "-dM")))) 652 file t nil "-dM"))))
651 (define-list (split-string output "\n" t)) 653 (define-list (split-string output "\n" t))
652 (name)) 654 (name))
653 (dolist (define define-list) 655 (dolist (define define-list)
654 (setq name (nth 1 (split-string define "[( ]"))) 656 (setq name (nth 1 (split-string define "[( ]")))