GNU bug report logs - #26891
26.0.50; Error using lisp-indent-line in eval-expression minibuffer

Previous Next

Package: emacs;

Reported by: John Mastro <john.b.mastro <at> gmail.com>

Date: Thu, 11 May 2017 23:36:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 26.0.50

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26891 in the body.
You can then email your comments to 26891 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#26891; Package emacs. (Thu, 11 May 2017 23:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to John Mastro <john.b.mastro <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 11 May 2017 23:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: John Mastro <john.b.mastro <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; Error using lisp-indent-line in eval-expression minibuffer
Date: Thu, 11 May 2017 16:34:29 -0700
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.

Thanks,

John


In GNU Emacs 26.0.50 (build 4, x86_64-pc-linux-gnu, X toolkit, Xaw3d
scroll bars)
 of 2017-04-26 built on meta
Repository revision: 8f2062d96b0319fc2a837ba9e2c6b67abf31c920
System Description:     Fedora release 25 (Twenty Five)

Recent messages:
Loading /home/jbm/.emacs.d/defuns.el (source)...done
Loading /home/jbm/.emacs.d/local.el (source)...done
Loading /home/jbm/.emacs.d/custom.el (source)...done
Loading /home/jbm/.emacs.d/var/recentf...done
Cleaning up the recentf list...done (0 removed)
Loading /home/jbm/.emacs.d/var/company-statistics-cache.el (source)...done
Starting new Ispell process /usr/bin/aspell with default dictionary...

Configured using:
 'configure --with-xml2 --with-zlib --with-gnutls --with-x-toolkit=lucid
 --without-pop --without-compress-install'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG SOUND NOTIFY GNUTLS LIBXML2 FREETYPE XFT
ZLIB TOOLKIT_SCROLL_BARS LUCID X11

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  flycheck-mode: t
  flyspell-mode: t
  projectile-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  company-statistics-mode: t
  global-company-mode: t
  company-mode: t
  ido-vertical-mode: t
  flx-ido-mode: t
  ido-ubiquitous-mode: t
  ido-everywhere: t
  smartparens-global-strict-mode: t
  paredit-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  winner-mode: t
  which-key-mode: t
  minibuffer-depth-indicate-mode: t
  recentf-mode: t
  whitespace-mode: t
  savehist-mode: t
  save-place-mode: t
  global-auto-revert-mode: t
  show-paren-mode: t
  global-hl-line-mode: t
  delete-selection-mode: t
  auto-compile-on-load-mode: t
  auto-compile-on-save-mode: t
  auto-compile-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort company-ispell mail-extr emacsbug sendmail term/xterm xterm
flycheck find-func bug-reference flyspell ispell company-files
company-keywords company-etags etags xref project company-gtags
company-template company-dabbrev-code company-dabbrev company-capf
dired+ image-dired image-mode image-file dired-x find-dired dired-aux
projectile grep compile ibuffer-vc ibuf-ext ibuffer ibuffer-loaddefs
ibuf-macs git-commit with-editor cl-extra async-bytecomp async tramp-sh
tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
parse-time magit-utils crm log-edit message puny dired dired-loaddefs
format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils
mailheader pcvs-util add-log cl-indent hippie-exp comint ansi-color
company-statistics company smex ido-vertical-mode flx-ido ido-ubiquitous
cus-edit cus-start cus-load ido-completing-read+ ido ace-link avy
smartparens help-mode paredit undo-tree diff winner ring which-key
help-at-pt solarized-moar-theme solarized-theme solarized-definitions
mb-depth recentf tree-widget wid-edit whitespace savehist saveplace
autorevert filenotify time-date paren hl-line server cursor-sensor xclip
edmacro kmacro cc-engine cc-vars cc-defs ivy flx delsel ivy-overlay ffap
thingatpt subr-x pcase auto-compile packed use-package diminish bind-key
easy-mmode finder-inf gh-common gh-profile rx s marshal eieio-compat ht
json map dash advice cl slime-autoloads info package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote inotify dynamic-setting font-render-setting x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 634597 116951)
 (symbols 48 42964 3)
 (miscs 40 77 204)
 (strings 32 97335 116596)
 (string-bytes 1 3181935)
 (vectors 16 86537)
 (vector-slots 8 1896258 303457)
 (floats 8 145 535)
 (intervals 56 372 148)
 (buffers 976 11))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26891; Package emacs. (Fri, 12 May 2017 01:11:01 GMT) Full text and rfc822 format available.

