comparison lisp/progmodes/cmacexp.el @ 26318:94efc4f944a4

progmodes/cmacexp.el (c-macro-preprocessor): Find the Solaris cpp.
author Sam Steingold <sds@gnu.org>
date Tue, 02 Nov 1999 23:19:22 +0000
parents fb6b9c37cdc4
children 7d91ceb03536
comparison
equal deleted inserted replaced
26317:fc5dd3bb9922 26318:94efc4f944a4
43 ;; INSTALLATION ====================================================== 43 ;; INSTALLATION ======================================================
44 44
45 ;; Put the following in your ~/.emacs file. 45 ;; Put the following in your ~/.emacs file.
46 46
47 ;; If you want the *Macroexpansion* window to be not higher than 47 ;; If you want the *Macroexpansion* window to be not higher than
48 ;; necessary: 48 ;; necessary:
49 ;;(setq c-macro-shrink-window-flag t) 49 ;;(setq c-macro-shrink-window-flag t)
50 ;; 50 ;;
51 ;; If you use a preprocessor other than /lib/cpp (be careful to set a 51 ;; If you use a preprocessor other than /lib/cpp (be careful to set a
52 ;; -C option or equivalent in order to make the preprocessor not to 52 ;; -C option or equivalent in order to make the preprocessor not to
53 ;; strip the comments): 53 ;; strip the comments):
110 ;; Solaris has it in an unusual place. 110 ;; Solaris has it in an unusual place.
111 ((and (string-match "^[^-]*-[^-]*-\\(solaris\\|sunos5\\)" 111 ((and (string-match "^[^-]*-[^-]*-\\(solaris\\|sunos5\\)"
112 system-configuration) 112 system-configuration)
113 (file-exists-p "/opt/SUNWspro/SC3.0.1/bin/acomp")) 113 (file-exists-p "/opt/SUNWspro/SC3.0.1/bin/acomp"))
114 "/opt/SUNWspro/SC3.0.1/bin/acomp -C -E") 114 "/opt/SUNWspro/SC3.0.1/bin/acomp -C -E")
115 ((file-exists-p "/usr/ccs/lib/cpp") "/usr/ccs/lib/cpp -C")
115 (t "/lib/cpp -C")) 116 (t "/lib/cpp -C"))
116 "The preprocessor used by the cmacexp package. 117 "The preprocessor used by the cmacexp package.
117 118
118 If you change this, be sure to preserve the `-C' (don't strip comments) 119 If you change this, be sure to preserve the `-C' (don't strip comments)
119 option, or to set an equivalent one." 120 option, or to set an equivalent one."
203 (goto-char (point-min)) 204 (goto-char (point-min))
204 (c-mode) 205 (c-mode)
205 (let ((oldwinheight (window-height)) 206 (let ((oldwinheight (window-height))
206 (alreadythere ;the window was already there 207 (alreadythere ;the window was already there
207 (get-buffer-window (current-buffer))) 208 (get-buffer-window (current-buffer)))
208 (popped nil)) ;the window popped changing the layout 209 (popped nil)) ;the window popped changing the layout
209 (or alreadythere 210 (or alreadythere
210 (progn 211 (progn
211 (display-buffer (current-buffer) t) 212 (display-buffer (current-buffer) t)
212 (setq popped (/= oldwinheight (window-height))))) 213 (setq popped (/= oldwinheight (window-height)))))
213 (if (and c-macro-shrink-window-flag ;user wants fancy shrinking :\) 214 (if (and c-macro-shrink-window-flag ;user wants fancy shrinking :\)
245 ;; If START is inside a comment, prepend "*/" and append "/*" to the 246 ;; If START is inside a comment, prepend "*/" and append "/*" to the
246 ;; #line directive. If inside a string, prepend and append "\"". 247 ;; #line directive. If inside a string, prepend and append "\"".
247 ;; Preprocess the buffer contents, then look for all the lines stored 248 ;; Preprocess the buffer contents, then look for all the lines stored
248 ;; in linelist starting from end of buffer. The last line so found is 249 ;; in linelist starting from end of buffer. The last line so found is
249 ;; where START was, so return the substring from point to end of 250 ;; where START was, so return the substring from point to end of
250 ;; buffer. 251 ;; buffer.
251 (let ((inbuf (current-buffer)) 252 (let ((inbuf (current-buffer))
252 (outbuf (get-buffer-create " *C Macro Expansion*")) 253 (outbuf (get-buffer-create " *C Macro Expansion*"))
253 (filename (if (and buffer-file-name 254 (filename (if (and buffer-file-name
254 (string-match (regexp-quote default-directory) 255 (string-match (regexp-quote default-directory)
255 buffer-file-name)) 256 buffer-file-name))