2

Using Emacs 28.2 (graphical, not text mode) from https://emacsformacosx.com with org-mode 9.5.5 and ivy.

When entering a task description in the mini-buffer via org-capture, I occasionally enter both the Shift and the Space keys instead of just Space. Rather than just putting a space character into the task description, this blanks the entry so I have to re-enter the task description from scratch.

Not sure if this is an org-mode setting or plain Emacs, but could anybody point me into the right direction on how to change this behaviour so that Shift+Space yields in a simple Space character in this context?

EDIT Capture template is as follows

       (global-set-key (kbd "<f6>") 'org-capture)
       (setq org-capture-templates
         '(("t" "Todo (work)" entry
            (file+olp "~/Workcloud/org/WORK.org" "CAPTURE" "Org-Capture")
            "* TODO %^{Task Description}" :prepend t)
           ("n" "Note (work)" entry
            (file+olp "~/Workcloud/org/WORK.org" "CAPTURE" "Org-Capture")
            (file "~/Workcloud/org/capture-note.txt")
        :prepend t)))

EDIT2

Inspecting the key bindings in the minibuffer, I found this

S-SPC runs the command ivy-restrict-to-matches, which is an interactive byte-compiled Lisp function in ‘ivy.el’.

It is bound to S-SPC.

(ivy-restrict-to-matches)

Restrict candidates to current input and erase input.

So I think I know where to look next.

5
  • Please add your capture template to your question. Normally, the minibuffer is NOT used for entering task descriptions, so it seems you are doing something different: we need to know about that.
    – NickD
    Apr 5 at 17:27
  • 1
    @NickD Thanks for your feedback. I edited the question to add the capture template.
    – uselpa
    Apr 5 at 18:30
  • 3
    (define-key ivy-minibuffer-map (kbd "S-SPC") nil) did the trick.
    – uselpa
    Apr 5 at 18:49
  • Thanks for reporting back. I've been plagued by this for ages. You can and should post and accept your own answer as an answer, not just a comment. Apr 12 at 4:42
  • @PhilHudson Happy to see that I'm not the only one ;-) Done.
    – uselpa
    Apr 13 at 6:46

1 Answer 1

1

So it turns out that ivy had a keybinding for S-SPC in the minibuffer, which I simply did not expect (S-SPC is not a typical combination I would rebind, but maybe that's just me).

The easiest way to discover this is to press C-h k in the minibuffer, then S-SPC, and Emacs will happily tell you about the binding.

So I ended up adding (define-key ivy-minibuffer-map (kbd "S-SPC") nil) to init.el, which unbinds this. Of course you could bind the function to a different key combination, but I had no use for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.