From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#23632: 25.1.50; Gratuitous undo boundary in latex-insert-block Date: Fri, 27 May 2016 23:11:21 +0800 Message-ID: <87lh2vo7s6.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1464361948 8942 80.91.229.3 (27 May 2016 15:12:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 May 2016 15:12:28 +0000 (UTC) To: 23632@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 27 17:12:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1b6JQv-0000iw-3I for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 May 2016 17:12:17 +0200 Original-Received: from localhost ([::1]:46550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6JQu-00031q-5n for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 May 2016 11:12:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6JQk-0002ye-Um for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 11:12:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6JQg-0002z3-Ng for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 11:12:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6JQg-0002yy-K6 for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 11:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b6JQg-0002RP-H2 for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 11:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 May 2016 15:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23632 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14643619069359 (code B ref -1); Fri, 27 May 2016 15:12:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 May 2016 15:11:46 +0000 Original-Received: from localhost ([127.0.0.1]:42752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6JQQ-0002Qt-Et for submit@debbugs.gnu.org; Fri, 27 May 2016 11:11:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34931) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6JQO-0002Qh-TN for submit@debbugs.gnu.org; Fri, 27 May 2016 11:11:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6JQI-0002s8-FI for submit@debbugs.gnu.org; Fri, 27 May 2016 11:11:39 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:56836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6JQI-0002rw-Bt for submit@debbugs.gnu.org; Fri, 27 May 2016 11:11:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6JQG-0002bs-8o for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 11:11:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6JQC-0002qI-1j for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 11:11:35 -0400 Original-Received: from mail-pf0-x232.google.com ([2607:f8b0:400e:c00::232]:34635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6JQB-0002q7-RV for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 11:11:31 -0400 Original-Received: by mail-pf0-x232.google.com with SMTP id y69so42625102pfb.1 for ; Fri, 27 May 2016 08:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version; bh=ZMDhM2gM6M5tVMoEvPiEmZtOWA2TQNb5PP93Op6WozY=; b=nMTv/KODLbotoIGZjBZSSU5alKZ4L6gsG74Gy7pW6AGpgR586lPz/XdMYc6x5sU3vf q5AbV9o1VaAoGLsl9agUuXWFKF0WTByy8NR2EQ8CWjOwqQXEZ1YqN1dOmnLrQkfPJFpZ fCX3Gh6SabC1KiS8fdZ6znRXlGPn4NuiX8cCAeMPrxKKX9aqS5rDN7eI8/1FP37EzXKJ 036z0JWBuANC/YTZB4f9eBona/+FiSSVhujiRcfJk7jRzK3Wl8RuHtz1YKUEpBPPLYt3 pQOcIjf7a9qU2FYcoFQ9yxz/Ctm4SwhcX02oYTY++vHKB63Uf3DvMSlannaP8FWYcoW1 AokQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=ZMDhM2gM6M5tVMoEvPiEmZtOWA2TQNb5PP93Op6WozY=; b=BLK620pnSZUJn8vxOqmlSm04IkIeHOBWs4hah+dhs9lrEji6OnXyi06m5hMdavsK5C SRuK8AgnWfk6LUHmwD8mxWc9O/VK/P7sAtic5zvshaDd+LyNfJu0IzkoCwW+ziHHoNBh D9w8efmTZFLKCF2gfoyNiwRMezDE/tVbT/CG2NWhqh/whzBVM3Ppc/L6+MYTkbl3WyOV xzAZiVO9nfs8roWDY+QoekQAaJCMkmksNJfNoqgKan4VmWY8XuLKeH+BKjuxlBnDAyfp tCMH0ZwJBOSgCwo8yxZjp+fhAqrpHgy6DUfoyrCJPuJKJDXB43OfYmT08VHtgkSQmkd4 gWYA== X-Gm-Message-State: ALyK8tIll7QKt61LftayeFp1pfb1BULyi4BxPuyNo5UGeKcE2Pge+bc1rhcKhr9P6psOwA== X-Received: by 10.98.26.18 with SMTP id a18mr23541743pfa.39.1464361890762; Fri, 27 May 2016 08:11:30 -0700 (PDT) Original-Received: from ulysses ([155.69.171.221]) by smtp.gmail.com with ESMTPSA id to9sm28995185pab.27.2016.05.27.08.11.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 May 2016 08:11:29 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:118761 Archived-At: In GNU Emacs 25.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9) 1. emacs -Q foo.tex 2. C-c C-o RET The buffer now contains an `enumerate' skeleton: \begin{enumerate} \item \end{enumerate} 3. C-/ After this undo command, the buffer now contains \begin{ Expected behavior: C-/ should undo the entire effects of C-c C-o, so the buffer should contain nothing at all. You shouldn't need another C-/ to get rid of the "\begin{". This happens because latex-insert-block uses skeleton-insert, in which the "interactor" specified for reading a string is lazily invoked only when the string appears in the skeleton. Hence, the "\begin{" is inserted into the buffer first, and then completing-read is called to ask for the LaTeX block name. The completing-read adds an undo boundary, in the midst of the changes by latex-insert-block. The attached patch, which gets rid of the undo boundary, seems to fix this: --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1539,7 +1539,8 @@ 'tex-latex-block (define-skeleton latex-insert-block "Create a matching pair of lines \\begin{NAME} and \\end{NAME} at point. Puts point on a blank line between them." - (let ((choice (completing-read (format "LaTeX block name [%s]: " + (let* ((buffer-undo-list t) ; Don't add an undo boundary + (choice (completing-read (format "LaTeX block name [%s]: " latex-block-default) (latex-complete-envnames) nil nil nil nil latex-block-default)))