citar icon indicating copy to clipboard operation
citar copied to clipboard

Custom `C-i` bindings do not play well with `citar-open` and `RET`

Open dschrempf opened this issue 2 years ago • 9 comments

Describe the bug In citar-open, pressing RET results in an error <C-i> is undefined.

To Reproduce

  1. Set
  (define-key input-decode-map (kbd "C-i") [C-i])
  1. Bind <C-i>, for example using general:
  (general-mmap "<C-i>" #'better-jumper-jump-forward)
  1. Run citar-open and press RET.

Expected behavior The entry is opened.

Screenshots If applicable, add screenshots to help explain your problem.

Emacs version: 29.1

Context

  • Most likely related to https://github.com/emacs-citar/citar/issues/707.
  • Setting (setq citar--multiple-setup (cons "<tab>" "RET") is a workaround (but in my opinion it should not be necessary).
  • Could be a problem of my setup (I try to distinguish between C-i and <tab>

dschrempf avatar Sep 25 '23 13:09 dschrempf

Just in case, OS and (if relevant) distro and desktop?

bdarcus avatar Sep 25 '23 15:09 bdarcus

Thanks for having a look!

+ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.54, NixOS, 23.11 (Tapir), 23.11.20230919.5ba549e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.0`
 - nixpkgs: `/nix/store/cz973qsjldbw4x7fx0rwcvhr9k645vz2-source`

I use XMonad.

dschrempf avatar Sep 26 '23 06:09 dschrempf

When you get a chance, @aikrahguzar, any input?

bdarcus avatar Sep 27 '23 13:09 bdarcus

This is exactly #707 and I don't know of any completely clean solution for that since it is a workaround for a limitation of completion ui. Changing the default value of citar--multiple-setup to use <tab> is the only option I can think of but I don't know if there are any unintended consequences.

aikrahguzar avatar Sep 27 '23 18:09 aikrahguzar

I don't know of any completely clean solution for that since it is a workaround for a limitation of completion ui. Changing the default value of citar--multiple-setup to use <tab> is the only option I can think of but I don't know if there are any unintended consequences.

@dschrempf - thoughts?

Doesn't seem like there's much we can do about this?

bdarcus avatar Oct 01 '23 13:10 bdarcus

Using the workaround is an option for me, but I do not know if this situation is desired.

I do not know the internals of citar (Does it use keybinding macros?), but in opinion, rebinding a key should not lead to an error in a seemingly independent library. If there is no way to fix this, so be it :shrug:. Citar is a great package, thank you!, and I am happy that it works the way it does :smile:.

dschrempf avatar Oct 02 '23 04:10 dschrempf

@aikrahguzar did mention changing the default value as a possibility.

bdarcus avatar Oct 10 '23 11:10 bdarcus

This would mean that citar does not anymore work as expected when Emacs is used from the terminal, is that so?

Also: The completion UI that you mentioned. Is this an external library?

dschrempf avatar Oct 10 '23 13:10 dschrempf

This would mean that citar does not anymore work as expected when Emacs is used from the terminal, is that so?

IDK; that would obviously be a problem if so.

Also: The completion UI that you mentioned. Is this an external library?

I think he meant completing-read.

bdarcus avatar Oct 11 '23 14:10 bdarcus