Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Counsel-find-file gives "text is read-only" on Backspace press #2761

Closed
thriveth opened this issue Dec 15, 2020 · 11 comments
Closed

Counsel-find-file gives "text is read-only" on Backspace press #2761

thriveth opened this issue Dec 15, 2020 · 11 comments
Labels
moreinfo Waiting for author to provide more information support triage

Comments

@thriveth
Copy link

I have gotten some problems with Ivy/Counsel, which show in a way where, when I run counsel-find-file, and want to go up one level in the file tree by pressing Backspace, the movement is blocked and it shows a message saying 'Text is read-only'.

This could possibly be related to various problems with other packages using Ivy/Counsel. For example, in Org-Roam, when running org-roam-insert, which should insert a link to the note with a given title if it exists, or create it and link to it if it doesn't already exist. What happens here is that it dsoes it well enough with an existing note, but creates and links to a file with the correct timestamp followed by an empty string as the filename. So say I type in "Milky Way Galaxy", and this notew does not exist, it creates the note

202012151735-.org

instead of

202012151735-milky_way_galaxy.org

as it should.

Any suggestions to how to debug this? The only thing I can come up with that could have caused it is that my laptop shut down due to a dead battery before the error started to occur.

@basil-conto
Copy link
Collaborator

Any suggestions to how to debug this?

The usual ways include recursively bisecting your user-init-file in order to narrow down culprits, enabling M-x toggle-debug-on-error RET to get a backtrace whenever an error is signalled, instrumenting potential culprits for stepping through them with Edebug or with print statements, etc.

Unfortunately there's not much I can do without a recipe for reproducing the issue. Which packages other than org-roam give rise to the problem? Maybe this issue should be reported to those packages instead or as well?

@basil-conto basil-conto added moreinfo Waiting for author to provide more information support triage labels Dec 15, 2020
@thriveth
Copy link
Author

OK I found the culprit, sorry for the noise.

I had played around with fido-mode in one buffer at some point, and apparently that had gotten into my custom-file without my knowing it. And apparently, fido-mode does not play nice with Ivy/Counsel

@basil-conto
Copy link
Collaborator

Yeah, they're both effectively minibuffer completion frontends, so I think they're mutually exclusive.

Is there something you would like to see changed here, or can this issue be closed?

@thriveth
Copy link
Author

It can be closed, thanks for asking!
If anything should be changed, it'd be whatever auto-enabled Fido without my knowledge after I screwed around with it once, but that's got nothing to do with Ivy/Counsel :)

@basil-conto
Copy link
Collaborator

Thanks for confirming!

@markgdawson
Copy link

Hungry delete seems to cause this same behaviour for me in the emacs native comp branch with:

GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)

I have the following config for hungry-delete, using use-package and straight.el:

(use-package hungry-delete
  :straight t
  :config
  (global-hungry-delete-mode 1))

@markgdawson
Copy link

This seems to show the same symptoms as this (closed) issue:

nflath/hungry-delete#27

@RickMoynihan
Copy link

I've recently started using Emacs 28 built --with-native-comp (via the emacs-plus distribution), and have run into this same error with counsel, however unlike @markgdawson I'm not running straight.el or hungry-delete.

I'm wondering if anyone has any ideas as to what might be causing this? It only happened after upgrading emacs to 28 with native-comp.

@basil-conto
Copy link
Collaborator

Emacs 28 built --with-native-comp

I'm not familiar with the emacs-plus distribution, but that's the old configure flag. The latest version of native compilation present on the Emacs master branch has the --with-native-compilation flag instead.

I'm wondering if anyone has any ideas as to what might be causing this?

No, but enabling debug-on-error, checking the value of major-mode in the minibuffer, checking what command is bound to backspace, trying to reproduce from emacs -Q, bisecting your user-init-file, etc. might help in debugging it.

It only happened after upgrading emacs to 28 with native-comp.

FWIW, counsel-find-file works fine with backspace here:

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
 of 2021-05-05 built on tia
Repository revision: 58b0bcd16df83d914fe4d538e6be88cac9574906
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure 'CC=ccache gcc' 'CFLAGS=-O2 -march=native' --config-cache
 --prefix=/home/blc/.local --program-suffix=-native
 --enable-checking=structs --with-x-toolkit=lucid
 --with-file-notification=yes --with-x --with-native-compilation'

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

Important settings:
  value of $LANG: en_IE.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Minibuffer

Minor modes in effect:
  shell-dirtrack-mode: t
  counsel-mode: t
  ivy-mode: t
  tooltip-mode: t
  global-eldoc-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
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa
derived epg epg-config gnus-util rmail rmail-loaddefs 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
thingatpt tramp tramp-loaddefs trampver tramp-integration files-x
tramp-compat shell pcomplete parse-time iso8601 time-date ls-lisp
format-spec ivy-avy avy two-column edmacro kmacro counsel xdg advice
xref project dired dired-loaddefs compile text-property-search comint
ansi-color swiper ivy delsel ring ivy-faces ivy-overlay colir comp
comp-cstr warnings rx cl-extra help-mode color finder-inf package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib iso-transl 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 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 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 cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
x multi-tty make-network-process nativecomp emacs)

@seagle0128
Copy link
Contributor

seagle0128 commented Aug 8, 2021

Adding minibuffer-mode to hungry-delete-except-modes works for me as well.

@ghost
Copy link

ghost commented Jul 30, 2023

Adding minibuffer-mode to hungry-delete-except-modes works for me as well.

This worked for me

(setq hungry-delete-except-modes (append hungry-delete-except-modes '(minibuffer-mode)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
moreinfo Waiting for author to provide more information support triage
Projects
None yet
Development

No branches or pull requests

5 participants