From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 9ce1d38: Use curved quotes in core elisp diagnostics Date: Fri, 21 Aug 2015 16:39:16 +0200 Message-ID: <87zj1kr9ij.fsf@mbork.pl> References: <20150816160149.9416.80132@vcs.savannah.gnu.org> <55D1043C.3030909@yandex.ru> <20150816225346.GA5367@acm.fritz.box> <55D2C080.2000806@cs.ucla.edu> <87wpwt5619.fsf@gnu.org> <55D36CB5.10803@cs.ucla.edu> <878u9879q9.fsf@igel.home> <19BD5D76-06A0-4FC0-A46F-760B2C27D321@gmail.com> <55D39B49.8000807@yandex.ru> <55D5DCA8.2080806@yandex.ru> <871tewoia8.fsf@elephly.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1440167988 29868 80.91.229.3 (21 Aug 2015 14:39:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Aug 2015 14:39:48 +0000 (UTC) To: Dmitry Gutov , yandros@gmail.com, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 21 16:39:40 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZSnTo-0007DW-Eu for ged-emacs-devel@m.gmane.org; Fri, 21 Aug 2015 16:39:40 +0200 Original-Received: from localhost ([::1]:41918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSnTn-0007RI-Ur for ged-emacs-devel@m.gmane.org; Fri, 21 Aug 2015 10:39:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSnTj-0007R3-J7 for emacs-devel@gnu.org; Fri, 21 Aug 2015 10:39:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZSnTd-00028s-Ep for emacs-devel@gnu.org; Fri, 21 Aug 2015 10:39:35 -0400 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:36790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSnTd-00028K-2s; Fri, 21 Aug 2015 10:39:29 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 67C686F2003; Fri, 21 Aug 2015 16:39:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5d2SIE4ho74R; Fri, 21 Aug 2015 16:39:21 +0200 (CEST) Original-Received: from localhost (103-115.echostar.pl [213.156.103.115]) by mail.mojserwer.eu (Postfix) with ESMTPSA id AA1F7572005; Fri, 21 Aug 2015 16:39:21 +0200 (CEST) In-reply-to: <871tewoia8.fsf@elephly.net> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:5e00:2:52::8 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:189047 Archived-At: On 2015-08-21, at 15:58, Ricardo Wurmus wrote: > Dmitry Gutov writes: > >> typopunc.el is authored by Oliver Scholz who seems to have copyright=20 >> assignment signed, but the wiki page contains a lot of code snippets=20 >> seemingly required to get the most out of the package. > > I=E2=80=99m using typopunct.el and all I needed was this: > > (require 'typopunct) > (typopunct-change-language 'english t) > > It=E2=80=99s taking care of placing the typographically correct quotes = and > dashes=E2=80=94such as these=E2=80=94when I type =E2=80=98'=E2=80=99 or= a series of dashes. > > When I don=E2=80=99t want this to happen I first hit =E2=80=98C-q=E2=80= =99 before typing =E2=80=98'=E2=80=99, > =E2=80=98"=E2=80=99, or =E2=80=98-=E2=80=99. Modifying these character= s depending on context is all > typopunct does by default, and without any additional configuration. > > ~~ Ricardo I'm also using typopunct, though I am not very happy with it. The advantage is that it is easy to add rules for another language, and to switch languages on the fly: --8<---------------cut here---------------start------------->8--- (require 'typopunct) (add-to-list 'typopunct-language-alist `(polish ,(decode-char 'ucs #x201E) ; opening-double-q (outer) ,(decode-char 'ucs #x201D) ; closing-double-q (outer) )) ; closing-single-q (inner) (setq-default typopunct-buffer-language 'polish) (defun typopunct-toggle-language () "Turn typopunct-mode on and toggle typopunct language between `polish' and `english'." (interactive) (typopunct-mode 1) (message "Typopunct is on. Language changed to %s." (if (string=3D typopunct-buffer-language "english") (typopunct-change-language "polish") (typopunct-change-language "english")))) (defun typopunct-toggle-or-toggle-language (prefix) "Toggle typopunct on or off; with C-u, toggle the language." (interactive "P") (if prefix (typopunct-toggle-language) (typopunct-mode 'toggle) (message (format "Typopunct is %s.%s" (if typopunct-mode "on" "off") (if typopunct-mode (concat " Current language is " (symbol-name typopunct-buffer-langua= ge) ".") ""))))) (global-set-key (kbd "C-z C-t") 'typopunct-toggle-or-toggle-language) --8<---------------cut here---------------end--------------->8--- The disadvantage is that it probably should be a global minor mode. This is especially important when editing the minibuffer. While I'm in a minibuffer, I can hit C-z C-t to switch it on, but this is cumbersome (and doesn't work in Isearch). Also, typopunct does its work with dashes based on the character before point and not last-command or last-command-event or something like that. Not that it is a bad thing per se, but I'm not sure whether this is the best solution. So, typopunct as it is is definitely not sufficient; at least, it should work in the minibuffer and with Isearch. Best, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University