comparison lisp/progmodes/cc-engine.el @ 67626:1e6560c0f57a

(c-after-change-check-<>-operators): After-change-functions should not clobber the match data.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 16 Dec 2005 20:07:40 +0000
parents 04d2abb755d9
children dc49655f57ae 7beb78bc1f8e
comparison
equal deleted inserted replaced
67625:915691b6504f 67626:1e6560c0f57a
3991 ;; chars with paren syntax become part of another operator like "<<" 3991 ;; chars with paren syntax become part of another operator like "<<"
3992 ;; or ">=". 3992 ;; or ">=".
3993 ;; 3993 ;;
3994 ;; This function might do hidden buffer changes. 3994 ;; This function might do hidden buffer changes.
3995 3995
3996 (save-excursion 3996 (save-match-data
3997 (goto-char beg) 3997 (save-excursion
3998 (when (or (looking-at "[<>]")
3999 (< (skip-chars-backward "<>") 0))
4000
4001 (goto-char beg) 3998 (goto-char beg)
4002 (c-beginning-of-current-token)
4003 (when (and (< (point) beg)
4004 (looking-at c-<>-multichar-token-regexp)
4005 (< beg (setq beg (match-end 0))))
4006 (while (progn (skip-chars-forward "^<>" beg)
4007 (< (point) beg))
4008 (c-clear-char-property (point) 'syntax-table)
4009 (forward-char))))
4010
4011 (when (< beg end)
4012 (goto-char end)
4013 (when (or (looking-at "[<>]") 3999 (when (or (looking-at "[<>]")
4014 (< (skip-chars-backward "<>") 0)) 4000 (< (skip-chars-backward "<>") 0))
4015 4001
4002 (goto-char beg)
4003 (c-beginning-of-current-token)
4004 (when (and (< (point) beg)
4005 (looking-at c-<>-multichar-token-regexp)
4006 (< beg (setq beg (match-end 0))))
4007 (while (progn (skip-chars-forward "^<>" beg)
4008 (< (point) beg))
4009 (c-clear-char-property (point) 'syntax-table)
4010 (forward-char))))
4011
4012 (when (< beg end)
4016 (goto-char end) 4013 (goto-char end)
4017 (c-beginning-of-current-token) 4014 (when (or (looking-at "[<>]")
4018 (when (and (< (point) end) 4015 (< (skip-chars-backward "<>") 0))
4019 (looking-at c-<>-multichar-token-regexp) 4016
4020 (< end (setq end (match-end 0)))) 4017 (goto-char end)
4021 (while (progn (skip-chars-forward "^<>" end) 4018 (c-beginning-of-current-token)
4022 (< (point) end)) 4019 (when (and (< (point) end)
4023 (c-clear-char-property (point) 'syntax-table) 4020 (looking-at c-<>-multichar-token-regexp)
4024 (forward-char))))))) 4021 (< end (setq end (match-end 0))))
4022 (while (progn (skip-chars-forward "^<>" end)
4023 (< (point) end))
4024 (c-clear-char-property (point) 'syntax-table)
4025 (forward-char))))))))
4025 4026
4026 ;; Dynamically bound variable that instructs `c-forward-type' to also 4027 ;; Dynamically bound variable that instructs `c-forward-type' to also
4027 ;; treat possible types (i.e. those that it normally returns 'maybe or 4028 ;; treat possible types (i.e. those that it normally returns 'maybe or
4028 ;; 'found for) as actual types (and always return 'found for them). 4029 ;; 'found for) as actual types (and always return 'found for them).
4029 ;; This means that it records them in `c-record-type-identifiers' if 4030 ;; This means that it records them in `c-record-type-identifiers' if