summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2017-12-20 21:14:19 -0500
committerGlenn Morris <rgm@gnu.org>2017-12-20 21:14:19 -0500
commit0482fa774cbb978c8b61f80ced844554b61655f0 (patch)
tree144318becad6ecc50415f0eba360ef917f7dd6ea /lisp
parent9f1c613b07e4a745671af5818366660e3765984d (diff)
parent89cfdbf729bc731331358e0efc69547547aa3ca2 (diff)
downloademacs-0482fa774cbb978c8b61f80ced844554b61655f0.tar.gz
emacs-0482fa774cbb978c8b61f80ced844554b61655f0.tar.bz2
emacs-0482fa774cbb978c8b61f80ced844554b61655f0.zip
Merge from origin/emacs-26
89cfdbf Don't mess up syntax-ppss cache in electric-pair (Bug#29710) c5061d8 * etc/emacs.appdata.xml: Update file format. 080f227 Use utf-8-hfs-unix on macOS (Bug#29712) 28e0261 * lisp/progmodes/cc-defs.el (c-version): Update to 5.33.1. ac53084 Improve fix for Bug#29712 ffd4771 * doc/lispref/sequences.texi (Sequence Functions): Improve in... f274cbd Avoid reordering of output in 'shr-insert-document' 7890864 Improve documentation of 'invisible-p' a1327bb Remove one more check that Vframe_list is non-nil 63b6281 Fix off-by-one error in 'css--hex-color' 804b37c Save and restore text-pixel height and width of frames (Bug#2... 777fe94 Partially revert "Mention new strictness for &optional, &rest... ad17db7 * lisp/vc/smerge-mode.el (smerge-refine): Respect font-lock-m... 5a7d009 * lisp/vc/smerge-mode.el (smerge-refine): Replace obsolete al... e019c35 FOR_EACH_FRAME no longer assumes frame-list d64b88d * src/font.c (Ffont_info): Doc fix. (Bug#29682) 92b2604 Modernise message.el face spec syntax b1efbe6 Update message.el obsolete face aliases 2494c14 ; * lisp/comint.el (comint-terminfo-terminal): Add a :version... 12ad276 Improve documentation of TERM environment variable 8ed529f Add option to configure comint TERM 889f07c Better support utf-8-with-signature and utf-8-hfs in XML/HTML a2697fa * lisp/menu-bar.el (menu-bar-mode): Doc fix. ffb50ea ; * etc/NEWS: Fix last change. 95606af Fix Bug#29712 in tramp-tests.el 9bf66c6 Don't run FOR_EACH_FRAME when there's no frame left (Bug#29961) c2a88ec * lisp/textmodes/tex-mode.el: Ensure uncompiled file is loada... b178870 Remember password change for IMAP in Gnus (Bug#29692) a21dac1 Add %DUMBFW to the default GnuTLS priority strings 780407c Small fixes prompted by make check-declare 541a601 Fix some custom groups e220d6e Fix fontification of first declaration within a C++ lambda form. aa66da2 * src/data.c (Fadd_variable_watcher): Doc fix. f838210 Fix misfontification of C++ member initialization list after ... 232c646 Fix doc-string of Fbuffer_list 3f9aac6 Don't raise an extraneous frame (bug#29696) e7b1111 Mention new strictness for &optional, &rest in arglists (Bug#... 4cb8696 Don't misfontify "foo ()" inside C++ initialization parenthes... ce31e72 Fixes for defcustoms, prompted by cus-test-opts aacd1e1 * lisp/net/newst-backend.el (newsticker--raw-url-list-default... 7e2f4d3 * lisp/htmlfontify.el (hfy-which-etags): Fix it. 52d2a69 Add missing :version tags revealed by cusver-check f5d0360 Escape column-zero doc parens 45099bb Remove ObjC blocks (Bug#23753) b0369d0 Import the latest IVD_Sequences.txt cd53b63 Fix dired-do-compress when tar doesn't default to stdin (Bug#... 51911da Suppress warnings during elisp completion macroexpansion a36a090 * lisp/progmodes/verilog-mode.el (verilog-mode): Fix typo (Bu... 6a6e8e6 Make tramp-interrupt-process more robust 5bcd468 Make quail-input-method work when inhibit-read-only is non-ni... 87baf12 Fix 'fontset-name-p' d231587 Fix fontset documentation inconsistencies for bug#29630 a829cb8 Remove sentence from child frames section in Elisp manual ad491c8 Avoid crashes in 'font-at' after 'set-fontset-font' c73d2cd * lisp/files-x.el (connection-local-set-profile-variables): F... cefca2b Add /etc/ssl/cert.pem to gnutls-trustfiles for macOS 122e726 Fix tool-tip display when display margins are non-zero by def... e1cc203 Handle hash tables and vectors when reading/writing EIEIO obj... cda219c Improve interactive debugging commands in xdisp.c 1056b3c Fix calculation of continuation_pixel_width in display engine 90e2080 Improve documentation of 'save-abbrevs'. 14f0230 Improve documentation of Dired 161b0e5 * lisp/bookmark.el (bookmark-alist): Doc fix. (Bug#29551) 7eea314 Minor Tramp fixes c0a670a * lisp/help-mode.el (help-function-def): Allow help-make-xref... 0572016 Fix doc-string of 'display-buffer-in-side-window' a1bbc49 Fix Bug#29579 cb3d979 ; NEWS: Update Org version number 445eefd Backport: Update Org to v9.1.4 5381c70 In windows.texi mention special splitting behavior of side an... 46d62b9 * lisp/gnus/gnus-group.el (gnus-group-mode-map): Bind [follow... 1ef1dbd Avoid compilation warning in xterm.c 5cf3c26 * README: Document all the top-level directories. (Bug#29558) e9ea206 Don't enable erc modules on simply loading erc.el 4b06af0 Allow shr to use data: URLs without encoding 1fdac2d Don't add newlines in minibuffer history de68f33 modhelp.py: Support Python 3 (Bug#24954) afb04f7 Use forward slashes for python w32 config example (Bug#21656) 04e5b28 Fix bug in i18n/l10n optimization 8227087 Let autoload-compute-prefix be set file-locally (Bug#29471) 98ca7d5 Improve edit-kbd-macro prompting in case of remapped keys (Bu... c02c1f6 Add tests on electric-indentation and Python multiline string... 946bb6d Disable electric indent for python strings (Bug#29305) 35f1ed1 ; ChangeLog.2: Fix bug reference. ac31663 Fix buffer overflow in fontname conversion (Bug#29523) bf9b972 Fix byte compilation of files with leading directories ac144dc * lisp/files.el (make-backup-file-name-1): Fix scoping error. 1b351c8 Revert Tramp commit from 2017-11-20 77cf972 Improve documentation of buffer-list commands and features 66ec92a Fix backing up remote files in local directories on MS-Windows 7e61e74 * doc/emacs/mule.texi (Output Coding): Clarify sendmail coding. 1e25cd7 Revert "Fix backing up remote files in local directories on M... f52d795 Fix a typo in ELisp manual bf26fc3 * lisp/composite.el (find-composition): Fix a typo in the doc... 34a21c3 ; Auto-commit of loaddefs files. 8c8b673 Fix backing up remote files in local directories on MS-Windows 8eb6870 Fix vertical cursor motion in pixel-scroll.el 625e84f Fix typos in doc strings of message.el 9292276 Fix a typo in the Emacs manual 42509c0 Improve the documentation of 'table-insert-sequence' 93dc7ae Port better to QNX ad99550 Make tramp-test42-auto-load more robust af0ce33 ; * lisp/composite.el (find-composition): Fix a typo in last ... bdbcdba Avoid assertions in find-composition 408862f ; * lisp/emacs-lisp/bytecomp.el: Tweak message formatting in ... 9964db4 Restore obsolete method of changing byte-compile-dest-file 3dd25ae Some minor Tramp corrections d670a15 * doc/misc/url.texi (http/https): Fix typo 99d07e8 Remove some bogus definition-prefixes from loaddefs
Diffstat (limited to 'lisp')
-rw-r--r--lisp/elec-pair.el25
1 files changed, 22 insertions, 3 deletions
diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el
index 7f523d1df45..a980f51d3c0 100644
--- a/lisp/elec-pair.el
+++ b/lisp/elec-pair.el
@@ -24,6 +24,7 @@
;;; Code:
(require 'electric)
+(eval-when-compile (require 'cl-lib))
;;; Electric pairing.
@@ -222,6 +223,22 @@ inside a comment or string."
(electric-pair-mode nil))
(self-insert-command 1)))
+(cl-defmacro electric-pair--with-uncached-syntax ((table &optional start) &rest body)
+ "Like `with-syntax-table', but flush the syntax-ppss cache afterwards.
+Use this instead of (with-syntax-table TABLE BODY) when BODY
+contains code which may update the syntax-ppss cache. This
+includes calling `parse-partial-sexp' and any sexp-based movement
+functions when `parse-sexp-lookup-properties' is non-nil. The
+cache is flushed from position START, defaulting to point."
+ (declare (debug ((form &optional form) body)) (indent 1))
+ (let ((start-var (make-symbol "start")))
+ `(let ((syntax-propertize-function nil)
+ (,start-var ,(or start '(point))))
+ (unwind-protect
+ (with-syntax-table ,table
+ ,@body)
+ (syntax-ppss-flush-cache ,start-var)))))
+
(defun electric-pair--syntax-ppss (&optional pos where)
"Like `syntax-ppss', but sometimes fallback to `parse-partial-sexp'.
@@ -240,7 +257,8 @@ when to fallback to `parse-partial-sexp'."
(skip-syntax-forward " >!")
(point)))))
(if s-or-c-start
- (with-syntax-table electric-pair-text-syntax-table
+ (electric-pair--with-uncached-syntax (electric-pair-text-syntax-table
+ s-or-c-start)
(parse-partial-sexp s-or-c-start pos))
;; HACK! cc-mode apparently has some `syntax-ppss' bugs
(if (memq major-mode '(c-mode c++ mode))
@@ -293,7 +311,8 @@ If point is not enclosed by any lists, return ((t) . (t))."
(cond ((< direction 0)
(condition-case nil
(eq (char-after pos)
- (with-syntax-table table
+ (electric-pair--with-uncached-syntax
+ (table)
(matching-paren
(char-before
(scan-sexps (point) 1)))))
@@ -323,7 +342,7 @@ If point is not enclosed by any lists, return ((t) . (t))."
(save-excursion
(while (not outermost)
(condition-case err
- (with-syntax-table table
+ (electric-pair--with-uncached-syntax (table)
(scan-sexps (point) (if (> direction 0)
(point-max)
(- (point-max))))