Mercurial > emacs
comparison lisp/progmodes/cmacexp.el @ 8537:fcddf3261917
(c-macro-expansion): If the CPP output is empty, just show error messages.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 13 Aug 1994 23:55:09 +0000 |
parents | 1a837ee93535 |
children | ccfc2ca24a90 |
comparison
equal
deleted
inserted
replaced
8536:b97057eb17d3 | 8537:fcddf3261917 |
---|---|
1 ;;; cmacexp.el --- expand C macros in a region | 1 ;;; cmacexp.el --- expand C macros in a region |
2 | 2 |
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 |
10 ;; This file is part of GNU Emacs. | 10 ;; This file is part of GNU Emacs. |
11 | 11 |
303 (if display (message mymsg)) | 303 (if display (message mymsg)) |
304 (setq exit-status | 304 (setq exit-status |
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) |
316 (beginning-of-line) | 319 (beginning-of-line) |
317 (let ((beg (point))) | 320 (let ((beg (point))) |