From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#26891: 26.0.50; Error using lisp-indent-line in eval-expression minibuffer Date: Thu, 11 May 2017 21:11:37 -0400 Message-ID: <87a86ikhfa.fsf@users.sourceforge.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1494551475 6447 195.159.176.226 (12 May 2017 01:11:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 12 May 2017 01:11:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 26891@debbugs.gnu.org To: John Mastro Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 12 03:11:11 2017 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 1d8z6q-0001Y4-Hc for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 May 2017 03:11:08 +0200 Original-Received: from localhost ([::1]:50836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8z6v-00007s-PC for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 May 2017 21:11:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8z6p-00007O-GA for bug-gnu-emacs@gnu.org; Thu, 11 May 2017 21:11:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d8z6k-00087d-AM for bug-gnu-emacs@gnu.org; Thu, 11 May 2017 21:11:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36776) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d8z6k-00086r-1K for bug-gnu-emacs@gnu.org; Thu, 11 May 2017 21:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d8z6j-00050e-PD for bug-gnu-emacs@gnu.org; Thu, 11 May 2017 21:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 May 2017 01:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26891 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26891-submit@debbugs.gnu.org id=B26891.149455141519192 (code B ref 26891); Fri, 12 May 2017 01:11:01 +0000 Original-Received: (at 26891) by debbugs.gnu.org; 12 May 2017 01:10:15 +0000 Original-Received: from localhost ([127.0.0.1]:39453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8z5z-0004zP-Cr for submit@debbugs.gnu.org; Thu, 11 May 2017 21:10:15 -0400 Original-Received: from mail-it0-f67.google.com ([209.85.214.67]:33366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8z5v-0004z1-SN; Thu, 11 May 2017 21:10:12 -0400 Original-Received: by mail-it0-f67.google.com with SMTP id l145so3864839ita.0; Thu, 11 May 2017 18:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=t05pvWqXPYYx99lbk8pWvQHkv8u0xgy2v9WpQtvejFk=; b=QggVkNVmutMMk/cfJJWYpaYJFLarLZ+2NNUShF5OEFe/i4k69Ik+VI2x9C3iUCsiFn vGr4AYXKNeX5OAj7n4ynm7A2i7AfPIXqHxtosDnubcda719xxdolUBcLDRzc+MfDUsvH htCiUzO4ae3Dag8lxjvxR5F7SGufUA0QZFim3HZxXyRduD1tvQWrM4J5i23uhen+6YkX ZOktsy7MFshyyZvRBvHnjYchmLcXnmN9KWDNV2852ZYMz22vG1ztB5mGheiWXk/9vBQh 4O6pTVTywJtuFOB4aRkRgFJNISgRxdMvRKJ5FIrwoB8Hb6LQIZ9E0IK6u+9SezqEBJvh f4AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=t05pvWqXPYYx99lbk8pWvQHkv8u0xgy2v9WpQtvejFk=; b=ZsqWYOJtM84gdzZ0H5arIERRSW1Oy8l8xJVYb/vR58F7FgJRGBIE08zLHqlFR2PWyp msDSIRkzO2+tON3a8ct0McnqclvRLnOL7KilVnPoiyB53OrRNbvTlmXaX9xLi0SbS0yw H+Y3Q4bU27L6vzJPL40USYIj9IH6r3vdUyyK/QO5veTZZA8CokNIAbk6+qHWcmpooaTY kqQv8KGucZRWKJxnD2uQoOi0lQOiEJ0V3VQTu0iK+h99mtbcx9EWH4xLEhpbDQHfw8j/ XBxeQRnr5WEIXb3rQlCQmZXpHbuXMuuTpWOD9Bw2iQgflZgUd1GOUWzqbCVkAX4FDK04 BHqQ== X-Gm-Message-State: AODbwcAzibvPhzHcBjZKaQ7NZ+rMKIeP2yaS7UOTH2a387OuOk3nHsTl S6VvSrHH5/t3pw== X-Received: by 10.36.189.11 with SMTP id x11mr930640ite.16.1494551406268; Thu, 11 May 2017 18:10:06 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id n14sm1601617itg.0.2017.05.11.18.10.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 May 2017 18:10:05 -0700 (PDT) In-Reply-To: (John Mastro's message of "Thu, 11 May 2017 16:34:29 -0700") 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:132452 Archived-At: --=-=-= Content-Type: text/plain tags 26891 patch quit John Mastro writes: > Using lisp-indent-line in an eval-expression minibuffer (i.e. M-:) works > in Emacs 25 but causes a "Text is read-only" error in Emacs 26. > > To reproduce: > 1. Run emacs -Q > 2. Evaluate the code below > 3. Type M-: > 4. Hit TAB > > Here's the code: > > (defun init-eval-expression-minibuffer () > (setq-local indent-line-function #'lisp-indent-line) > (local-set-key (kbd "TAB") #'indent-for-tab-command)) > > (add-hook 'eval-expression-minibuffer-setup-hook > #'init-eval-expression-minibuffer) > > Point will move to the very beginning of the minibuffer (on the "E" in > "Eval") and you'll see a "Text is read only" message. (I called it an > error above but it doesn't actually invoke the debugger even with > debug-on-error and debug-on-signal non-nil). > > It doesn't matter whether you have entered text or not before hitting > TAB. indent-line-to doesn't respect field boundaries (i.e., moves into the "Eval: " prompt text) because it uses backward-to-indentation. This patch to change it to back-to-indentation seems to fix it. I'm not sure why back-to-indentation and backward-to-indentation are inconsistent... --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Make-indent-indent-to-respect-field-boundaries-Bu.patch Content-Description: patch >From 33880d67f0cc567ca5c317f828cc15859dcd9fe7 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 11 May 2017 21:06:33 -0400 Subject: [PATCH v1] Make `indent-indent-to' respect field boundaries (Bug#26891) * lisp/indent.el (indent-line-to): Use `back-to-indentation' instead of `backward-to-indentation'. --- lisp/indent.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/indent.el b/lisp/indent.el index fdd184c799..e7a30b885d 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -285,7 +285,7 @@ indent-line-to "Indent current line to COLUMN. This function removes or adds spaces and tabs at beginning of line only if necessary. It leaves point at end of indentation." - (backward-to-indentation 0) + (back-to-indentation) (let ((cur-col (current-column))) (cond ((< cur-col column) (if (>= (- column (* (/ cur-col tab-width) tab-width)) tab-width) -- 2.11.1 --=-=-=--