aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-08-13 23:55:09 +0000
committerRichard M. Stallman1994-08-13 23:55:09 +0000
commiteb426f3a0823744fd04a94a5945d8bdb5b6751c2 (patch)
tree196a49761c1e046edf841d7aa257a7bb9671669a
parent45945a7bc28eacb6d38ae5fd75203069d6bfd14f (diff)
downloademacs-eb426f3a0823744fd04a94a5945d8bdb5b6751c2.tar.gz
emacs-eb426f3a0823744fd04a94a5945d8bdb5b6751c2.zip
(c-macro-expansion): If the CPP output is empty, just show error messages.
-rw-r--r--lisp/progmodes/cmacexp.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el
index daaa0109bb0..a84aa5eb091 100644
--- a/lisp/progmodes/cmacexp.el
+++ b/lisp/progmodes/cmacexp.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1992, 1994 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 1994 Free Software Foundation, Inc.
4 4
5;; Author: Francesco Potorti` <pot@cnuce.cnr.it> 5;; Author: Francesco Potorti` <pot@cnuce.cnr.it>
6;; Version: $Id: cmacexp.el,v 1.14 1994/05/03 22:17:03 kwzh Exp rms $ 6;; Version: $Id: cmacexp.el,v 1.15 1994/08/07 17:23:44 rms Exp rms $
7;; Adapted-By: ESR 7;; Adapted-By: ESR
8;; Keywords: c 8;; Keywords: c
9 9
@@ -305,11 +305,14 @@ Optional arg DISPLAY non-nil means show messages in the echo area."
305 (call-process-region 1 (point-max) "sh" t t nil "-c" 305 (call-process-region 1 (point-max) "sh" t t nil "-c"
306 (concat cppcommand " 2>" tempname))) 306 (concat cppcommand " 2>" tempname)))
307 (if display (message (concat mymsg "done"))) 307 (if display (message (concat mymsg "done")))
308 ;; Find and delete the mark of the start of the expansion. 308 (if (= (buffer-size) 0)
309 ;; Look for `# nn "file.c"' lines and delete them. 309 ;; Empty output is normal after a fatal error.
310 (goto-char (point-min)) 310 (insert "\nPreprocessor produced no output\n")
311 (search-forward startmarker) 311 ;; Find and delete the mark of the start of the expansion.
312 (delete-region 1 (point)) 312 ;; Look for `# nn "file.c"' lines and delete them.
313 (goto-char (point-min))
314 (search-forward startmarker)
315 (delete-region 1 (point)))
313 (while (re-search-forward (concat "^# [0-9]+ \"" 316 (while (re-search-forward (concat "^# [0-9]+ \""
314 (regexp-quote filename) 317 (regexp-quote filename)
315 "\"") nil t) 318 "\"") nil t)