3

If I hide the cursor in a buffer with

(setq cursor-type nil)

it will reappear if I move it around.

Is there a way for hiding the cursor all the time (only for one specific buffer)?

clemera
  • 3,401
  • 13
  • 40
  • 1
    My bet is on Evil being the culprit. Here's [a bug report](https://bitbucket.org/lyro/evil/issues/592/evil-makes-hidden-cursor-reappear-on) I've handed in. – wasamasa Nov 24 '15 at 16:41
  • @wasamasa Thanks, yes you are right I'm using Evil and it works if I disable it. The function suggested by lawlist is a good alternative and seems to work around this problem. – clemera Nov 24 '15 at 18:43
  • 1
    bug report in the new(est) evil bug tracker: https://github.com/emacs-evil/evil/issues/592 – Lorem Ipsum Dec 07 '21 at 16:36

1 Answers1

4

As far as I am aware, moving the cursor around should not magically make the cursor reappear. Try out a default Emacs -Q and see if the behavior is present or not. Setting the variable cursor-type to nil in a particular buffer should achieve the visual effect desired.


See Also:  The popular built-in blink-cursor-mode uses internal-show-cursor to hide the cursor in a specific window rather than a buffer:

internal-show-cursor is a built-in function in `C source code'.

(internal-show-cursor WINDOW SHOW)

Set the cursor-visibility flag of WINDOW to SHOW.
WINDOW nil means use the selected window.  SHOW non-nil means
show a cursor in WINDOW in the next redisplay.  SHOW nil means
don’t show a cursor.
wasamasa
  • 21,803
  • 1
  • 65
  • 97
lawlist
  • 18,826
  • 5
  • 37
  • 118
  • As wasmasa assumed in his comment it is a problem with evil-mode. But internal-show-cursor works for me, thanks! – clemera Nov 24 '15 at 18:45