GNU bug report logs - #76440
30.1; different behavaiour of 29.4 and 30 for ivy completition of absolute paths

Previous Next

Package: emacs;

Reported by: Evgeniy Dushistov <dushistov <at> mail.ru>

Date: Thu, 20 Feb 2025 16:17:02 UTC

Severity: normal

Tags: patch

Fixed in version 30.1

Done: "Basil L. Contovounesios" <basil <at> contovou.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 76440 in the body.
You can then email your comments to 76440 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#76440; Package emacs. (Thu, 20 Feb 2025 16:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Evgeniy Dushistov <dushistov <at> mail.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 20 Feb 2025 16:17:03 GMT) Full text and rfc822 format available.

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

From: Evgeniy Dushistov <dushistov <at> mail.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.1; different behavaiour of 29.4 and 30 for ivy completition of
 absolute paths
Date: Thu, 20 Feb 2025 19:16:32 +0300
Run "emacs -Q" with such config:
```
(setq straight-check-for-modifications nil)
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 6))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package 'use-package)

(setq use-package-verbose t)

(use-package ivy
  :straight t
  :init
  (setq ivy-use-virtual-buffers t)
  (setq enable-recursive-minibuffers t)
  :config
  (ivy-mode 1)
  )
```

After start open "/tmp" directory, and then press
C-x C-f and then type /var, the content of minibuffer would be
"/tmp//var",
if after that press TAB
the result would be "/tmp/var"
while expected "/var".

emacs 29.4 gives "/var", while emacs 30.1-rc1 gives "/tmp/var".

In GNU Emacs 30.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.48,
cairo version 1.18.2)
Repository revision: f33dddcc776e901abd1bb8f444c87d7e51128fec
Repository branch: main
Windowing system distributor 'The X.Org Foundation', version 11.0.12101015
System Description: Arch Linux

Configured using:
 'configure --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib
 --with-tree-sitter --localstatedir=/var --with-cairo
 --disable-build-details --with-harfbuzz --with-libsystemd
 --with-modules --with-x-toolkit=gtk3 'CFLAGS=-march=nehalem
 -mtune=znver1 -O2 -pipe -fno-plt -fexceptions -Wformat
 -Werror=format-security -fstack-clash-protection -fcf-protection
 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g
 -ffile-prefix-map=/home/evgeniy/bigdisk1/linux-infra/arch_build/modified-packages/emacs-30/src=/usr/src/debug/emacs'
 'LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro
 -Wl,-z,now -Wl,-z,pack-relative-relocs''

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

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

Major mode: ELisp/d

Minor modes in effect:
  ivy-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/evgeniy/.config/emacs/straight/build/bind-key/bind-key hides /usr/share/emacs/30.1/lisp/bind-key
/home/evgeniy/.config/emacs/straight/build/use-package/use-package-ensure hides /usr/share/emacs/30.1/lisp/use-package/use-package-ensure
/home/evgeniy/.config/emacs/straight/build/use-package/use-package-ensure-system-package hides /usr/share/emacs/30.1/lisp/use-package/use-package-ensure-system-package
/home/evgeniy/.config/emacs/straight/build/use-package/use-package-core hides /usr/share/emacs/30.1/lisp/use-package/use-package-core
/home/evgeniy/.config/emacs/straight/build/use-package/use-package-delight hides /usr/share/emacs/30.1/lisp/use-package/use-package-delight
/home/evgeniy/.config/emacs/straight/build/use-package/use-package-lint hides /usr/share/emacs/30.1/lisp/use-package/use-package-lint
/home/evgeniy/.config/emacs/straight/build/use-package/use-package-bind-key hides /usr/share/emacs/30.1/lisp/use-package/use-package-bind-key
/home/evgeniy/.config/emacs/straight/build/use-package/use-package-diminish hides /usr/share/emacs/30.1/lisp/use-package/use-package-diminish
/home/evgeniy/.config/emacs/straight/build/use-package/use-package-jump hides /usr/share/emacs/30.1/lisp/use-package/use-package-jump
/home/evgeniy/.config/emacs/straight/build/use-package/use-package hides /usr/share/emacs/30.1/lisp/use-package/use-package

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny rfc822
mml mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils ffap
url-parse url-vars thingatpt dired dired-loaddefs tramp trampver
tramp-integration files-x tramp-message tramp-compat xdg shell pcomplete
parse-time iso8601 format-spec auth-source eieio eieio-core
password-cache json map tramp-loaddefs time-date ivy delsel ivy-faces
ivy-overlay colir color ivy-autoloads use-package-core
use-package-autoloads bind-key-autoloads straight-autoloads compile
text-property-search comint ansi-osc ansi-color ring comp-run comp
comp-cstr cl-extra help-mode comp-common warnings icons rx straight info
loaddefs-gen generate-lisp-file lisp-mnt radix-tree easy-mmode cl-seq
pcase subr-x byte-opt cl-macs gv cl-loaddefs cl-lib bytecomp
byte-compile cyril-util 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
native-compile emacs)

