Function: c-font-lock-ids-with-dollar

c-font-lock-ids-with-dollar is a byte-compiled function defined in cc-fonts.el.gz.

Signature

(c-font-lock-ids-with-dollar LIMIT)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-fonts.el.gz
(defun c-font-lock-ids-with-dollar (limit)
  ;; Maybe fontify identifiers with a dollar using `font-lock-warning-face'.
  ;; This is done only for languages which tolerate a $ in ids, and only when
  ;; the flag variable `c-warn-ids-with-dollar' is set to non-nil.  This
  ;; function only works after functions such as `c-font-lock-declarations'
  ;; have already been run.
  ;;
  ;; This function will be called from font-lock for a region bounded by POINT
  ;; and LIMIT, as though it were to identify a keyword for
  ;; font-lock-keyword-face.  It always returns NIL to inhibit this and
  ;; prevent a repeat invocation.  See elisp/lispref page "Search-based
  ;; Fontification".
  (when c-warn-ids-with-dollar
    (let (id-start)
      (while (and (< (point) limit)
		  (skip-chars-forward "^$" limit)
		  (< (point) limit)
		  (eq (char-after) ?$))
	(if (and (memq (c-get-char-property (point) 'face)
		       '(font-lock-variable-name-face
			 font-lock-function-name-face
			 font-lock-type-face))
		 (setq id-start (c-on-identifier)))
	    (progn
	      (goto-char id-start)
	      (looking-at c-identifier-key)
	      (c-put-font-lock-face (match-beginning 0) (match-end 0)
				    'font-lock-warning-face)
	      (goto-char (match-end 0)))
	  (forward-char)))
      nil)))