From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#24759: 25.1.50; electric-quote-mode Date: Sun, 23 Oct 2016 01:15:47 -0700 Organization: UCLA Computer Science Department Message-ID: <47834b84-fa9c-0596-8986-b7ebb22994f4@cs.ucla.edu> References: <83wph1qxrw.fsf@gnu.org> <74d0a4a5-014e-b365-9d89-ad03a7fc6430@cs.ucla.edu> <83shrori8z.fsf@gnu.org> <87r378b37k.fsf@linux-m68k.org> <48240d67-ab6c-e7ec-9f77-bddbe1c07b83@cs.ucla.edu> <8337jnpn1v.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------753CAB20C91325B65671FFC8" X-Trace: blaine.gmane.org 1477210587 13577 195.159.176.226 (23 Oct 2016 08:16:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 23 Oct 2016 08:16:27 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 Cc: schwab@linux-m68k.org, 24759@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 23 10:16:23 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byDwx-0001XK-Jf for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Oct 2016 10:16:11 +0200 Original-Received: from localhost ([::1]:40101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byDwz-0001mZ-W2 for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Oct 2016 04:16:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byDws-0001lY-Vl for bug-gnu-emacs@gnu.org; Sun, 23 Oct 2016 04:16:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byDwo-0005iW-0S for bug-gnu-emacs@gnu.org; Sun, 23 Oct 2016 04:16:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60185) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1byDwn-0005iQ-Td for bug-gnu-emacs@gnu.org; Sun, 23 Oct 2016 04:16:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1byDwn-0003N2-L3 for bug-gnu-emacs@gnu.org; Sun, 23 Oct 2016 04:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Oct 2016 08:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24759 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24759-submit@debbugs.gnu.org id=B24759.147721055712945 (code B ref 24759); Sun, 23 Oct 2016 08:16:01 +0000 Original-Received: (at 24759) by debbugs.gnu.org; 23 Oct 2016 08:15:57 +0000 Original-Received: from localhost ([127.0.0.1]:47351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byDwj-0003Mj-3M for submit@debbugs.gnu.org; Sun, 23 Oct 2016 04:15:57 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:53442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byDwh-0003MW-5U for 24759@debbugs.gnu.org; Sun, 23 Oct 2016 04:15:55 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7CD2C16100C; Sun, 23 Oct 2016 01:15:49 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 3OhQwbnHcrlC; Sun, 23 Oct 2016 01:15:48 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 87E43160FB1; Sun, 23 Oct 2016 01:15:48 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id UY0mvtbddyZZ; Sun, 23 Oct 2016 01:15:48 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.178.162]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 06427160FF5; Sun, 23 Oct 2016 01:15:48 -0700 (PDT) In-Reply-To: <8337jnpn1v.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124874 Archived-At: This is a multi-part message in MIME format. --------------753CAB20C91325B65671FFC8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Eli Zaretskii wrote: > So I think we should indeed remove the electric--insertable-p test in > electric-quote-mode, on the emacs-25 branch. OK, done with the attached. --------------753CAB20C91325B65671FFC8 Content-Type: text/x-diff; name="0001-electric-quote-mode-no-longer-worries-about-coding.patch" Content-Disposition: attachment; filename*0="0001-electric-quote-mode-no-longer-worries-about-coding.patc"; filename*1="h" Content-Transfer-Encoding: quoted-printable >From da6bd602c8603a23c6c63e4d4676333d91388be0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 23 Oct 2016 01:14:23 -0700 Subject: [PATCH] electric-quote mode no longer worries about coding * doc/emacs/text.texi (Quotation Marks), etc/NEWS: Document this. * lisp/electric.el (electric--insertable-p): Remove. All uses removed (Bug#24759). --- doc/emacs/text.texi | 4 +--- etc/NEWS | 6 ++++++ lisp/electric.el | 21 ++++----------------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 579f788..7fa0804 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -422,9 +422,7 @@ Quotation Marks =20 Electric Quote mode makes it easier to type curved quotes. As you type characters it optionally converts @t{`} to @t{=E2=80=98}, @t{'} to = @t{=E2=80=99}, -@t{``} to @t{=E2=80=9C}, and @t{''} to @t{=E2=80=9D}. These conversions= are -suppressed in buffers whose coding systems cannot represent curved -quote characters. +@t{``} to @t{=E2=80=9C}, and @t{''} to @t{=E2=80=9D}. =20 @vindex electric-quote-paragraph @vindex electric-quote-comment diff --git a/etc/NEWS b/etc/NEWS index 5b89639..a5bcb8d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -38,6 +38,12 @@ fontsets if the default font supports these characters= . Set this variable to nil to disable the new behavior and get back the old behavior. =20 ++++ +** 'electric-quote-mode' is no longer suppressed in a buffer whose +whose coding system cannot represent curved quote characters. +Instead, users can deal with the unrepresentable characters in the +usual way when they save the buffer. + --- ** New variable 'inhibit-compacting-font-caches'. Set this variable to a non-nil value to speed up display of characters diff --git a/lisp/electric.el b/lisp/electric.el index b6697e0..ab9770b 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -430,12 +430,6 @@ electric-quote-paragraph :version "25.1" :type 'boolean :safe 'booleanp :group 'electricity) =20 -(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 @@ electric-quote-post-self-insert-function (when start (save-excursion (if (eq last-command-event ?\`) - (cond ((and (electric--insertable-p "=E2=80=9C") - (search-backward "=E2=80=98`" (- (point) 2) t)= ) + (cond ((search-backward "=E2=80=98`" (- (point) 2) t) (replace-match "=E2=80=9C") (when (and electric-pair-mode (eq (cdr-safe @@ -469,16 +462,13 @@ electric-quote-post-self-insert-function (char-after))) (delete-char 1)) (setq last-command-event ?=E2=80=9C)) - ((and (electric--insertable-p "=E2=80=98") - (search-backward "`" (1- (point)) t)) + ((search-backward "`" (1- (point)) t) (replace-match "=E2=80=98") (setq last-command-event ?=E2=80=98))) - (cond ((and (electric--insertable-p "=E2=80=9D") - (search-backward "=E2=80=99'" (- (point) 2) t)) + (cond ((search-backward "=E2=80=99'" (- (point) 2) t) (replace-match "=E2=80=9D") (setq last-command-event ?=E2=80=9D)) - ((and (electric--insertable-p "=E2=80=99") - (search-backward "'" (1- (point)) t)) + ((search-backward "'" (1- (point)) t) (replace-match "=E2=80=99") (setq last-command-event ?=E2=80=99))))))))) =20 @@ -497,9 +487,6 @@ electric-quote-mode `electric-quote-comment', `electric-quote-string', and `electric-quote-paragraph'. =20 -Electric quoting is suppressed in a buffer whose coding system -cannot represent the replacement characters. - This is a global minor mode. To toggle the mode in a single buffer, use `electric-quote-local-mode'." :global t :group 'electricity --=20 2.7.4 --------------753CAB20C91325B65671FFC8--