Memory information:
((conses 16 153970 11540) (symbols 48 12982 0) (strings 32 39164 2004)
 (string-bytes 1 1243659) (vectors 16 23992)
 (vector-slots 8 279176 6265) (floats 8 169 262) (intervals 56 380 0)
 (buffers 992 14))

-- 
/Evgeniy




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76440; Package emacs. (Thu, 20 Feb 2025 16:30:03 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Evgeniy Dushistov <dushistov <at> mail.ru>, 76440 <at> debbugs.gnu.org
Cc: Oleh Krehel <ohwoeowho <at> gmail.com>
Subject: Re: bug#76440: 30.1; different behavaiour of 29.4 and 30 for ivy
 completition of absolute paths
Date: Thu, 20 Feb 2025 10:29:04 -0600
Evgeniy Dushistov via "Bug reports for GNU Emacs, the Swiss army knife
of text editors" <bug-gnu-emacs <at> gnu.org> writes:

> Run "emacs -Q" with such config:

[...]

Here's a simpler recipe that doesn't involve any third-party package
manager:

    (package-initialize)
    (use-package ivy
      :ensure t
      :init
      (setq ivy-use-virtual-buffers t)
      (setq enable-recursive-minibuffers t)
      :config
      (ivy-mode 1))

> After start open "/tmp" directory, and then press
> C-x C-f and then type /var, the content of minibuffer would be
> "/tmp//var",
> if after that press TAB
> the result would be "/tmp/var"
> while expected "/var".
>
> emacs 29.4 gives "/var", while emacs 30.1-rc1 gives "/tmp/var".

I'm copying in Oleh Krehel, the maintainer of ivy.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76440; Package emacs. (Thu, 20 Feb 2025 17:28:01 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <basil <at> contovou.net>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Evgeniy Dushistov <dushistov <at> mail.ru>, Oleh Krehel <ohwoeowho <at> gmail.com>,
 76440 <at> debbugs.gnu.org
Subject: Re: bug#76440: 30.1; different behavaiour of 29.4 and 30 for ivy
 completition of absolute paths
Date: Thu, 20 Feb 2025 18:26:53 +0100
Stefan Kangas [2025-02-20 10:29 -0600] wrote:

> Evgeniy Dushistov writes:
>
>> After start open "/tmp" directory, and then press
>> C-x C-f and then type /var, the content of minibuffer would be
>> "/tmp//var",
>> if after that press TAB
>> the result would be "/tmp/var"
>> while expected "/var".
>>
>> emacs 29.4 gives "/var", while emacs 30.1-rc1 gives "/tmp/var".

Thanks, I can reproduce this.

The call to minibuffer-complete in ivy-partial-or-done seems to behave
differently between Emacs versions 29 and 30; I'll have to take a closer
look soon.

Sadly this isn't the only (nor even the most severe) filename completion
bug in Ivy with Emacs 30+.  Stay tuned.

> I'm copying in Oleh Krehel, the maintainer of ivy.

Feel free to also CC me as co-maintainer in the future.
I don't think Oleh has had much time to dedicate to Ivy lately.

Thanks,
-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76440; Package emacs. (Thu, 20 Feb 2025 19:51:02 GMT) Full text and rfc822 format available.

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

From: Evgeniy Dushistov <dushistov <at> mail.ru>
To: "Basil L. Contovounesios" <basil <at> contovou.net>
Cc: Stefan Kangas <stefankangas <at> gmail.com>, 76440 <at> debbugs.gnu.org,
 Oleh Krehel <ohwoeowho <at> gmail.com>
Subject: Re: bug#76440: 30.1; different behavaiour of 29.4 and 30 for ivy
 completition of absolute paths
Date: Thu, 20 Feb 2025 22:50:12 +0300
On Thu, Feb 20, 2025 at 06:26:53PM +0100, Basil L. Contovounesios wrote:
> Stefan Kangas [2025-02-20 10:29 -0600] wrote:
> 
> > Evgeniy Dushistov writes:
> >
> >> After start open "/tmp" directory, and then press
> >> C-x C-f and then type /var, the content of minibuffer would be
> >> "/tmp//var",
> >> if after that press TAB
> >> the result would be "/tmp/var"
> >> while expected "/var".
> >>
> >> emacs 29.4 gives "/var", while emacs 30.1-rc1 gives "/tmp/var".
> 
> Thanks, I can reproduce this.
> 

The similar, but much worse issue competition of absolute paths
with gud-gdb+ivy:

M-x gud-gdb
In minibuffer:
"gdb --fullname /tmp"

press TAB, and for some reason get:
"gdb --fullname tmp/"

ok, I fix this and add almost all path to 
existing directory (build-dir):
"gdb --fullname /tmp/build-d"

press TAB, and get:
"gdb --fullname build-dir"

so it just remove for some reason "/tmp" when complete path,
again I fix it in minibuffer, and add almost all path to existing
binary(exe):
"gdb --fullname /tmp/build-dir/ex"

press TAB and get:
"gdb --fullname /tmp/build-direxe"

instead of
"gdb --fullname /tmp/build-dir/exe"

So with gdb-gud+ivy+emacs 30.1 TAB almost always gives not
valid path for some reason, while with emacs 29.4 all works perfect.

-- 
/Evgeniy




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76440; Package emacs. (Mon, 24 Feb 2025 11:52:01 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <basil <at> contovou.net>
To: Evgeniy Dushistov <dushistov <at> mail.ru>
Cc: Stefan Kangas <stefankangas <at> gmail.com>, 76440 <at> debbugs.gnu.org,
 Oleh Krehel <ohwoeowho <at> gmail.com>
Subject: Re: bug#76440: 30.1; different behavaiour of 29.4 and 30 for ivy
 completition of absolute paths
Date: Mon, 24 Feb 2025 12:51:25 +0100
[Message part 1 (text/plain, inline)]
tags 76440 + patch
quit

Evgeniy Dushistov [2025-02-20 22:50 +0300] wrote:
>> > Evgeniy Dushistov writes:
>> >
>> >> After start open "/tmp" directory, and then press
>> >> C-x C-f and then type /var, the content of minibuffer would be
>> >> "/tmp//var",
>> >> if after that press TAB
>> >> the result would be "/tmp/var"
>> >> while expected "/var".
>> >>
>> >> emacs 29.4 gives "/var", while emacs 30.1-rc1 gives "/tmp/var".
>
> The similar, but much worse issue competition of absolute paths
> with gud-gdb+ivy:
>
> M-x gud-gdb
> In minibuffer:
> "gdb --fullname /tmp"
>
> press TAB, and for some reason get:
> "gdb --fullname tmp/"
>
> ok, I fix this and add almost all path to 
> existing directory (build-dir):
> "gdb --fullname /tmp/build-d"
>
> press TAB, and get:
> "gdb --fullname build-dir"
>
> so it just remove for some reason "/tmp" when complete path,
> again I fix it in minibuffer, and add almost all path to existing
> binary(exe):
> "gdb --fullname /tmp/build-dir/ex"
>
> press TAB and get:
> "gdb --fullname /tmp/build-direxe"
>
> instead of
> "gdb --fullname /tmp/build-dir/exe"
>
> So with gdb-gud+ivy+emacs 30.1 TAB almost always gives not
> valid path for some reason, while with emacs 29.4 all works perfect.

Could you please check whether

  https://github.com/abo-abo/swiper/pull/3065

fixes these issues for you?

I attach the constituent patches for convenience.

Thanks,
-- 
Basil

[0001-Fix-ivy-completion-in-region-return-value.patch (text/x-diff, attachment)]
[0002-Fix-some-point-placement-on-exact-completion-exit.patch (text/x-diff, attachment)]
[0003-Add-ivy-completion-common-length-regression-tests.patch (text/x-diff, attachment)]
[0004-Fix-ivy-completion-common-length.patch (text/x-diff, attachment)]
[0005-Prefer-base-size-over-ivy-completion-common-length.patch (text/x-diff, attachment)]

Added tag(s) patch. Request was from "Basil L. Contovounesios" <basil <at> contovou.net> to control <at> debbugs.gnu.org. (Mon, 24 Feb 2025 11:52:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76440; Package emacs. (Mon, 24 Feb 2025 14:13:02 GMT) Full text and rfc822 format available.

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

From: Evgeniy Dushistov <dushistov <at> mail.ru>
To: "Basil L. Contovounesios" <basil <at> contovou.net>
Cc: Stefan Kangas <stefankangas <at> gmail.com>, 76440 <at> debbugs.gnu.org,
 Oleh Krehel <ohwoeowho <at> gmail.com>
Subject: Re: bug#76440: 30.1; different behavaiour of 29.4 and 30 for ivy
 completition of absolute paths
Date: Mon, 24 Feb 2025 17:12:04 +0300
On Mon, Feb 24, 2025 at 12:51:25PM +0100, Basil L. Contovounesios wrote:
> patch

Thank you, this fixed for me all ivy related issues.

-- 
/Evgeniy




Reply sent to "Basil L. Contovounesios" <basil <at> contovou.net>:
You have taken responsibility. (Tue, 25 Feb 2025 09:02:02 GMT) Full text and rfc822 format available.

Notification sent to Evgeniy Dushistov <dushistov <at> mail.ru>:
bug acknowledged by developer. (Tue, 25 Feb 2025 09:02:02 GMT) Full text and rfc822 format available.

Message #27 received at 76440-done <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <basil <at> contovou.net>
To: Evgeniy Dushistov <dushistov <at> mail.ru>
Cc: Stefan Kangas <stefankangas <at> gmail.com>, 76440-done <at> debbugs.gnu.org,
 Oleh Krehel <ohwoeowho <at> gmail.com>
Subject: Re: bug#76440: 30.1; different behavaiour of 29.4 and 30 for ivy
 completition of absolute paths
Date: Tue, 25 Feb 2025 10:01:27 +0100
close 76440 30.1
quit

Evgeniy Dushistov [2025-02-24 17:12 +0300] wrote:
> Thank you, this fixed for me all ivy related issues.

Thank you for confirming.

I've now applied the fixes and tagged a new Ivy version 0.15.0, coming
to a GNU ELPA near you soon.

[ The new ivy-avy, ivy-hydra, and swiper versions will come tomorrow,
  and counsel in a couple of days, to avoid interim dependency issues.

  In the long run the idea is to merge all of these packages into a
  single package, which follows the project's development model. ]

-- 
Basil




bug marked as fixed in version 30.1, send any further explanations to 76440 <at> debbugs.gnu.org and Evgeniy Dushistov <dushistov <at> mail.ru> Request was from "Basil L. Contovounesios" <basil <at> contovou.net> to control <at> debbugs.gnu.org. (Tue, 25 Feb 2025 09:03:01 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, 25 Mar 2025 11:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 83 days ago.

Previous Next


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