* Suggestion: A fringe indicator that shows the last/first line before scrolling
@ 2008-02-28 11:48 Tassilo Horn
2008-02-28 13:55 ` David O'Toole
2008-02-29 1:40 ` Richard Stallman
0 siblings, 2 replies; 34+ messages in thread
From: Tassilo Horn @ 2008-02-28 11:48 UTC (permalink / raw)
To: emacs-devel
Hi,
when I scroll a large document with C-v (scroll-up) / M-v (scroll-down)
I often have a hard time to spot the line where I was reading. I think
it would be much easier to find that place, if there was some indicator
in the fringe that shows the first/last line that was visible before the
scrolling command was performed.
If you scroll up (i.e. with C-v) it shows the last visible line before
the scroll, if you scroll down (i.e. with M-v) it shows the first.
What do you think?
Bye,
Tassilo
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 11:48 Suggestion: A fringe indicator that shows the last/first line before scrolling Tassilo Horn
@ 2008-02-28 13:55 ` David O'Toole
2008-02-28 15:46 ` Lennart Borgman (gmail)
2008-02-28 17:19 ` Stefan Monnier
2008-02-29 1:40 ` Richard Stallman
1 sibling, 2 replies; 34+ messages in thread
From: David O'Toole @ 2008-02-28 13:55 UTC (permalink / raw)
To: emacs-devel
I like this idea, I tend to have the same problem.
I wonder if this could be implemented in plain Emacs Lisp?
On Thu, Feb 28, 2008 at 6:48 AM, Tassilo Horn <tassilo@member.fsf.org> wrote:
> Hi,
>
> when I scroll a large document with C-v (scroll-up) / M-v (scroll-down)
> I often have a hard time to spot the line where I was reading. I think
> it would be much easier to find that place, if there was some indicator
> in the fringe that shows the first/last line that was visible before the
> scrolling command was performed.
>
> If you scroll up (i.e. with C-v) it shows the last visible line before
> the scroll, if you scroll down (i.e. with M-v) it shows the first.
>
> What do you think?
>
> Bye,
> Tassilo
>
>
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 13:55 ` David O'Toole
@ 2008-02-28 15:46 ` Lennart Borgman (gmail)
2008-02-28 16:34 ` David De La Harpe Golden
2008-02-28 17:19 ` Stefan Monnier
1 sibling, 1 reply; 34+ messages in thread
From: Lennart Borgman (gmail) @ 2008-02-28 15:46 UTC (permalink / raw)
To: David O'Toole; +Cc: emacs-devel
David O'Toole wrote:
> I like this idea, I tend to have the same problem.
Me too.
> I wonder if this could be implemented in plain Emacs Lisp?
A post command hook?
> On Thu, Feb 28, 2008 at 6:48 AM, Tassilo Horn <tassilo@member.fsf.org> wrote:
>> Hi,
>>
>> when I scroll a large document with C-v (scroll-up) / M-v (scroll-down)
>> I often have a hard time to spot the line where I was reading. I think
>> it would be much easier to find that place, if there was some indicator
>> in the fringe that shows the first/last line that was visible before the
>> scrolling command was performed.
>>
>> If you scroll up (i.e. with C-v) it shows the last visible line before
>> the scroll, if you scroll down (i.e. with M-v) it shows the first.
>>
>> What do you think?
>>
>> Bye,
>> Tassilo
>>
>>
>>
>
>
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 15:46 ` Lennart Borgman (gmail)
@ 2008-02-28 16:34 ` David De La Harpe Golden
2008-02-28 17:52 ` Lennart Borgman (gmail)
0 siblings, 1 reply; 34+ messages in thread
From: David De La Harpe Golden @ 2008-02-28 16:34 UTC (permalink / raw)
To: Lennart Borgman (gmail); +Cc: David O'Toole, emacs-devel
On 28/02/2008, Lennart Borgman (gmail) <lennart.borgman@gmail.com> wrote:
> David O'Toole wrote:
> > I like this idea, I tend to have the same problem.
>
>
> Me too.
>
>
> > I wonder if this could be implemented in plain Emacs Lisp?
>
>
> A post command hook?
>
The recent onlist discussion around scroll-restore.el suggests that
wouldn't quite work, anyway - not all scrolling thingys are commands.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 13:55 ` David O'Toole
2008-02-28 15:46 ` Lennart Borgman (gmail)
@ 2008-02-28 17:19 ` Stefan Monnier
2008-02-28 17:39 ` Tassilo Horn
1 sibling, 1 reply; 34+ messages in thread
From: Stefan Monnier @ 2008-02-28 17:19 UTC (permalink / raw)
To: David O'Toole; +Cc: emacs-devel
> I like this idea, I tend to have the same problem.
> I wonder if this could be implemented in plain Emacs Lisp?
Yes, it must be possible.
Basically, use a pre-command-hook to remember window-start and
window-end, and a post-command-hook where you place visual indicators at
those 2 remembered spots. Plus maybe a timer that removes those visual
indicators after a few seconds?
Stefan
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 17:19 ` Stefan Monnier
@ 2008-02-28 17:39 ` Tassilo Horn
2008-02-28 18:16 ` Stefan Monnier
0 siblings, 1 reply; 34+ messages in thread
From: Tassilo Horn @ 2008-02-28 17:39 UTC (permalink / raw)
To: emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> I like this idea, I tend to have the same problem.
>> I wonder if this could be implemented in plain Emacs Lisp?
>
> Yes, it must be possible.
Good to hear.
> Basically, use a pre-command-hook to remember window-start and
> window-end, and a post-command-hook where you place visual indicators
> at those 2 remembered spots.
I've read through
(info "(elisp)Fringes")
and used `C-u C-h a fringe' but I cannot find out how to add new
indicators to the fringes at a specific position. Am I missing
something?
Bye,
Tassilo
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 16:34 ` David De La Harpe Golden
@ 2008-02-28 17:52 ` Lennart Borgman (gmail)
2008-02-28 18:01 ` David De La Harpe Golden
0 siblings, 1 reply; 34+ messages in thread
From: Lennart Borgman (gmail) @ 2008-02-28 17:52 UTC (permalink / raw)
To: David De La Harpe Golden; +Cc: David O'Toole, emacs-devel
David De La Harpe Golden wrote:
> On 28/02/2008, Lennart Borgman (gmail) <lennart.borgman@gmail.com> wrote:
>> David O'Toole wrote:
>> > I like this idea, I tend to have the same problem.
>>
>>
>> Me too.
>>
>>
>> > I wonder if this could be implemented in plain Emacs Lisp?
>>
>>
>> A post command hook?
>>
>
> The recent onlist discussion around scroll-restore.el suggests that
> wouldn't quite work, anyway - not all scrolling thingys are commands.
I guess I have expressed myself a bit unclear here. Stefan expressed
this better. See his answer to David O'Toole.
Or am I missing something?
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 17:52 ` Lennart Borgman (gmail)
@ 2008-02-28 18:01 ` David De La Harpe Golden
2008-02-28 18:12 ` Lennart Borgman (gmail)
0 siblings, 1 reply; 34+ messages in thread
From: David De La Harpe Golden @ 2008-02-28 18:01 UTC (permalink / raw)
To: Lennart Borgman (gmail); +Cc: David O'Toole, emacs-devel
On 28/02/2008, Lennart Borgman (gmail) <lennart.borgman@gmail.com> wrote:
> David De La Harpe Golden wrote:
> > On 28/02/2008, Lennart Borgman (gmail) <lennart.borgman@gmail.com> wrote:
> >> David O'Toole wrote:
> >> > I like this idea, I tend to have the same problem.
> >>
> >>
> >> Me too.
> >>
> >>
> >> > I wonder if this could be implemented in plain Emacs Lisp?
> >>
> >>
> >> A post command hook?
> >>
> >
> > The recent onlist discussion around scroll-restore.el suggests that
> > wouldn't quite work, anyway - not all scrolling thingys are commands.
>
>
> I guess I have expressed myself a bit unclear here. Stefan expressed
> this better. See his answer to David O'Toole.
>
> Or am I missing something?
>
Well, it depends - if you want to do it only for actual commands
scroll-up and scroll-down, then post-command-hook will presumably
work. If you want to do it for "scrolling", then things like
scroll-bar scrolling may cause problems.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 18:01 ` David De La Harpe Golden
@ 2008-02-28 18:12 ` Lennart Borgman (gmail)
2008-02-28 18:18 ` David De La Harpe Golden
0 siblings, 1 reply; 34+ messages in thread
From: Lennart Borgman (gmail) @ 2008-02-28 18:12 UTC (permalink / raw)
To: David De La Harpe Golden; +Cc: David O'Toole, emacs-devel
David De La Harpe Golden wrote:
> Well, it depends - if you want to do it only for actual commands
> scroll-up and scroll-down, then post-command-hook will presumably
> work. If you want to do it for "scrolling", then things like
> scroll-bar scrolling may cause problems.
It looks like I am missing something. Are you saying that "things like
scroll-bar scrolling" is not done through Emacs "commands" (ie
interactive Emacs functions)?
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 17:39 ` Tassilo Horn
@ 2008-02-28 18:16 ` Stefan Monnier
0 siblings, 0 replies; 34+ messages in thread
From: Stefan Monnier @ 2008-02-28 18:16 UTC (permalink / raw)
To: emacs-devel
>> Basically, use a pre-command-hook to remember window-start and
>> window-end, and a post-command-hook where you place visual indicators
>> at those 2 remembered spots.
> I've read through
> (info "(elisp)Fringes")
> and used `C-u C-h a fringe' but I cannot find out how to add new
> indicators to the fringes at a specific position. Am I missing
> something?
The Fringe Bitmaps section describes it.
You may want to look at the function gdb-put-breakpoint-icon for an
example code that does it.
Stefan
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 18:12 ` Lennart Borgman (gmail)
@ 2008-02-28 18:18 ` David De La Harpe Golden
2008-02-28 18:34 ` Lennart Borgman (gmail)
0 siblings, 1 reply; 34+ messages in thread
From: David De La Harpe Golden @ 2008-02-28 18:18 UTC (permalink / raw)
To: Lennart Borgman (gmail); +Cc: David O'Toole, emacs-devel
On 28/02/2008, Lennart Borgman (gmail) <lennart.borgman@gmail.com> wrote:
> David De La Harpe Golden wrote:
>
> > Well, it depends - if you want to do it only for actual commands
> > scroll-up and scroll-down, then post-command-hook will presumably
> > work. If you want to do it for "scrolling", then things like
> > scroll-bar scrolling may cause problems.
>
>
> It looks like I am missing something. Are you saying that "things like
> scroll-bar scrolling" is not done through Emacs "commands" (ie
> interactive Emacs functions)?
>
See first caveat in opening comments in Martin's scroll-restore.el
http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg01892.html
and discussion thread following it.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 18:18 ` David De La Harpe Golden
@ 2008-02-28 18:34 ` Lennart Borgman (gmail)
2008-02-28 23:18 ` David De La Harpe Golden
0 siblings, 1 reply; 34+ messages in thread
From: Lennart Borgman (gmail) @ 2008-02-28 18:34 UTC (permalink / raw)
To: David De La Harpe Golden; +Cc: David O'Toole, emacs-devel
David De La Harpe Golden wrote:
> On 28/02/2008, Lennart Borgman (gmail) <lennart.borgman@gmail.com> wrote:
>> David De La Harpe Golden wrote:
>>
>>> Well, it depends - if you want to do it only for actual commands
>> > scroll-up and scroll-down, then post-command-hook will presumably
>> > work. If you want to do it for "scrolling", then things like
>> > scroll-bar scrolling may cause problems.
>>
>>
>> It looks like I am missing something. Are you saying that "things like
>> scroll-bar scrolling" is not done through Emacs "commands" (ie
>> interactive Emacs functions)?
>>
>
> See first caveat in opening comments in Martin's scroll-restore.el
>
> http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg01892.html
>
> and discussion thread following it.
Not sure I understood everything there, but what I noticed was that
point-before-scroll needs to have a window local value. Is that the main
issue?
Perhaps that can be emulated with a window local overlay at the moment?
(It is ugly of course, but just to test the concept with the fringe
indicator.)
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 18:34 ` Lennart Borgman (gmail)
@ 2008-02-28 23:18 ` David De La Harpe Golden
2008-02-29 1:55 ` Stefan Monnier
0 siblings, 1 reply; 34+ messages in thread
From: David De La Harpe Golden @ 2008-02-28 23:18 UTC (permalink / raw)
To: Lennart Borgman (gmail); +Cc: David O'Toole, emacs-devel
On 28/02/2008, Lennart Borgman (gmail) <lennart.borgman@gmail.com> wrote:
> >
> > See first caveat in opening comments in Martin's scroll-restore.el
> >
> > http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg01892.html
> >
> > and discussion thread following it.
>
>
> Not sure I understood everything there,
Sorry, I was initially wrongly presenting the issue - not about it
being non "commands", I guess (interactive "e") functions should still
count as commands. Martin found post-command-hooks apparently don't
run in some circumstances for such things - here's the relevant caveat
text I referred to:
;; Scroll Restore mode does not handle `switch-frame' and
;; `vertical-scroll-bar' events executed within the loops in
;; `mouse-show-mark' and `scroll-bar-drag' (these don't call
;; `post-command-hook' as needed by Scroll Restore mode).
So try this (on X11 at least):
(add-hook 'post-command-hook
(lambda () (message "post-command-hook %s" (current-time))))
Then activate the region with the mouse, scroll with scroll bar.. no update.
This might just be a bug, or intentional (though kind of inconsistent)
behaviour, I don't know.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 11:48 Suggestion: A fringe indicator that shows the last/first line before scrolling Tassilo Horn
2008-02-28 13:55 ` David O'Toole
@ 2008-02-29 1:40 ` Richard Stallman
2008-02-29 8:02 ` Tassilo Horn
1 sibling, 1 reply; 34+ messages in thread
From: Richard Stallman @ 2008-02-29 1:40 UTC (permalink / raw)
To: Tassilo Horn; +Cc: emacs-devel
If you scroll up (i.e. with C-v) it shows the last visible line before
the scroll, if you scroll down (i.e. with M-v) it shows the first.
There are normally two lines of overlap, so why do you need this?
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-28 23:18 ` David De La Harpe Golden
@ 2008-02-29 1:55 ` Stefan Monnier
2008-02-29 2:50 ` David De La Harpe Golden
0 siblings, 1 reply; 34+ messages in thread
From: Stefan Monnier @ 2008-02-29 1:55 UTC (permalink / raw)
To: David De La Harpe Golden
Cc: David O'Toole, Lennart Borgman (gmail), emacs-devel
> So try this (on X11 at least):
> (add-hook 'post-command-hook
> (lambda () (message "post-command-hook %s" (current-time))))
> Then activate the region with the mouse, scroll with scroll bar.. no update.
> This might just be a bug, or intentional (though kind of inconsistent)
> behaviour, I don't know.
It's neither. It's just the result of how the code is written: there's
only one command (the mouse-drag) which happens to read several events
waiting for the event that marks the end of the drag.
Usually each event is associated with a command (modulo commands bound
to event sequences like C-x C-x), but it's not necessarily the case.
There are other cases where scrolling can happen without running
post-command-hook, e.g. scrolling triggered by process filters
(e.g. scrolling in the *compilation* buffer or in tail-mode buffers).
Stefan
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 1:55 ` Stefan Monnier
@ 2008-02-29 2:50 ` David De La Harpe Golden
2008-02-29 4:33 ` Stefan Monnier
0 siblings, 1 reply; 34+ messages in thread
From: David De La Harpe Golden @ 2008-02-29 2:50 UTC (permalink / raw)
To: Stefan Monnier; +Cc: David O'Toole, Lennart Borgman (gmail), emacs-devel
On 29/02/2008, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> It's neither. It's just the result of how the code is written: there's
> only one command (the mouse-drag) which happens to read several
> events waiting for the event that marks the end of the drag.
>
What events actually terminate the drag ? Martin said it was in
mouse-show-mark the problem arises, and it seems that that is called
by mouse-drag-track, and you are deliberately handling scroll-bar
events there - think that means that when the mouse-drag is "almost
over" and mouse-show-mark is happening, the scroll-bar scrolling is
atypically not causing post-command-hooks?
Of course, and I only just noticed this since I usually use transient
mark mode, that post-drag-scrolling mouse-highlight behaviour is also
different depending on whether transient-mark-mode-is on or not - when
it is off, the mouse selected region is still highlighted and
independent of point when scrolling. I'm not sure, but that may be
one of the major intents of mouse-show-mark?
Is the call to mouse-show-mark in mouse-drag-track useful when
transient-mark-mode is t? When I wrap it in an
(unless (eq transient-mark-mode 't) (mouse-show-mark)), I get
perhaps more like naively expected behaviour - ending the mouse drag
(mouse-1-up) causes a post-command-hook, and post-mouse-drag
scroll-bar scrolling causes a post-command-hook.
All pretty irrelevant given below, but anyway.
> There are other cases where scrolling can happen without running
> post-command-hook, e.g. scrolling triggered by process filters
> (e.g. scrolling in the *compilation* buffer or in tail-mode buffers).
>
Fair enough - means post-command-hook is a nonstarter like it was for
point movements.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 2:50 ` David De La Harpe Golden
@ 2008-02-29 4:33 ` Stefan Monnier
2008-02-29 17:57 ` David De La Harpe Golden
0 siblings, 1 reply; 34+ messages in thread
From: Stefan Monnier @ 2008-02-29 4:33 UTC (permalink / raw)
To: David De La Harpe Golden
Cc: David O'Toole, Lennart Borgman (gmail), emacs-devel
>> It's neither. It's just the result of how the code is written: there's
>> only one command (the mouse-drag) which happens to read several
>> events waiting for the event that marks the end of the drag.
> What events actually terminate the drag ? Martin said it was in
That is yet-another-problem due to the way the code is written.
Actually this part of the mouse-drag is really ugly. When the drag
ends, the command doesn't end: it waits for the next event (i.e. the
next command). This is because it want to know if the next event is one
of mouse-region-delete-keys.
I hope we can get rid of this madness at some point. E.g. by (re)using
the delete-selection-code for this feature.
>> There are other cases where scrolling can happen without running
>> post-command-hook, e.g. scrolling triggered by process filters
>> (e.g. scrolling in the *compilation* buffer or in tail-mode buffers).
> Fair enough - means post-command-hook is a nonstarter like it was for
> point movements.
Not really. It just means it will only work 99%.
For a more reliable result you'll probably want/need to hack the C code
to introduce some kind of pre-redisplay-hook, since what you're looking
for is linked to the display changes rather than to execution of commands.
Stefan
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 1:40 ` Richard Stallman
@ 2008-02-29 8:02 ` Tassilo Horn
2008-02-29 19:54 ` Richard Stallman
0 siblings, 1 reply; 34+ messages in thread
From: Tassilo Horn @ 2008-02-29 8:02 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
Richard Stallman <rms@gnu.org> writes:
> If you scroll up (i.e. with C-v) it shows the last visible line
> before the scroll, if you scroll down (i.e. with M-v) it shows the
> first.
>
> There are normally two lines of overlap, so why do you need this?
Here it are three lines, although `next-screen-context-lines' is at its
default value of 2. So after a C-v the formerly last line will be the
third line after the scroll.
Anyway, I think it would ease finding the right position, because
spotting a fringe indicator is easier to do than to count the lines from
the top/bottom of a window.
It would especially help if you don't scroll by "near a full page" but a
given amount of lines or when scrolling is done as a result of point
movement. (Ok, I can see that scrolling because of moving point usually
centers the window around point.)
Bye,
Tassilo
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 4:33 ` Stefan Monnier
@ 2008-02-29 17:57 ` David De La Harpe Golden
2008-02-29 21:04 ` David De La Harpe Golden
0 siblings, 1 reply; 34+ messages in thread
From: David De La Harpe Golden @ 2008-02-29 17:57 UTC (permalink / raw)
To: Stefan Monnier, Tassilo Horn
Cc: David O'Toole, Lennart Borgman (gmail), emacs-devel
On 29/02/2008, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> Not really. It just means it will only work 99%.
>
Quite different 99% approach sketched below, uses our old friend the
idle timer, to show the window position in the fringe with a 2 sec
lag. Works better than I expected.
I think I'm not quite getting something though: why are fringe marks
"replacing" display properties (i.e. if a character pos has a fringe
display property, the character isn't displayed)? - that leads to my
use of before and after string properties. I wanted to hide the
fringe marks conditionally while they align with the real window-start
and window-end (they're not useful then), but because the fringe marks
are "replacing", the magic "when" conditional display property is
unsuitable for that. If before/after-string properties supported
"when" or fringe marks weren't "replacing" display properties....
(defface window-pos-fringe
'((t (:foreground "cyan")))
"Window pos fringe face"
:group 'scrolling)
(defvar show-old-window-pos-overlay
(make-overlay (window-start) (window-end)))
(overlay-put show-old-window-pos-overlay 'before-string
(concat
(propertize "[" 'display
(list 'left-fringe 'top-left-angle
'window-pos-fringe))
(propertize "[" 'display
(list 'right-fringe 'top-right-angle
'window-pos-fringe))))
(overlay-put show-old-window-pos-overlay 'after-string
(concat
(propertize "]" 'display
(list 'left-fringe 'bottom-left-angle
'window-pos-fringe))
(propertize "]" 'display
(list 'right-fringe
'bottom-right-angle
'window-pos-fringe))))
(defun update-window-pos-overlay ()
(move-overlay show-old-window-pos-overlay
(window-start)
(- (window-end) 1)
(window-buffer))
(redisplay))
(run-with-idle-timer 2 t 'update-window-pos-overlay)
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 8:02 ` Tassilo Horn
@ 2008-02-29 19:54 ` Richard Stallman
2008-03-01 9:28 ` Tassilo Horn
0 siblings, 1 reply; 34+ messages in thread
From: Richard Stallman @ 2008-02-29 19:54 UTC (permalink / raw)
To: Tassilo Horn; +Cc: emacs-devel
Here it are three lines, although `next-screen-context-lines' is at its
default value of 2.
Why is that? Is it due to varying line heights? (Usually people find
it easy to spot the text they were just reading.)
Anyway, I think it would ease finding the right position, because
spotting a fringe indicator is easier to do than to count the lines from
the top/bottom of a window.
If a number of people find this useful, I have nothing against it.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 17:57 ` David De La Harpe Golden
@ 2008-02-29 21:04 ` David De La Harpe Golden
2008-02-29 21:12 ` David De La Harpe Golden
` (2 more replies)
0 siblings, 3 replies; 34+ messages in thread
From: David De La Harpe Golden @ 2008-02-29 21:04 UTC (permalink / raw)
To: Stefan Monnier, Tassilo Horn
Cc: David O'Toole, Lennart Borgman (gmail), emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]
> I wanted to hide the
> fringe marks conditionally while they align with the real window-start
> and window-end (they're not useful then),
Huh. Of course, what's an apparently viable workaround? Another idle
timer! Yay!
Version 2 attached - made it a global minor mode.
Probably lots of issues, most major apart from previous mail's
"am I using fringes and overlays right" question:
really should use separate overlay for each window (maybe weak hash
table needed, or is there a way to hang things off windows I've
missed?), right now, only shows in current window, which is a pity
because it'd probably be particularly nice for scroll-other-window
situations.
nongui terminals and gui terminals without fringes, could use
alternate highlighting strategies I guess.
If you scroll fast, then what's fringe marked is of course not the
immediately preceding window position, but the one from when emacs was
last idle. This is both desirable and undesirable, depending on
whether you consider a series of consecutive scroll commands as one
overall scroll operation or separate scroll operations, so not sure if
should be fixed, maybe a post-command-hook could be used so that
depending on user prefs, page-scrolling could fringe mark anew each
time while scroll-bar-scrolling only after the lag, or whatever makes
sense.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: show-old-window-pos.el --]
[-- Type: text/x-emacs-lisp; name=show-old-window-pos.el, Size: 2602 bytes --]
;;; show-old-window-pos.el --- Show old window position in buffer after changes.
;; Version: 2
(defgroup show-old-window-pos nil
"Indicate the old window position for a bit when scrolling."
:version "23.1"
:group 'windows)
(defface show-old-window-pos-fringe
'((t (:foreground "cyan")))
"Face for old window position fringe mark."
:group 'show-old-window-pos
:version "23.1")
(defcustom show-old-window-pos-linger-time 2
"How long the fringe marks showing old window position should be visible for."
:type 'integer
:group 'show-old-window-pos
:version "23.1")
(defvar show-old-window-pos-overlay nil)
(defun show-old-window-pos-overlay-update-pos ()
(or show-old-window-pos-overlay
(setq show-old-window-pos-overlay
(make-overlay
(window-start)
(- (window-end) 1)
(window-buffer))))
(move-overlay show-old-window-pos-overlay
(window-start)
(- (window-end) 1)
(window-buffer))
(show-old-window-pos-overlay-showhide)
(redisplay))
(defun show-old-window-pos-overlay-showhide ()
(when show-old-window-pos-overlay
(if (equal (window-start) (overlay-start show-old-window-pos-overlay))
(overlay-put show-old-window-pos-overlay 'before-string nil)
(overlay-put show-old-window-pos-overlay 'before-string
(concat
(propertize "[" 'display
(list 'left-fringe 'top-left-angle
'show-old-window-pos-fringe))
(propertize "[" 'display
(list 'right-fringe 'top-right-angle
'show-old-window-pos-fringe)))))
(if (equal (- (window-end) 1) (overlay-end show-old-window-pos-overlay))
(overlay-put show-old-window-pos-overlay 'after-string nil)
(overlay-put show-old-window-pos-overlay 'after-string
(concat
(propertize "]" 'display
(list 'left-fringe 'bottom-left-angle
'show-old-window-pos-fringe))
(propertize "]" 'display
(list 'right-fringe
'bottom-right-angle
'show-old-window-pos-fringe)))))))
(define-minor-mode show-old-window-pos-mode
"Toggle show-old-window-pos-mode"
:global t
:group 'show-old-window-pos
:init-value nil
(if show-old-window-pos-mode
(progn
(run-with-idle-timer 0 t 'show-old-window-pos-overlay-showhide)
(run-with-idle-timer show-old-window-pos-linger-time
t 'show-old-window-pos-overlay-update-pos))
(cancel-function-timers 'show-old-window-pos-overlay-showhide)
(cancel-function-timers 'show-old-window-pos-overlay-update-pos)
(and show-old-window-pos-overlay
(delete-overlay show-old-window-pos-overlay))))
(provide 'show-old-window-pos)
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 21:04 ` David De La Harpe Golden
@ 2008-02-29 21:12 ` David De La Harpe Golden
2008-02-29 21:33 ` Lennart Borgman (gmail)
2008-03-01 3:28 ` David De La Harpe Golden
2 siblings, 0 replies; 34+ messages in thread
From: David De La Harpe Golden @ 2008-02-29 21:12 UTC (permalink / raw)
To: Stefan Monnier, Tassilo Horn
Cc: David O'Toole, Lennart Borgman (gmail), emacs-devel
On 29/02/2008, David De La Harpe Golden
<david.delaharpe.golden@gmail.com> wrote:
> should be fixed, maybe a post-command-hook
I probably meant pre not post there...
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 21:04 ` David De La Harpe Golden
2008-02-29 21:12 ` David De La Harpe Golden
@ 2008-02-29 21:33 ` Lennart Borgman (gmail)
2008-02-29 23:16 ` David De La Harpe Golden
2008-03-01 3:28 ` David De La Harpe Golden
2 siblings, 1 reply; 34+ messages in thread
From: Lennart Borgman (gmail) @ 2008-02-29 21:33 UTC (permalink / raw)
To: David De La Harpe Golden
Cc: Tassilo Horn, David O'Toole, Stefan Monnier, emacs-devel
David De La Harpe Golden wrote:
>> I wanted to hide the
>> fringe marks conditionally while they align with the real window-start
>> and window-end (they're not useful then),
>
> Huh. Of course, what's an apparently viable workaround? Another idle
> timer! Yay!
>
> Version 2 attached - made it a global minor mode.
>
> Probably lots of issues, most major apart from previous mail's
> "am I using fringes and overlays right" question:
>
> really should use separate overlay for each window (maybe weak hash
> table needed, or is there a way to hang things off windows I've
> missed?), right now, only shows in current window, which is a pity
> because it'd probably be particularly nice for scroll-other-window
> situations.
(overlay-put overlay 'window the-window)
> nongui terminals and gui terminals without fringes, could use
> alternate highlighting strategies I guess.
>
> If you scroll fast, then what's fringe marked is of course not the
> immediately preceding window position, but the one from when emacs was
> last idle. This is both desirable and undesirable, depending on
> whether you consider a series of consecutive scroll commands as one
> overall scroll operation or separate scroll operations, so not sure if
> should be fixed, maybe a post-command-hook could be used so that
> depending on user prefs, page-scrolling could fringe mark anew each
> time while scroll-bar-scrolling only after the lag, or whatever makes
> sense.
If you press page-down several times the mark disappears.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 21:33 ` Lennart Borgman (gmail)
@ 2008-02-29 23:16 ` David De La Harpe Golden
2008-02-29 23:29 ` Lennart Borgman (gmail)
0 siblings, 1 reply; 34+ messages in thread
From: David De La Harpe Golden @ 2008-02-29 23:16 UTC (permalink / raw)
To: Lennart Borgman (gmail)
Cc: Tassilo Horn, David O'Toole, Stefan Monnier, emacs-devel
On 29/02/2008, Lennart Borgman (gmail) <lennart.borgman@gmail.com
wrote:
> (overlay-put overlay 'window the-window)
>
Well, that's not quite what I meant. That means the overlay only
displays on that window AFAIK, which is desirable for the effect - but
it doesn't let you, given the window, find the overlay, at least not
directly.
> If you press page-down several times the mark disappears.
Indeed - I suggested a pre-command-hook could warp before each page
down to highlight anew each time, but that's only desirable sometimes
(whole-page scrolls the most likely case - it would be horrible for
scroll-bar or point-move scrolls). Anyway, think next version can
make that customisable.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 23:16 ` David De La Harpe Golden
@ 2008-02-29 23:29 ` Lennart Borgman (gmail)
2008-02-29 23:59 ` David De La Harpe Golden
0 siblings, 1 reply; 34+ messages in thread
From: Lennart Borgman (gmail) @ 2008-02-29 23:29 UTC (permalink / raw)
To: David De La Harpe Golden; +Cc: emacs-devel
David De La Harpe Golden wrote:
> On 29/02/2008, Lennart Borgman (gmail) <lennart.borgman@gmail.com
> wrote:
>> (overlay-put overlay 'window the-window)
>>
>
> Well, that's not quite what I meant. That means the overlay only
> displays on that window AFAIK, which is desirable for the effect - but
> it doesn't let you, given the window, find the overlay, at least not
> directly.
But couldn't you keep a list of the overlays for the different windows
where the buffer is displayed?
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 23:29 ` Lennart Borgman (gmail)
@ 2008-02-29 23:59 ` David De La Harpe Golden
2008-03-01 0:05 ` David De La Harpe Golden
2008-03-01 0:10 ` Lennart Borgman (gmail)
0 siblings, 2 replies; 34+ messages in thread
From: David De La Harpe Golden @ 2008-02-29 23:59 UTC (permalink / raw)
To: Lennart Borgman (gmail); +Cc: emacs-devel
On 29/02/2008, Lennart Borgman (gmail) <lennart.borgman@gmail.com> wrote:
>
> But couldn't you keep a list of the overlays for the different windows
> where the buffer is displayed?
But wouldn't a (nonweak) list prevent proper gc of the windows? (I was
intending to use the window property of the overlay you mentioned). Of
course I have no actual idea how windows are gced in emacs.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 23:59 ` David De La Harpe Golden
@ 2008-03-01 0:05 ` David De La Harpe Golden
2008-03-01 0:10 ` Lennart Borgman (gmail)
1 sibling, 0 replies; 34+ messages in thread
From: David De La Harpe Golden @ 2008-03-01 0:05 UTC (permalink / raw)
To: Lennart Borgman (gmail); +Cc: emacs-devel
On 29/02/2008, David De La Harpe Golden
<david.delaharpe.golden@gmail.com> wrote:
> On 29/02/2008, Lennart Borgman (gmail) <lennart.borgman@gmail.com> wrote:
> >
>
> > But couldn't you keep a list of the overlays for the different windows
> > where the buffer is displayed?
>
... Anyhow, I made the minor mode global - Is having it working only for
certain buffers useful? I'm not sure how best to do that once timers
get involved.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 23:59 ` David De La Harpe Golden
2008-03-01 0:05 ` David De La Harpe Golden
@ 2008-03-01 0:10 ` Lennart Borgman (gmail)
1 sibling, 0 replies; 34+ messages in thread
From: Lennart Borgman (gmail) @ 2008-03-01 0:10 UTC (permalink / raw)
To: David De La Harpe Golden; +Cc: emacs-devel
David De La Harpe Golden wrote:
> On 29/02/2008, Lennart Borgman (gmail) <lennart.borgman@gmail.com> wrote:
>> But couldn't you keep a list of the overlays for the different windows
>> where the buffer is displayed?
>
> But wouldn't a (nonweak) list prevent proper gc of the windows? (I was
> intending to use the window property of the overlay you mentioned). Of
> course I have no actual idea how windows are gced in emacs.
No idea about gc here.
But you can anyway change those lists in window-configuration-change-hook.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 21:04 ` David De La Harpe Golden
2008-02-29 21:12 ` David De La Harpe Golden
2008-02-29 21:33 ` Lennart Borgman (gmail)
@ 2008-03-01 3:28 ` David De La Harpe Golden
2008-03-01 3:39 ` Miles Bader
2008-03-01 3:44 ` David De La Harpe Golden
2 siblings, 2 replies; 34+ messages in thread
From: David De La Harpe Golden @ 2008-03-01 3:28 UTC (permalink / raw)
To: Stefan Monnier, Tassilo Horn
Cc: David O'Toole, Lennart Borgman (gmail), emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1613 bytes --]
Version 3... "not perfect, but nice enough to use"
*** Changes:
Added explicit copyright+license comment in case that's an issue.
Separate overlay per window. Tracked in weak hash table as it seemed
as easy to do it that way.
Still just uses two global idle timers, so all the timings of changes
are linked . Doesn't seem to matter much for just this
show-old-window-pos functionality though - the fringe marks are only
intended to be transiently displayed for a couple of seconds as a
visual aid anyway, and doesn't really matter much if they linger for
slightly off the stated time.
Note if you pause too long in the middle of a "scroll gesture" (i.e.
sequence of consecutive scrolling commands), then the fringe marks
will disappear and restart from where you paused. This is a good
reason why this is just not the way to do Martin's scroll-restore
point-tracking functionality, of course, but could even be considered
a feature rather than a bug in this context.
Added a customizable list of commands that warp the old position overlay,
the default means that the page-scrolling marks reappear each
individual page scroll, which is probably what people want for
page-by-page scrolling. This actually warps all the old pos overlays,
not just the overlays in the window(s) associated with the command,
but again doesn't seem to matter much given transience of the effect.
*** still issue:
nongui terminals and gui terminals without fringes could use
alternate highlighting strategies I guess. Not sure what alternate
highlighting strategies are sensible, anything other than fringes
seems kinda ugly.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: show-old-window-pos.el --]
[-- Type: text/x-emacs-lisp; name=show-old-window-pos.el, Size: 5976 bytes --]
;;; show-old-window-pos.el --- Show old window position briefly after it changes.
;; Copyright (C) 2008 David De La Harpe Golden
;; Author: David De La Harpe Golden <david.delaharpe.golden@gmail.com>
;; Version: 3
;; Keywords: scrolling
;; show-old-window-pos.el is free software; you can redistribute it
;; and/or modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 3 of
;; the License, or (at your option) any later version.
;; show-old-window-pos.el is distributed in the hope that it will be
;; useful, but WITHOUT ANY WARRANTY; without even the implied warranty
;; of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; This package provides fringe marks that show where in the buffer
;; the window used to be showing for a couple of seconds when the
;; window position changes through scrolling etc.
;; This is done via timers, and is on a "best effort" basis only.
;;; Code:
(defgroup show-old-window-pos nil
"Indicate (in the fringe) the old window position for a bit when scrolling."
:version "23.1"
:group 'windows)
(defface show-old-window-pos-fringe
'((t (:foreground "darkcyan")))
"Face for old window position fringe mark."
:group 'show-old-window-pos
:version "23.1")
(defcustom show-old-window-pos-linger-time 2
"How long the fringe marks showing old window position should be visible for."
:type 'integer
:group 'show-old-window-pos
:version "23.1")
(defcustom show-old-window-pos-each-time-commands
'(scroll-up scroll-down scroll-other-window scroll-other-window-down)
"What commands should always show the immediately preceding old window position.
Typically, one would want only commands that cause large scrolls
or other window changes listed here."
:type '(repeat symbol)
:group 'show-old-window-pos
:version "23.1")
(defvar show-old-window-pos-overlays (make-hash-table :weakness 'key))
(defun show-old-window-pos-overlays-ensure-hash-table ()
(unless (hash-table-p show-old-window-pos-overlays)
(setq show-old-window-pos-overlays (make-hash-table :weakness 'key))))
(defun show-old-window-pos-add-overlay (window)
(show-old-window-pos-overlays-ensure-hash-table)
(let ((overlay (make-overlay
(window-start window)
(- (window-end window) 1)
(window-buffer window))))
(overlay-put overlay 'window window)
(puthash window overlay show-old-window-pos-overlays)))
(defun show-old-window-pos-overlays-showhide ()
(show-old-window-pos-overlays-ensure-hash-table)
(mapcar (lambda (visible-frame)
(mapcar
(lambda (window)
(let ((old-pos-overlay
(gethash window show-old-window-pos-overlays)))
(unless old-pos-overlay
(show-old-window-pos-add-overlay window))
(if (equal (window-start window)
(overlay-start old-pos-overlay))
(overlay-put old-pos-overlay 'before-string nil)
(overlay-put
old-pos-overlay 'before-string
(concat
(propertize "[" 'display
(list 'left-fringe 'top-left-angle
'show-old-window-pos-fringe))
(propertize "[" 'display
(list 'right-fringe 'top-right-angle
'show-old-window-pos-fringe)))))
(if (equal (- (window-end window) 1)
(overlay-end old-pos-overlay))
(overlay-put old-pos-overlay 'after-string nil)
(overlay-put
old-pos-overlay 'after-string
(concat
(propertize "]" 'display
(list 'left-fringe 'bottom-left-angle
'show-old-window-pos-fringe))
(propertize "]" 'display
(list 'right-fringe
'bottom-right-angle
'show-old-window-pos-fringe)))))))
(window-list visible-frame)))
(visible-frame-list)))
(defun show-old-window-pos-overlays-update-pos ()
(show-old-window-pos-overlays-ensure-hash-table)
(mapcar (lambda (visible-frame)
(mapcar (lambda (window)
(let ((old-pos-overlay
(gethash window show-old-window-pos-overlays)))
(if old-pos-overlay
(move-overlay old-pos-overlay
(window-start window)
(- (window-end window) 1)
(window-buffer window))
(show-old-window-pos-add-overlay window))))
(window-list visible-frame)))
(visible-frame-list))
(show-old-window-pos-overlays-showhide)
(redisplay))
(defun show-old-window-pos-maybe-reset-old-pos ()
"Pre-command-hook that resets the old window pos before certain commands."
(when (memq this-command show-old-window-pos-each-time-commands)
(show-old-window-pos-overlays-update-pos)))
(define-minor-mode show-old-window-pos-mode
"Toggle show-old-window-pos-mode.
In show-old-window-pos-mode, if the fringes are present, fringe
marks will show the position the old window was showing in its
buffer for `show-old-window-pos-linger-time' seconds when the
window changes position."
:global t
:group 'show-old-window-pos
:init-value nil
:link '(emacs-commentary-link "show-old-window-pos.el")
(if show-old-window-pos-mode
(progn
(add-hook 'pre-command-hook 'show-old-window-pos-maybe-reset-old-pos)
(run-with-idle-timer 0 t 'show-old-window-pos-overlays-showhide)
(run-with-idle-timer show-old-window-pos-linger-time
t 'show-old-window-pos-overlays-update-pos))
(cancel-function-timers 'show-old-window-pos-overlays-showhide)
(cancel-function-timers 'show-old-window-pos-overlays-update-pos)
(remove-hook 'pre-command-hook 'show-old-window-pos-maybe-reset-old-pos)
;; Explicitly delete overlays.
(maphash (lambda (key val)
(if (overlayp val)
(delete-overlay val)))
show-old-window-pos-overlays)
(setq show-old-window-pos-overlays nil)))
(provide 'show-old-window-pos)
;;; show-old-window-pos.el ends here
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-03-01 3:28 ` David De La Harpe Golden
@ 2008-03-01 3:39 ` Miles Bader
2008-03-01 3:59 ` David De La Harpe Golden
2008-03-02 3:00 ` David De La Harpe Golden
2008-03-01 3:44 ` David De La Harpe Golden
1 sibling, 2 replies; 34+ messages in thread
From: Miles Bader @ 2008-03-01 3:39 UTC (permalink / raw)
To: David De La Harpe Golden
Cc: Lennart Borgman (gmail), Tassilo Horn, David O'Toole,
Stefan Monnier, emacs-devel
"David De La Harpe Golden" <david.delaharpe.golden@gmail.com> writes:
> nongui terminals and gui terminals without fringes could use
> alternate highlighting strategies I guess. Not sure what alternate
> highlighting strategies are sensible, anything other than fringes
> seems kinda ugly.
The usual GUI version of this feature just draws a line across the
window, which seems ok. Similarly, Emacs could highlight a whole line
with an appropriately low-key face (either a subtle-ish background color
change, or an underline might be appropriate).
Of course it might be hard to fine faces which are sufficiently low-key
on low-capability terminals (8 colors, no underling or bold, etc), but
at least if there's a face to be defined, the user could try to find
something which works for them in such cases...
-Miles
--
Congratulation, n. The civility of envy.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-03-01 3:28 ` David De La Harpe Golden
2008-03-01 3:39 ` Miles Bader
@ 2008-03-01 3:44 ` David De La Harpe Golden
1 sibling, 0 replies; 34+ messages in thread
From: David De La Harpe Golden @ 2008-03-01 3:44 UTC (permalink / raw)
To: Stefan Monnier, Tassilo Horn
Cc: David O'Toole, Lennart Borgman (gmail), emacs-devel
Changing 0 in
(run-with-idle-timer 0 t 'show-old-window-pos-overlays-showhide)
to 0.1 is probably sensible in version 3, scroll-bar scrolling maybe
gets a bit jerky when it's 0 when lots of frames open, and 0.1 is okay
for this human-oriented purpose.
(yes, code is dumbly iterating over all visible windows on a timer....)
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-03-01 3:39 ` Miles Bader
@ 2008-03-01 3:59 ` David De La Harpe Golden
2008-03-02 3:00 ` David De La Harpe Golden
1 sibling, 0 replies; 34+ messages in thread
From: David De La Harpe Golden @ 2008-03-01 3:59 UTC (permalink / raw)
To: Miles Bader
Cc: Lennart Borgman (gmail), Tassilo Horn, David O'Toole,
Stefan Monnier, emacs-devel
On 01/03/2008, Miles Bader <miles@gnu.org> wrote:
> The usual GUI version of this feature just draws a line across the
> window, which seems ok. Similarly, Emacs could highlight a whole line
> with an appropriately low-key face (either a subtle-ish background color
> change, or an underline might be appropriate).
>
Yeah, that should work, I was stupidly focussed on customizing the one
overlay, just may need to have two to three overlays per window so as
to highlight only the start and end lines.
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-02-29 19:54 ` Richard Stallman
@ 2008-03-01 9:28 ` Tassilo Horn
0 siblings, 0 replies; 34+ messages in thread
From: Tassilo Horn @ 2008-03-01 9:28 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
Richard Stallman <rms@gnu.org> writes:
> Here it are three lines, although `next-screen-context-lines' is
> at its default value of 2.
>
> Why is that? Is it due to varying line heights?
Seems to be caused by some option in my ~/.emacs, although I don't know
which might cause that. Maybe I'll try a bi-search later.
Bye,
Tassilo
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Suggestion: A fringe indicator that shows the last/first line before scrolling
2008-03-01 3:39 ` Miles Bader
2008-03-01 3:59 ` David De La Harpe Golden
@ 2008-03-02 3:00 ` David De La Harpe Golden
1 sibling, 0 replies; 34+ messages in thread
From: David De La Harpe Golden @ 2008-03-02 3:00 UTC (permalink / raw)
To: Miles Bader
Cc: Lennart Borgman (gmail), Tassilo Horn, David O'Toole,
Stefan Monnier, emacs-devel
On 01/03/2008, Miles Bader <miles@gnu.org> wrote:
>
> The usual GUI version of this feature just draws a line across the
> window, which seems ok. Similarly, Emacs could highlight a whole line
> with an appropriately low-key face (either a subtle-ish background color
> change, or an underline might be appropriate).
>
Working on that, noticed a difference between underlining on X and in
terminals: if a face has only underline set on a terminal and the
overlay with that face passes the narrower-than-window-width line end,
then the underline extends to the right edge of the window - in this
case desirable to get a line all the way across the window.
If a face has only underline set on X, that doesn't happen,
only happens if the face also has a different background set to the
frame background.
Not really up to speed on the C code, but I guess to fix the issue
xdisp.c/extend_face_to_end_of_line() probably just needs a small
change to extend if underline is set, not just boxes, different
backgrounds and stipples.
But then again, for more usual uses of underlining, not extending to
the right edge might be considered a feature, and on X displays the
fringe marks are available anyway.
^ permalink raw reply [flat|nested] 34+ messages in thread
end of thread, other threads:[~2008-03-02 3:00 UTC | newest]
Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-28 11:48 Suggestion: A fringe indicator that shows the last/first line before scrolling Tassilo Horn
2008-02-28 13:55 ` David O'Toole
2008-02-28 15:46 ` Lennart Borgman (gmail)
2008-02-28 16:34 ` David De La Harpe Golden
2008-02-28 17:52 ` Lennart Borgman (gmail)
2008-02-28 18:01 ` David De La Harpe Golden
2008-02-28 18:12 ` Lennart Borgman (gmail)
2008-02-28 18:18 ` David De La Harpe Golden
2008-02-28 18:34 ` Lennart Borgman (gmail)
2008-02-28 23:18 ` David De La Harpe Golden
2008-02-29 1:55 ` Stefan Monnier
2008-02-29 2:50 ` David De La Harpe Golden
2008-02-29 4:33 ` Stefan Monnier
2008-02-29 17:57 ` David De La Harpe Golden
2008-02-29 21:04 ` David De La Harpe Golden
2008-02-29 21:12 ` David De La Harpe Golden
2008-02-29 21:33 ` Lennart Borgman (gmail)
2008-02-29 23:16 ` David De La Harpe Golden
2008-02-29 23:29 ` Lennart Borgman (gmail)
2008-02-29 23:59 ` David De La Harpe Golden
2008-03-01 0:05 ` David De La Harpe Golden
2008-03-01 0:10 ` Lennart Borgman (gmail)
2008-03-01 3:28 ` David De La Harpe Golden
2008-03-01 3:39 ` Miles Bader
2008-03-01 3:59 ` David De La Harpe Golden
2008-03-02 3:00 ` David De La Harpe Golden
2008-03-01 3:44 ` David De La Harpe Golden
2008-02-28 17:19 ` Stefan Monnier
2008-02-28 17:39 ` Tassilo Horn
2008-02-28 18:16 ` Stefan Monnier
2008-02-29 1:40 ` Richard Stallman
2008-02-29 8:02 ` Tassilo Horn
2008-02-29 19:54 ` Richard Stallman
2008-03-01 9:28 ` Tassilo Horn
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).