(ii) Remove category text props, not syntax-table ones in unmarking <, >.
+2010-02-25 Alan Mackenzie <acm@muc.de>
+
+ * progmodes/cc-engine.el (c-clear-<-pair-props)
+ (c-clear->-pair-props): Correct to wipe category text props, not
+ syntax-table ones.
+
+ * progmodes/cc-mode.el (c-after-change): Remove any hard
+ syntax-table properties for <, > which, e.g., C-y has
+ inopportunely converted from category properties.
+
2010-02-24 Chong Yidong <cyd@stupidchicken.com>
* files.el (hack-local-variables-filter): For eval forms, also
(c-go-list-forward))
(when (equal (c-get-char-property (1- (point)) 'syntax-table)
c->-as-paren-syntax) ; should always be true.
- (c-clear-char-property (1- (point)) 'syntax-table))
- (c-clear-char-property pos 'syntax-table))))
+ (c-clear-char-property (1- (point)) 'category))
+ (c-clear-char-property pos 'category))))
(defun c-clear->-pair-props (&optional pos)
;; POS (default point) is at a > character. If it is marked with
(c-go-up-list-backward))
(when (equal (c-get-char-property (point) 'syntax-table)
c-<-as-paren-syntax) ; should always be true.
- (c-clear-char-property (point) 'syntax-table))
- (c-clear-char-property pos 'syntax-table))))
+ (c-clear-char-property (point) 'category))
+ (c-clear-char-property pos 'category))))
(defun c-clear-<>-pair-props (&optional pos)
;; POS (default point) is at a < or > character. If it has an
(widen)
(save-excursion
(if c-get-state-before-change-functions
- (let ((beg (point-min))
- (end (point-max)))
- (mapc (lambda (fn)
- (funcall fn beg end))
- c-get-state-before-change-functions)))
+ (mapc (lambda (fn)
+ (funcall fn (point-min) (point-max)))
+ c-get-state-before-change-functions))
(if c-before-font-lock-function
(funcall c-before-font-lock-function (point-min) (point-max)
(- (point-max) (point-min))))))
(when (> beg end)
(setq beg end)))
+ ;; C-y is capable of spuriously converting category properties
+ ;; c-</>-as-paren-syntax into hard syntax-table properties. Remove
+ ;; these when it happens.
+ (c-clear-char-property-with-value beg end 'syntax-table
+ c-<-as-paren-syntax)
+ (c-clear-char-property-with-value beg end 'syntax-table
+ c->-as-paren-syntax)
+
(c-trim-found-types beg end old-len) ; maybe we don't need all of these.
(c-invalidate-sws-region-after beg end)
(c-invalidate-state-cache beg)