* bug#26891: 26.0.50; Error using lisp-indent-line in eval-expression minibuffer
@ 2017-05-11 23:34 John Mastro
2017-05-12 1:11 ` npostavs
0 siblings, 1 reply; 5+ messages in thread
From: John Mastro @ 2017-05-11 23:34 UTC (permalink / raw)
To: 26891
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))
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#26891: 26.0.50; Error using lisp-indent-line in eval-expression minibuffer
2017-05-11 23:34 bug#26891: 26.0.50; Error using lisp-indent-line in eval-expression minibuffer John Mastro
@ 2017-05-12 1:11 ` npostavs
2017-05-12 16:47 ` John Mastro
0 siblings, 1 reply; 5+ messages in thread
From: npostavs @ 2017-05-12 1:11 UTC (permalink / raw)
To: John Mastro; +Cc: 26891
[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]
tags 26891 patch
quit
John Mastro <john.b.mastro@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...
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 937 bytes --]
From 33880d67f0cc567ca5c317f828cc15859dcd9fe7 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* bug#26891: 26.0.50; Error using lisp-indent-line in eval-expression minibuffer
2017-05-12 1:11 ` npostavs
@ 2017-05-12 16:47 ` John Mastro
2017-05-12 17:15 ` John Mastro
0 siblings, 1 reply; 5+ messages in thread
From: John Mastro @ 2017-05-12 16:47 UTC (permalink / raw)
To: 26891; +Cc: Noam Postavsky
<npostavs@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
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#26891: 26.0.50; Error using lisp-indent-line in eval-expression minibuffer
2017-05-12 16:47 ` John Mastro
@ 2017-05-12 17:15 ` John Mastro
2017-05-16 3:07 ` npostavs
0 siblings, 1 reply; 5+ messages in thread
From: John Mastro @ 2017-05-12 17:15 UTC (permalink / raw)
To: 26891; +Cc: Noam Postavsky
John Mastro <john.b.mastro@gmail.com> wrote:
> <npostavs@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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-05-16 3:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-11 23:34 bug#26891: 26.0.50; Error using lisp-indent-line in eval-expression minibuffer John Mastro
2017-05-12 1:11 ` npostavs
2017-05-12 16:47 ` John Mastro
2017-05-12 17:15 ` John Mastro
2017-05-16 3:07 ` npostavs
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).