GNU bug report logs - #24179
25.1; scroll-conservatively over SCROLL_LIMIT may put point in the wrong place

Previous Next

Package: emacs;

Reported by: Alex <agrambot <at> gmail.com>

Date: Sun, 7 Aug 2016 21:17:01 UTC

Severity: normal

Tags: fixed

Found in version 25.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Jonas Bernoulli <jonas <at> bernoul.li>
To: 24179 <at> debbugs.gnu.org
Subject: 24179
Date: Thu, 11 Aug 2016 18:39:54 +0200
Thanks Eli!

> Btw, magit-blame could be nicer to the display engine by placing a
> 'cursor' property on the first character of each before-string it
> creates to show the blamed commit.

After reading the documentation, I cannot quite figure what I am
supposed to do.  Given this:

(with-current-buffer (get-buffer-create "demo")
  (pop-to-buffer (current-buffer))
  (erase-buffer)
  (insert "one\ntwo\nthree")
  (backward-word 2)
  (let ((ov (make-overlay (point)
                          (save-excursion
                            (forward-line 1)
                            (point))))
        (heading "before two\n"))
    (overlay-put ov 'before-string heading)
    (overlay-put ov 'the-value "two")
    (overlay-put ov 'evaporate t)))

I think I am supposed to change it to:

(with-current-buffer (get-buffer-create "demo")
  (pop-to-buffer (current-buffer))
  (erase-buffer)
  (insert "one\ntwo\nthree")
  (backward-word 2)
  (let ((ov (make-overlay (point)
                          (save-excursion
                            (forward-line 1)
                            (point))))
        (heading "before two\n"))
    (put-text-property 0 1 'cursor (length heading) heading)
    (overlay-put ov 'before-string heading)
    (overlay-put ov 'the-value "two")
    (overlay-put ov 'evaporate t)))

However I would then expect that it would become possible for the cursor
to be displayed "on" the "b" because of this: "In other words, the
string character with the ‘cursor’ property of any non-‘nil’ value is
the character where to display the cursor.  The value of the property
says for which buffer positions to display the cursor there."

one
*efore two
two
three

That would be a change in behavior* but I am not seeing any change so I
am unsure whether I am doing this all wrong.  If so, then please correct
the above code.

* However if that is possible, I would prefer to use the `cursor'
property to provide the hint to the display engine that the cursor
should keep ending up here (as it does without fiddling with `cursor' at
all):

one
before two
*wo
three

Given "the cursor will be displayed on this character for any buffer
position in the range `[OVPOS..OVPOS+N)'", I don't see how I can say
"display the cursor HERE instead of at the positions BEFORE HERE as
specified by N".




This bug report was last modified 8 years and 283 days ago.

Previous Next


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