Commit 498d3768 authored by João Távora's avatar João Távora

Fix bug in Electric Pair mode

* lisp/elec-pair.el (electric-pair--syntax-ppss): Simplify and fix
possible bug.
parent 83451189
2014-04-13 João Távora <joaotavora@gmail.com>
* elec-pair.el (electric-pair--syntax-ppss): Simplify and fix
possible bug.
2014-04-13 Eli Zaretskii <eliz@gnu.org> 2014-04-13 Eli Zaretskii <eliz@gnu.org>
* frame.el (blink-cursor-blinks, blink-cursor-blinks-done): Doc fixes. * frame.el (blink-cursor-blinks, blink-cursor-blinks-done): Doc fixes.
......
...@@ -226,10 +226,9 @@ WHERE is a list defaulting to '(string comment) and indicates ...@@ -226,10 +226,9 @@ WHERE is a list defaulting to '(string comment) and indicates
when to fallback to `parse-partial-sexp'." when to fallback to `parse-partial-sexp'."
(let* ((pos (or pos (point))) (let* ((pos (or pos (point)))
(where (or where '(string comment))) (where (or where '(string comment)))
(quick-ppss (syntax-ppss)) (quick-ppss (syntax-ppss pos))
(quick-ppss-at-pos (syntax-ppss pos)) (in-string (and (nth 3 quick-ppss) (memq 'string where)))
(in-string (and (nth 3 quick-ppss-at-pos) (memq 'string where))) (in-comment (and (nth 4 quick-ppss) (memq 'comment where)))
(in-comment (and (nth 4 quick-ppss-at-pos) (memq 'comment where)))
(s-or-c-start (cond (in-string (s-or-c-start (cond (in-string
(1+ (nth 8 quick-ppss))) (1+ (nth 8 quick-ppss)))
(in-comment (in-comment
...@@ -243,7 +242,7 @@ when to fallback to `parse-partial-sexp'." ...@@ -243,7 +242,7 @@ when to fallback to `parse-partial-sexp'."
;; HACK! cc-mode apparently has some `syntax-ppss' bugs ;; HACK! cc-mode apparently has some `syntax-ppss' bugs
(if (memq major-mode '(c-mode c++ mode)) (if (memq major-mode '(c-mode c++ mode))
(parse-partial-sexp (point-min) pos) (parse-partial-sexp (point-min) pos)
quick-ppss-at-pos)))) quick-ppss))))
;; Balancing means controlling pairing and skipping of parentheses ;; Balancing means controlling pairing and skipping of parentheses
;; so that, if possible, the buffer ends up at least as balanced as ;; so that, if possible, the buffer ends up at least as balanced as
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment