GNU bug report logs - #80123
[PATCH] IELM improvements

Previous Next

Package: emacs;

Reported by: Jared Finder <jared <at> finder.org>

Date: Sat, 3 Jan 2026 16:27:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 80123 AT debbugs.gnu.org.

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#80123; Package emacs. (Sat, 03 Jan 2026 16:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jared Finder <jared <at> finder.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 03 Jan 2026 16:27:02 GMT) Full text and rfc822 format available.

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

From: Jared Finder <jared <at> finder.org>
To: Bug-gnu Emacs <bug-gnu-emacs <at> gnu.org>
Subject: [PATCH] IELM improvements
Date: Sat, 03 Jan 2026 08:26:18 -0800
[Message part 1 (text/plain, inline)]
Two patches attached to improve IELM.

Patch #1 adds a new value for ielm-dynamic-return to work better with 
electric-pair-mode.  Because electric-pair-mode always inserts an end 
parenthesis the "detect complete sexp" logic always returns true for 
normal user flows.  This patch adds a new value for ielm-dynamic-return 
that works well.

Patch #2 fixes ielm-dynamic-multiline-inputs.  This behavior has been 
broken for quite a long time and it may be worthwhile to change the 
default value simultaneously.  I never remember it working as described 
for at least 10 years.  I'm guessing this behavior was broken by comint 
switching to use fields which was done pre 2005.  Do you think this 
should go as is (restoring intended behavior) or be changed to reflect 
the default reality of the past 10+ years?

  -- MJF

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.49, cairo version 1.18.4) of 2026-01-03 built on electric-egg
Repository revision: ea01d89ce872a5b9343078e00b23e35d9272866d
Repository branch: master
System Description: Debian GNU/Linux 13 (trixie)

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP X11 XDBE XIM XINERAMA XINPUT2 XPM XRANDR GTK3 ZLIB

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

Major mode: Fundamental

Minor modes in effect:
  winner-mode: t
  diff-hl-margin-mode: t
  xterm-mouse-mode: t
  global-window-tool-bar-mode: t
  savehist-mode: t
  save-place-mode: t
  repeat-mode: t
  recentf-mode: t
  global-subword-mode: t
  global-goto-address-mode: t
  global-form-feed-st-mode: t
  icomplete-mode: t
  fido-mode: t
  electric-pair-mode: t
  delete-selection-mode: t
  cua-mode: t
  url-handler-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  context-menu-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  window-divider-mode: t
  minibuffer-nonselected-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr finder-inf emacsbug lisp-mnt message puny rfc822
mml mml-sec epa epg rfc6068 epg-config gnus-util text-property-search
time-date mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader
sendmail mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils cursor-sensor term/xterm xterm visual-wrap
yank-media markdown-mode rx noutline outline winner cus-edit pp
cus-start cus-load diff-hl-margin diff-hl-dired dired dired-loaddefs
diff-hl log-view log-edit ring add-log pcvs-util vc-dir ewoc vc
vc-dispatcher diff-mode track-changes xt-mouse window-tool-bar tab-line
cl-extra help-mode compat savehist saveplace repeat recentf tree-widget
wid-edit cap-words superword subword goto-addr thingatpt form-feed-st
icomplete elec-pair delsel cua-base ls-lisp warnings init-dir
benchmark-init-modes benchmark-init advice inline
benchmark-init-autoloads diff-hl-autoloads dired-icon-autoloads
form-feed-st-autoloads init-dir-autoloads markdown-mode-autoloads info
slime-autoloads macrostep-autoloads package browse-url xdg url url-proxy
url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core icons password-cache json map
url-vars modus-themes byte-opt bytecomp byte-compile easy-mmode derived
cl-macs pcase cl-loaddefs cl-lib subr-x color gv rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine 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 emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo gtk x-toolkit xinput2 x multi-tty move-toolbar
make-network-process tty-child-frames emacs)

Memory information:
((conses 16 535056 25637) (symbols 48 23305 2)
 (strings 32 157770 2717) (string-bytes 1 3467810) (vectors 16 30659)
 (vector-slots 8 297641 22298) (floats 8 343 1474)
 (intervals 56 461 41) (buffers 1064 14))
[0001-New-IELM-option-to-insert-newline-when-inside-sexp.patch (text/x-diff, attachment)]
[0002-Fix-behavior-for-ielm-dynamic-multiline-inputs.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80123; Package emacs. (Mon, 05 Jan 2026 00:57:01 GMT) Full text and rfc822 format available.

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

From: Jared Finder <jared <at> finder.org>
To: 80123 <at> debbugs.gnu.org
Subject: Re: [PATCH] IELM improvements
Date: Sun, 04 Jan 2026 16:55:57 -0800
Some additional information...

On 2026-01-03 08:26, Jared Finder wrote:
> Two patches attached to improve IELM.
> 
> Patch #1 adds a new value for ielm-dynamic-return to work better with 
> electric-pair-mode.  Because electric-pair-mode always inserts an end 
> parenthesis the "detect complete sexp" logic always returns true for 
> normal user flows.  This patch adds a new value for ielm-dynamic-return 
> that works well.
> 
> Patch #2 fixes ielm-dynamic-multiline-inputs.  This behavior has been 
> broken for quite a long time and it may be worthwhile to change the 
> default value simultaneously.  I never remember it working as described 
> for at least 10 years.  I'm guessing this behavior was broken by comint 
> switching to use fields which was done pre 2005.  Do you think this 
> should go as is (restoring intended behavior) or be changed to reflect 
> the default reality of the past 10+ years?

I confirmed this bug has been around for a long time.

I tested with prebuilt Windows binaries in the download archive and 
found the bug with ielm-dynamic-multiline-inputs all the way back in 
Emacs 22.3 from 2008, the oldest binary there.  Patch #2 fixes the issue 
when applied on 22.3 as well.

  -- MJF




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80123; Package emacs. (Sat, 10 Jan 2026 12:48:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jared Finder <jared <at> finder.org>
Cc: 80123 <at> debbugs.gnu.org
Subject: Re: bug#80123: [PATCH] IELM improvements
Date: Sat, 10 Jan 2026 14:47:30 +0200
> Date: Sat, 03 Jan 2026 08:26:18 -0800
> From:  Jared Finder via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Two patches attached to improve IELM.

Thanks.

> Patch #1 adds a new value for ielm-dynamic-return to work better with 
> electric-pair-mode.  Because electric-pair-mode always inserts an end 
> parenthesis the "detect complete sexp" logic always returns true for 
> normal user flows.  This patch adds a new value for ielm-dynamic-return 
> that works well.

This change should be called out in NEWS.

> @@ -248,7 +266,8 @@ ielm-return
>    (if ielm-dynamic-return
>        (let ((state
>               (save-excursion
> -               (end-of-line)
> +               (when (not (eq ielm-dynamic-return 'point))
> +                 (end-of-line))

Why didn't you use 'unless' here?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#80123; Package emacs. (Sat, 10 Jan 2026 16:21:01 GMT) Full text and rfc822 format available.

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

From: Jared Finder <jared <at> finder.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 80123 <at> debbugs.gnu.org
Subject: Re: bug#80123: [PATCH] IELM improvements
Date: Sat, 10 Jan 2026 08:19:58 -0800
[Message part 1 (text/plain, inline)]
On 2026-01-10 04:47, Eli Zaretskii wrote:
>> Date: Sat, 03 Jan 2026 08:26:18 -0800
>> From:  Jared Finder via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> Two patches attached to improve IELM.
> 
> Thanks.
> 
>> Patch #1 adds a new value for ielm-dynamic-return to work better with
>> electric-pair-mode.  Because electric-pair-mode always inserts an end
>> parenthesis the "detect complete sexp" logic always returns true for
>> normal user flows.  This patch adds a new value for 
>> ielm-dynamic-return
>> that works well.
> 
> This change should be called out in NEWS.

Done.

>> @@ -248,7 +266,8 @@ ielm-return
>>    (if ielm-dynamic-return
>>        (let ((state
>>               (save-excursion
>> -               (end-of-line)
>> +               (when (not (eq ielm-dynamic-return 'point))
>> +                 (end-of-line))
> 
> Why didn't you use 'unless' here?

Just not in the habit.

Updated patches attached.  Patch #2 is unchanged, and only included for 
completeness.

  -- MJF
[0001-New-IELM-option-to-insert-newline-when-inside-sexp.patch (text/x-diff, attachment)]
[0002-Fix-behavior-for-ielm-dynamic-multiline-inputs.patch (text/x-diff, attachment)]

This bug report was last modified 1 day ago.

Previous Next


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