GNU bug report logs - #21874
`backward-char' can move point into minibuffer prompt by default

Previous Next

Package: emacs;

Reported by: David Reitter <david.reitter <at> gmail.com>

Date: Tue, 10 Nov 2015 23:28:01 UTC

Severity: wishlist

Found in version 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 21874 <at> debbugs.gnu.org (full text, mbox):

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: 21874 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: 25.0.50; point-entered no longer works
Date: Wed, 23 Mar 2016 16:30:05 -0400
[Message part 1 (text/plain, inline)]
Then I tried the below (which sort of works):

(progn
  (setq minibuffer-prompt-properties '(read-only t cursor-intangible t face
minibuffer-prompt))

  (defun turn-on-cursor-intangible-mode ()
    "Turns on cursor-intangible-mode."
    (interactive)
    (cursor-intangible-mode 1))
  (define-globalized-minor-mode global-cursor-intangible-mode
cursor-intangible-mode turn-on-cursor-intangible-mode)

  (global-cursor-intangible-mode 1))

Start emacs -Q and eval the above progn form.
The caveat is (and I cannot understand why) is that the cursor
intangibility does not kick in when you do C-x C-f for the first time! It
kicks in only from the second C-x C-f onwards.

The following steps try to explain what I mean (on latest build of
emacs-25):
1. emacs -Q
2. Eval the above progn form
3. C-x C-f C-x h (The read-only portion also gets selected!)
4. C-g
5. C-x C-f C-x h (NOW the read-only portion does not get selected as
expected)

So why is the cursor-intangible-mode not enabled in the minibuffer the
first time (Step 3)?

Also, would it be wise to enable cursor-intangible-mode globally? If not,
how can we have that mode always enabled in the minibuffer?


-------------------------

On the other hand, I have tested the below as an alternate solution
(probably better too as I am not enabling the mode globally) to always work:

(progn
  (setq minibuffer-prompt-properties '(read-only t cursor-intangible t face
minibuffer-prompt))
  (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode))

If we want emacs to "do the right thing", should the above be made default?
[Message part 2 (text/html, inline)]

This bug report was last modified 3 years and 158 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.