summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cmacexp.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-05-02 12:01:04 +0300
committerEli Zaretskii <eliz@gnu.org>2015-05-02 12:01:04 +0300
commitad7e1143fc6d904bc5a9a0a05536986f53a48cf7 (patch)
tree08b8a20a5b186ad771bb836e49d641179ec8da33 /lisp/progmodes/cmacexp.el
parent8fef8521b20315f211cf5bc11dc15460bed5b579 (diff)
downloademacs-ad7e1143fc6d904bc5a9a0a05536986f53a48cf7.tar.gz
Fix error diagnostics of c-macro-expand
* lisp/progmodes/cmacexp.el (c-macro-expansion): Don't bail out too early if no start-marker string was found -- that generally means cpp exited abnormally, and we still want to show its error messages to the user.
Diffstat (limited to 'lisp/progmodes/cmacexp.el')
-rw-r--r--lisp/progmodes/cmacexp.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el
index 357625d10cf..19d0473c42d 100644
--- a/lisp/progmodes/cmacexp.el
+++ b/lisp/progmodes/cmacexp.el
@@ -364,8 +364,8 @@ Optional arg DISPLAY non-nil means show messages in the echo area."
;; Find and delete the mark of the start of the expansion.
;; Look for `# nn "file.c"' lines and delete them.
(goto-char (point-min))
- (search-forward startmarker)
- (delete-region 1 (point)))
+ (if (search-forward startmarker nil t)
+ (delete-region 1 (point))))
(while (re-search-forward (concat "^# [0-9]+ \""
(regexp-quote filename)
"\"") nil t)