diff options
author | Alan Mackenzie <acm@muc.de> | 2009-12-10 14:29:11 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2009-12-10 14:29:11 +0000 |
commit | d0fcee66986308f526578b35fde713be47f1bbab (patch) | |
tree | 01b9b1350ae675c74a528e3195278250329c1a48 /lisp/progmodes/cc-mode.el | |
parent | f1943c1ba5cd799e4b24542ef2c0089a42542d69 (diff) | |
download | emacs-d0fcee66986308f526578b35fde713be47f1bbab.tar.gz |
Fix bug#5091: indentation in c++-mode.
* cc-mode.el (c-basic-common-init): make text property `category' rear
non-sticky.
* cc-engine.el (c-ssb-lit-begin): New defsubst, extracted from ....
(c-syntactic-skip-backward): Refactor, extracting the above.
(c-guess-basic-syntax CASEs 5D.3, 5L): Add extra anchor point;
(c-guess-basic-syntax CASE 19): New CASE to handle template construct
continued over line boundary.
(c-guess-basic-syntax CASE 7): don't trigger on '<'.
Diffstat (limited to 'lisp/progmodes/cc-mode.el')
-rw-r--r-- | lisp/progmodes/cc-mode.el | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 49d9ebeb492..14a3533e0e2 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -541,19 +541,15 @@ that requires a literal mode spec at compile time." (make-local-variable 'lookup-syntax-properties) (setq lookup-syntax-properties t))) - ;; Use this in Emacs 21 to avoid meddling with the rear-nonsticky + ;; Use this in Emacs 21+ to avoid meddling with the rear-nonsticky ;; property on each character. (when (boundp 'text-property-default-nonsticky) (make-local-variable 'text-property-default-nonsticky) - (let ((elem (assq 'syntax-table text-property-default-nonsticky))) - (if elem - (setcdr elem t) - (setq text-property-default-nonsticky - (cons '(syntax-table . t) - text-property-default-nonsticky)))) - (setq text-property-default-nonsticky - (cons '(c-type . t) - text-property-default-nonsticky))) + (mapc (lambda (tprop) + (unless (assq tprop text-property-default-nonsticky) + (setq text-property-default-nonsticky + (cons `(,tprop . t) text-property-default-nonsticky)))) + '(syntax-table category c-type))) ;; In Emacs 21 and later it's possible to turn off the ad-hoc ;; heuristic that open parens in column 0 are defun starters. Since |