Function: c-before-change-include-<>

c-before-change-include-<> is a byte-compiled function defined in cc-mode.el.gz.

Signature

(c-before-change-include-<> BEG END)

Documentation

Remove category/syntax-table properties from each #include <..>.

In particular, from the < and > characters which have been marked as parens using these properties. This is done on every such #include <..> with a portion between BEG and END.

This function is used solely as a member of c-get-state-before-change-functions where it should appear early, before c-depropertize-CPP. It should be used only together with c-after-change-include-<>.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-mode.el.gz
(defun c-before-change-include-<> (beg end)
  "Remove category/syntax-table properties from each #include <..>.
In particular, from the < and > characters which have been marked as parens
using these properties.  This is done on every such #include <..> with a
portion between BEG and END.

This function is used solely as a member of
`c-get-state-before-change-functions' where it should appear early, before
`c-depropertize-CPP'.  It should be used only together with
`c-after-change-include-<>'."
  (c-save-buffer-state ((search-end (progn (goto-char end)
					   (c-end-of-macro)
					   (point)))
			hash-pos)
    (goto-char beg)
    (c-beginning-of-macro)
    (while (and (< (point) search-end)
		(search-forward-regexp c-cpp-include-key search-end 'bound)
		(setq hash-pos (match-beginning 0)))
      (c-forward-comments (c-point 'eoll))
      (when (and (< (point) search-end)
		 (looking-at "\\s(")
		 (looking-at "\\(<\\)[^>\n\r]*\\(>\\)?")
		 (not (cdr (c-semi-pp-to-literal hash-pos))))
	(c-unmark-<-or->-as-paren (match-beginning 1))
	(when (< hash-pos c-new-BEG)
	  (setq c-new-BEG hash-pos))
	(when (match-beginning 2)
	  (c-unmark-<-or->-as-paren (match-beginning 2))
	  (when (> (match-end 2) c-new-END)
	    (setq c-new-END (match-end 2))))))))