(and c-multiline-string-start-char
(not (c-characterp c-multiline-string-start-char))))
(when (and (eq end-literal-type 'string)
- (not (eq (char-before (cdr end-limits)) ?\()))
- (c-remove-string-fences (1- (cdr end-limits)))
+ (not (eq (char-before (cdr end-limits)) ?\())
+ (memq (char-after (car end-limits)) c-string-delims)
+ (equal (c-get-char-property (car end-limits) 'syntax-table)
+ '(15)))
+ (c-remove-string-fences (car end-limits))
(setq c-new-END (max c-new-END (cdr end-limits))))
(when (and (eq beg-literal-type 'string)
;; property changes.
(when (fboundp 'syntax-ppss)
(setq c-syntax-table-hwm most-positive-fixnum))
- (unwind-protect
- (progn
- (c-restore-string-fences (point-min) (point-max))
- (save-restriction
- (save-match-data
- (widen)
+ (save-restriction
+ (save-match-data
+ (widen)
+ (unwind-protect
+ (progn
+ (c-restore-string-fences (point-min) (point-max))
(save-excursion
;; Are we inserting/deleting stuff in the middle of an
;; identifier?
'font-lock-comment-face)
(previous-single-property-change end 'face))
end)))
- (when (>= end1 beg) ; Don't hassle about changes
- ; entirely in comments.
+ (when (>= end1 beg) ; Don't hassle about changes entirely in
+ ; comments.
;; Find a limit for the search for a `c-type' property
(while
(and (/= (skip-chars-backward "^;{}") 0)
(buffer-substring-no-properties (point) type-pos)))
(goto-char end1)
- (skip-chars-forward "^;{}") ;FIXME!!! loop for
- ;comment, maybe
+ (skip-chars-forward "^;{}") ; FIXME!!! loop for
+ ; comment, maybe
(setq lim (point))
(setq term-pos
- (or (c-next-single-property-change end 'c-type nil lim)
- lim))
+ (or (c-next-single-property-change end 'c-type nil lim) lim))
(setq c-maybe-stale-found-type
(list type marked-id
type-pos term-pos
(if c-get-state-before-change-functions
(mapc (lambda (fn)
(funcall fn beg end))
- c-get-state-before-change-functions))
- )))
- ;; The following must be done here rather than in
- ;; `c-after-change' because newly inserted parens would foul
- ;; up the invalidation algorithm.
- (c-invalidate-state-cache beg)
- (c-truncate-lit-pos-cache beg))
- (c-clear-string-fences))))
+ c-get-state-before-change-functions))))
+ (c-clear-string-fences))))
+ (c-truncate-lit-pos-cache beg)
+ ;; The following must be done here rather than in `c-after-change'
+ ;; because newly inserted parens would foul up the invalidation
+ ;; algorithm.
+ (c-invalidate-state-cache beg)))
(defvar c-in-after-change-fontification nil)
(make-variable-buffer-local 'c-in-after-change-fontification)
;; When `combine-after-change-calls' is used we might get calls
;; with regions outside the current narrowing. This has been
;; observed in Emacs 20.7.
- (unwind-protect
- (progn
- (c-restore-string-fences (point-min) (point-max))
- (save-restriction
- (save-match-data ; c-recognize-<>-arglists changes match-data
- (widen)
-
+ (save-restriction
+ (save-match-data ; c-recognize-<>-arglists changes match-data
+ (widen)
+ (unwind-protect
+ (progn
+ (c-restore-string-fences (point-min) (point-max))
(when (> end (point-max))
- ;; Some emacsen might return positions past the
- ;; end. This has been observed in Emacs 20.7 when
- ;; rereading a buffer changed on disk (haven't been
- ;; able to minimize it, but Emacs 21.3 appears to
- ;; work).
+ ;; Some emacsen might return positions past the end. This
+ ;; has been observed in Emacs 20.7 when rereading a buffer
+ ;; changed on disk (haven't been able to minimize it, but
+ ;; Emacs 21.3 appears to work).
(setq end (point-max))
(when (> beg end)
(setq beg end)))
(save-excursion
(mapc (lambda (fn)
(funcall fn beg end old-len))
- c-before-font-lock-functions)))))
- (c-clear-string-fences))))
+ c-before-font-lock-functions)))
+ (c-clear-string-fences))))))
;; A workaround for syntax-ppss's failure to notice syntax-table text
;; property changes.
(when (fboundp 'syntax-ppss)