summaryrefslogtreecommitdiff
path: root/lisp/electric.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-10-23 02:50:48 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-10-23 02:50:48 -0700
commit394bdb8f2317e312d39e071b588581802dd3027a (patch)
tree159fc5496fbecff8760a3c434e82f95f67e99e61 /lisp/electric.el
parent46288dd6321e2ff4028781383660786050933304 (diff)
parent50fa7d64d36c3f2d6ab11e7136575fbca7012cae (diff)
downloademacs-394bdb8f2317e312d39e071b588581802dd3027a.tar.gz
emacs-394bdb8f2317e312d39e071b588581802dd3027a.tar.bz2
emacs-394bdb8f2317e312d39e071b588581802dd3027a.zip
Merge from origin/emacs-25
50fa7d6 ;* src/w32heap.c: Fix typo and wording of the comments. 6f1325e electric-quote mode no longer worries about coding c2a1792 * src/regex.c (re_search_2): Make new code safe for -Wjump-mi... f6134bb Port to GCC 6.2.1 + --enable-gcc-warnings b2ba630 Explain how to debug emacsclient lisp errors 9da53e2 Let describe-function work for lambda again 5c2da93 Fix kill-line's docstring ad66b3f Fix handling of allocation in regex matching 5a26c9b * lisp/electric.el (electric-quote-mode): Improve doc (Bug#24... 3877c91 vc-region-history: Search just on lines intersecting the region 8988327 Fix documentation of 'alist-get' b6998ea * src/regex.h (re_match_object): Improve commentary. # Conflicts: # etc/NEWS # lisp/help-fns.el
Diffstat (limited to 'lisp/electric.el')
-rw-r--r--lisp/electric.el18
1 files changed, 4 insertions, 14 deletions
diff --git a/lisp/electric.el b/lisp/electric.el
index 0ec0a1efba1..f35f8b99db3 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -430,12 +430,6 @@ The variable `electric-layout-rules' says when and how to insert newlines."
:version "25.1"
:type 'boolean :safe 'booleanp :group 'electricity)
-(defun electric--insertable-p (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'.
This requotes when a quoting key is typed."
@@ -460,8 +454,7 @@ This requotes when a quoting key is typed."
(when start
(save-excursion
(if (eq last-command-event ?\`)
- (cond ((and (electric--insertable-p "“")
- (search-backward "‘`" (- (point) 2) t))
+ (cond ((search-backward "‘`" (- (point) 2) t)
(replace-match "“")
(when (and electric-pair-mode
(eq (cdr-safe
@@ -469,16 +462,13 @@ This requotes when a quoting key is typed."
(char-after)))
(delete-char 1))
(setq last-command-event ?“))
- ((and (electric--insertable-p "‘")
- (search-backward "`" (1- (point)) t))
+ ((search-backward "`" (1- (point)) t)
(replace-match "‘")
(setq last-command-event ?‘)))
- (cond ((and (electric--insertable-p "”")
- (search-backward "’'" (- (point) 2) t))
+ (cond ((search-backward "’'" (- (point) 2) t)
(replace-match "”")
(setq last-command-event ?”))
- ((and (electric--insertable-p "’")
- (search-backward "'" (1- (point)) t))
+ ((search-backward "'" (1- (point)) t)
(replace-match "’")
(setq last-command-event ?’)))))))))