From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Patrick Graf Newsgroups: gmane.emacs.bugs Subject: bug#32076: 24.5; Electric behavior of dollar sign using AUCTeX Date: Tue, 10 Jul 2018 07:32:34 +0200 Message-ID: References: <87601pztde.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001eb58805709e756d" X-Trace: blaine.gmane.org 1531201572 23473 195.159.176.226 (10 Jul 2018 05:46:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 10 Jul 2018 05:46:12 +0000 (UTC) To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 32076@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 10 07:46:08 2018 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 1fclTT-0005zF-P5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Jul 2018 07:46:08 +0200 Original-Received: from localhost ([::1]:45853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fclVa-0003kU-JX for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Jul 2018 01:48:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fclUS-0003Fm-Ew for bug-gnu-emacs@gnu.org; Tue, 10 Jul 2018 01:47:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fclUM-0007a9-9M for bug-gnu-emacs@gnu.org; Tue, 10 Jul 2018 01:47:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45074) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fclUM-0007Zz-4c for bug-gnu-emacs@gnu.org; Tue, 10 Jul 2018 01:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fclUL-0005jC-QT for bug-gnu-emacs@gnu.org; Tue, 10 Jul 2018 01:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Patrick Graf Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Jul 2018 05:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32076 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32076-submit@debbugs.gnu.org id=B32076.153120160321992 (code B ref 32076); Tue, 10 Jul 2018 05:47:01 +0000 Original-Received: (at 32076) by debbugs.gnu.org; 10 Jul 2018 05:46:43 +0000 Original-Received: from localhost ([127.0.0.1]:52971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fclU2-0005ie-T2 for submit@debbugs.gnu.org; Tue, 10 Jul 2018 01:46:43 -0400 Original-Received: from mail-lf0-f48.google.com ([209.85.215.48]:34221) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fclGT-0005PH-J2 for 32076@debbugs.gnu.org; Tue, 10 Jul 2018 01:32:42 -0400 Original-Received: by mail-lf0-f48.google.com with SMTP id n96-v6so17172539lfi.1 for <32076@debbugs.gnu.org>; Mon, 09 Jul 2018 22:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=QoC64y/HlMLM3nK9aGp32GP3igT6RqFtLbrvxqAPzOA=; b=fCJ2q8oDP2PqBkEXH6H8+a4PWrfUBMIg+XQFh3OirB0l9YyCiE3RCg3Qw+rQX1MmxK jkyrzWoItekO+oiZLEkbTWGt+9YMQ8lCG+6mPC4JMNY2+SysjSxoQktG6dwjjHtPClZp 2CUx1p+l7KywOZOD941Dv2Vji4YUW2fFq+iiM3FfIPqrEgYr7mZDEUwri1qC/E4NCwE1 peNTaEF2+Y2gQcLV0FR2sGylapjRKitYoPcqIpkvT6YZBOj9oGckVkwqYDYb3X7nyoEV zXe17OypHypCOp/HUoI5jlJpz20ey73yy62GsRurl273YtCwBODSITHxxTHLuQUXZ48+ BvyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=QoC64y/HlMLM3nK9aGp32GP3igT6RqFtLbrvxqAPzOA=; b=Qgu+6I3Pj7gqngd5UFOhBatJFy2Aq9aYN8gNxdtHPNAiDd9eWSB9NIrH5/pwPabFpD mRmmnnydr7iaSu5+w0YLsH1K10vi5yRXr7ak96qZlw7TtzVvrPPyq/9A0zUrliWJBzKq YMCG656Un0ASQXwYqwxjeJL0X8AL7/w0dhuWTI+JXhGWFLzRmSHkGwp1xuV6IKiLynYH vJ6F0qf+fkWboDSfhQufFnyz4jmu3EB8bGbzh3IhJVn5jIfdV1ZgqDRtB3GbJpOfg19/ x7ga8wPWfVcsxGkLZiPUHTfx69Z37rp6PfUv425fVJoJhutC5W3rtRju8WZBLN75Z70g Q9dg== X-Gm-Message-State: APt69E1Hxl1BDXl8fgBXFStVPNd9RHd7+5NjrrRhVkV/pwpuWHy15kT+ qvX8TxTQGbtZa82XYyzlfRvqsKYp+blxWeFp9w== X-Google-Smtp-Source: AAOMgpduWSz8d1LWg6pCBSz4mvya4caxr65QYU9Nx5DAhlUJ55ZjAjuOXJw7s98Ro83sz9dfh7zLmSlcQLg9OFwaqtE= X-Received: by 2002:a19:1113:: with SMTP id g19-v6mr1640458lfi.62.1531200755642; Mon, 09 Jul 2018 22:32:35 -0700 (PDT) Original-Received: by 2002:a19:be4b:0:0:0:0:0 with HTTP; Mon, 9 Jul 2018 22:32:34 -0700 (PDT) In-Reply-To: <87601pztde.fsf@gmail.com> X-Mailman-Approved-At: Tue, 10 Jul 2018 01:46:41 -0400 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:148401 Archived-At: --0000000000001eb58805709e756d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Jo=C3=A3o, sorry for not being self-contained. This was my first GNU bug report ;-) Concerning the fix, I tried texmathp today and indeed it works fine. I have in mind something like the following snippet (to be run whenever $ is hit): (interactive) (if (texmathp) (if (looking-at-p "[$]") (forward-char 1) (insert "$")) (insert "$$") (backward-char 1))) This also takes care of the issue that when I delete the closing $ by hitting backspace and then type $ again, a new pair used to be inserted. A minor drawback is that this only works for $...$ specifically and it requires AUCTeX, which not everybody may be using. But $...$ is good enough for me and if I understand you correctly, one could include texmathp.el in the Emacs source. Cheers, Patrick --0000000000001eb58805709e756d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Jo=C3=A3o,
sorry for not being self-cont= ained. This was my first GNU bug report ;-)
Concerning the fix, I= tried texmathp today and indeed it works fine. I have in mind something li= ke the following snippet (to be run whenever $ is hit):

<= /div>
=C2=A0 (interactive)
=C2=A0 (if (texmathp)
=C2=A0=C2=A0=C2= =A0 (if (looking-at-p "[$]")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (f= orward-char 1)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (insert "$"))=C2=A0=C2=A0=C2=A0 (insert "$$")
=C2=A0=C2=A0=C2=A0 (backward= -char 1)))

This also takes care of the issue t= hat when I delete the closing $ by hitting backspace and then type $ again,= a new pair used to be inserted.
A minor drawback is that this on= ly works for $...$ specifically and it requires AUCTeX, which not everybody= may be using. But $...$ is good enough for me and if I understand you corr= ectly, one could include texmathp.el in the Emacs source.
Cheers,=
Patrick
--0000000000001eb58805709e756d--