]> code.delx.au - gnu-emacs/commitdiff
Electric quote if coding is undecided or no conv
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 8 Aug 2015 16:47:37 +0000 (09:47 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 8 Aug 2015 16:48:04 +0000 (09:48 -0700)
* lisp/electric.el (electric--insertable-p): Also say that a
string is insertable if the buffer file coding system is undecided
or uses no conversion, as curved quotes will work in either case.

lisp/electric.el

index ca05c8c7f07f30e8319473bda8f39f1a2a88df37..8ca09316bcbf3dba441202cf0fb36223073130b3 100644 (file)
@@ -428,8 +428,10 @@ The variable `electric-layout-rules' says when and how to insert newlines."
   :type 'boolean :safe 'booleanp :group 'electricity)
 
 (defun electric--insertable-p (string)
-  (not (unencodable-char-position nil nil buffer-file-coding-system
-                                  nil string)))
+  (or (not buffer-file-coding-system)
+      (eq (coding-system-base buffer-file-coding-system) 'undecided)
+      (not (unencodable-char-position nil nil buffer-file-coding-system
+                                      nil string))))
 
 (defun electric-quote-post-self-insert-function ()
   "Function that ‘electric-quote-mode’ adds to ‘post-self-insert-hook’.