diff options
author | Alan Mackenzie <acm@muc.de> | 2010-02-25 21:21:25 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2010-02-25 21:21:25 +0000 |
commit | 8a249abc87b8775c9412fe3a1bed73e429cdacab (patch) | |
tree | 516d027319670bd360490000442141a4d35e28e6 /lisp/progmodes | |
parent | ed20a012b845a6e6dc7b0c037e5cf0b8e54ab4d1 (diff) | |
download | emacs-8a249abc87b8775c9412fe3a1bed73e429cdacab.tar.gz |
(i) Remove any hard syntax-table properties for <, > inserted by C-y.
(ii) Remove category text props, not syntax-table ones in unmarking <, >.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/cc-engine.el | 8 | ||||
-rw-r--r-- | lisp/progmodes/cc-mode.el | 16 |
2 files changed, 15 insertions, 9 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 3b7f6e4ea0a..336e2c39262 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -4929,8 +4929,8 @@ comment at the start of cc-engine.el for more info." (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 @@ -4946,8 +4946,8 @@ comment at the start of cc-engine.el for more info." (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 diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 57f87c04b88..7f9ed6436f4 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -642,11 +642,9 @@ compatible with old code; callers should always specify it." (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)))))) @@ -1042,6 +1040,14 @@ Note that the style variables are always made local to the buffer." (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) |