Message #8 received at 26891 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: John Mastro <john.b.mastro <at> gmail.com>
Cc: 26891 <at> debbugs.gnu.org
Subject: Re: bug#26891: 26.0.50;
 Error using lisp-indent-line in eval-expression minibuffer
Date: Thu, 11 May 2017 21:11:37 -0400
[Message part 1 (text/plain, inline)]
tags 26891 patch
quit

John Mastro <john.b.mastro <at> gmail.com> 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...

[v1-0001-Make-indent-indent-to-respect-field-boundaries-Bu.patch (text/x-diff, inline)]
From 33880d67f0cc567ca5c317f828cc15859dcd9fe7 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
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


Added tag(s) patch. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 12 May 2017 01:11:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26891; Package emacs. (Fri, 12 May 2017 16:48:02 GMT) Full text and rfc822 format available.

Message #13 received at 26891 <at> debbugs.gnu.org (full text, mbox):

From: John Mastro <john.b.mastro <at> gmail.com>
To: 26891 <at> debbugs.gnu.org
Cc: Noam Postavsky <npostavs <at> users.sourceforge.net>
Subject: Re: bug#26891: 26.0.50; Error using lisp-indent-line in
 eval-expression minibuffer
Date: Fri, 12 May 2017 09:47:32 -0700
<npostavs <at> users.sourceforge.net> wrote:
> 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...

That indeed seems to fix the error both for the minimal case and the
scenario where I initially encountered it (using paredit-newline in the
minibuffer). Thanks!

        John




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26891; Package emacs. (Fri, 12 May 2017 17:16:02 GMT) Full text and rfc822 format available.

Message #16 received at 26891 <at> debbugs.gnu.org (full text, mbox):

From: John Mastro <john.b.mastro <at> gmail.com>
To: 26891 <at> debbugs.gnu.org
Cc: Noam Postavsky <npostavs <at> users.sourceforge.net>
Subject: Re: bug#26891: 26.0.50; Error using lisp-indent-line in
 eval-expression minibuffer
Date: Fri, 12 May 2017 10:15:21 -0700
John Mastro <john.b.mastro <at> gmail.com> wrote:
> <npostavs <at> users.sourceforge.net> wrote:
>> 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...
>
> That indeed seems to fix the error both for the minimal case and the
> scenario where I initially encountered it (using paredit-newline in the
> minibuffer). Thanks!

I noticed a small typo in the commit message (indent-indent-to
should be indent-line-to)

        John




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26891; Package emacs. (Tue, 16 May 2017 03:07:01 GMT) Full text and rfc822 format available.

Message #19 received at 26891 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: John Mastro <john.b.mastro <at> gmail.com>
Cc: 26891 <at> debbugs.gnu.org
Subject: Re: bug#26891: 26.0.50;
 Error using lisp-indent-line in eval-expression minibuffer
Date: Mon, 15 May 2017 23:07:48 -0400
tags 26891 fixed
close 26891 
quit

John Mastro <john.b.mastro <at> gmail.com> writes:

> I noticed a small typo in the commit message (indent-indent-to
> should be indent-line-to)

Thanks, pushed to master with typo fixed [1: 4635016869].

[1: 4635016869]: 2017-05-15 22:58:24 -0400
  Make `indent-line-to' respect field boundaries (Bug#26891)
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=4635016869f7b85dfe37669674677a7dcaab20c4




Added tag(s) fixed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Tue, 16 May 2017 03:07:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 26891 <at> debbugs.gnu.org and John Mastro <john.b.mastro <at> gmail.com> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Tue, 16 May 2017 03:07:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 13 Jun 2017 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 10 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.