emacs-evil / evil

The extensible vi layer for Emacs.
GNU General Public License v3.0
3.38k stars 281 forks source link

evil-ex-teardown on emacs with pgtk and gcc #1415

Closed benneti closed 1 year ago

benneti commented 3 years ago

What did you expect to happen? using ":%s/old/new/gRET", do the replacement and remove highlights.

What actually happened? The highlight of the region stays active, see screenshot

Additional details:

Environment

Emacs version: GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) Operating System: NixOS Evil version: Evil version 1.14.0 Evil installation type: doom emacs (straight.el melpa) Graphical/Terminal: graphical Tested in a make emacs session (see CONTRIBUTING.md):

System information:

``` elip
SYSTEM  type       gnu/linux
        config     x86_64-pc-linux-gnu
        shell      /run/current-system/sw/bin/zsh
        uname      Linux 5.10.7 #1-NixOS SMP Tue Jan 12 19:18:27 UTC 2021 x86_64
        path       (/run/wrappers/bin ~/.nix-profile/bin /etc/profiles/per-user/$USER/bin /nix/var/nix/profiles/default/bin /run/current-system/sw/bin /nix/store/bpsbkj8acws4jlxxcs9q5gx64jxshf5x-fzf-0.25.0/bin ~/.config/emacs/bin /nix/store/q62hcc51kp43s04x0s63hyvm4rsy54fl-emacs-pgtkgcc-20210130.0/libexec/emacs/28.0.50/x86_64-pc-linux-gnu/)
EMACS   dir        ~/.config/emacs/
        version    28.0.50
        build      Feb 03, 2021
        buildopts  --prefix=/nix/store/q62hcc51kp43s04x0s63hyvm4rsy54fl-emacs-pgtkgcc-20210130.0 --disable-build-details --with-modules --with-x-toolkit=gtk3 --with-cairo --with-nativecomp --with-pgtk
        features   CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XIM GTK3 ZLIB
        traits     (gui server-running envvar-file)
DOOM    dir        ~/.config/doom/
        version    2.0.9
        font       #
        theme      doom-dracula
        build      HEAD -> develop 3a7be7bb4 2021-02-01 02:45:45 -0500
        elc-files  0
        modules    (:completion company (ivy +icons) :ui doom doom-dashboard doom-quit hl-todo modeline ophints (popup +defaults) ligatures unicode vc-gutter vi-tilde-fringe (window-select +numbers +switch-window) :editor (evil +everywhere) file-templates fold rotate-text snippets word-wrap :emacs (dired +ranger +icons) electric (ibuffer +icons) undo vc :term vterm :checkers syntax (spell +everywhere) grammar :tools direnv editorconfig (eval +overlay) lookup (lsp +eglot) magit (pass +auth) pdf biblio :lang (cc +lsp) data emacs-lisp (julia +lsp) (latex +latexmk +cdlatex +fold) markdown nix (org +jupyter +dragndrop +pandoc +pretty +ref +roam) (python +lsp) (sh +fish) :email mu4e :config (default +bindings +smartparens))
        packages   ((jupyter :recipe (:no-native-compile t)) (eglot-jl) (company-statistics) (company-quickhelp) (academic-phrases) (org-ref) (latex-preview-pane :disable) (org-ql) (svg-tag-mode :recipe (:host github :repo rougier/svg-tag-mode :branch main :files (svg-tag-mode.el))) (org-caldav) (mixed-pitch :recipe (:no-native-compile t)))
        unpin      (n/a)
        elpa       (zmq vterm tablist pdf-tools let-alist)
```

Reproduction steps

EDIT:

I also tried it with make emacs but this configuration does not have the region highlight. But in emacs there were no failed tests reportet and the command line warnings were only related to gtk errors.

Compute dependencies emacs -Q -L . -L lib -l goto-chg.el -l evil-tests.el \ --eval "(evil-mode 1)" \ --eval "(evil-tests-initialize '() '() t)" (emacs:14723): Gtk-CRITICAL **: 12:10:26.184: gtk_distribute_natural_allocation: assertion 'extra_space >= 0' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:28.330: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:28.396: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:28.451: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:28.516: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:28.568: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:28.631: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:29.631: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:29.676: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:29.701: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:29.746: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:29.791: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:29.816: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:30.486: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:30.577: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:31.641: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:31.728: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:34.329: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:34.341: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:34.375: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:34.387: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:34.398: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:34.431: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:34.547: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:36.714: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:36.760: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:36.807: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:36.828: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:37.000: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:37.046: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:37.071: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:37.116: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:37.139: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:37.184: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:37.231: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:39.236: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:39.305: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:40.775: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:40.827: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:40.868: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed (emacs:14723): GLib-GObject-CRITICAL **: 12:10:40.886: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed
KevOrr commented 3 years ago

It looks like in the evil-ex-define-argument-type substitution lambda, (minibuffer-selected-window) returns nil, which is an error to use with with-selected-window. Funnily enough, if I delete the with-selected-window call (but keep its body), then the highlight correctly disappears.

https://github.com/emacs-evil/evil/blob/325a822bee6b9f8590e6e77fe73b4d916fcec357/evil-search.el#L1168-L1174