Commit 8ee04f3a authored by Alan Mackenzie's avatar Alan Mackenzie

Fix bug#5395: typing '#' in an empty C buffer throws "args out of range".

* progmodes/cc-defs.el: (c-set-cpp-delimiters, c-clear-cpp-delimiters):
Check for EOB playing the role of delimiter.
parent bc4b76f1
2010-01-19 Alan Mackenzie <acm@muc.de>
* progmodes/cc-defs.el: Fix bug#5395: typing '#' in an empty
buffer throws "args out of range".
(c-set-cpp-delimiters, c-clear-cpp-delimiters): Check for EOB
playing the role of delimiter.
2010-01-18 Stephen Leake <stephen_leake@member.fsf.org>
* lisp/progmodes/ada-mode.el: Fix bug#5400.
......
......@@ -1217,12 +1217,14 @@ been put there by c-put-char-property. POINT remains unchanged."
;; This macro does a hidden buffer change.
`(progn
(c-put-char-property ,beg 'category 'c-cpp-delimiter)
(c-put-char-property ,end 'category 'c-cpp-delimiter)))
(if (< ,end (point-max))
(c-put-char-property ,end 'category 'c-cpp-delimiter))))
(defmacro c-clear-cpp-delimiters (beg end)
;; This macro does a hidden buffer change.
`(progn
(c-clear-char-property ,beg 'category)
(c-clear-char-property ,end 'category)))
(if (< ,end (point-max))
(c-clear-char-property ,end 'category))))
(defsubst c-comment-out-cpps ()
;; Render all preprocessor constructs syntactically commented out.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment