From: lompik@voila.fr
To: Eli Zaretskii <eliz@gnu.org>, rudalics@gmx.at
Cc: 18545@debbugs.gnu.org
Subject: bug#18545: 24.4.50: Bug - forward-line inside with-selected-window
Date: Mon, 29 Sep 2014 02:31:04 +0200 (CEST) [thread overview]
Message-ID: <379420908.148791411950664752.JavaMail.www@wwinf7125> (raw)
In-Reply-To: <83oatzmy5h.fsf@gnu.org>
It still wrong scroll with all the 3 patches.I guess it is configuration specific + a call to "C-h k a".Fortunately, I had some some time to spend on it and here's a
minimal example:
1. emacs -Q
2. define following settings:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; scale minibuffer font up on entering
(defun my-minibuffer-setup ()
(set (make-local-variable 'face-remapping-alist)
'((default :height 1.8))))
(add-hook 'minibuffer-setup-hook 'my-minibuffer-setup)
;; make *Completions* buffer editable and add header line + insert "hello world" as overlay
(global-set-key (kbd "C-!") '(lambda ()
(interactive)
(with-selected-window (get-buffer-window "*Completions*")
(blink-cursor-mode -1)
(read-only-mode 0)
(goto-char 0)
(let ((start (point)))
(setq header-line-format
(propertize "Header line appears here" 'face 'header-line))
(insert "test:")
(overlay-put (make-overlay (point-at-bol) (point-at-eol))
'display "Hello World")
(insert "\n")
(put-text-property start
(point)
'face '(:family "Sans Serif" :foreground "black" :height 1.3 :weight bold) )))))
; some key-bindings to navigate *Completion* buffer from minibuffer
(global-set-key (kbd "C-`") '(lambda ()
(interactive)
(with-selected-window (get-buffer-window "*Completions*")
(forward-line 1))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3. hit the following key sequence:
C-x C-f -> in a folder with lots of files
[tab]x2 -> open completion buffer
C-! -> modify completion buffer
C-h k a -> Show help for letter "a" (Important ! skipping this results in no bug )
C-` until bottom of *Completions* buffer -> no scrolling,
I have applied the 3 patches that you supplied on emacs bzr revno 117517. I have tested this on 24.3.93 as well.
Regards,
Lompik.
> Message du 28/09/14 à 19h51
> De : "Eli Zaretskii"
> A : rudalics@gmx.at
> Copie à : lompik@voila.fr, 18545@debbugs.gnu.org
> Objet : Re: bug#18545: 24.4.50: Bug - forward-line inside with-selected-window
>
> > Date: Sun, 28 Sep 2014 19:29:47 +0300
> > From: Eli Zaretskii
> > Cc: lompik@voila.fr, 18545@debbugs.gnu.org
> >
> > > Date: Sun, 28 Sep 2014 11:34:44 +0200
> > > From: martin rudalics
> > > CC: lompik@voila.fr, 18545@debbugs.gnu.org
> > >
> > > > Hmm... I wonder why did we enter this area of the code, i.e. why did
> > > > this condition fire:
> > > >
> > > > /* Handle case where place to start displaying has been specified,
> > > > unless the specified location is outside the accessible range. */
> > > > if (w->force_start || window_frozen_p (w))
> > > >
> > > > Was w->force_start non-zero, or did window_frozen_p return non-zero?
> > > > If the former, can you see where was the force_start flag set? (I'd
> > > > be surprised if it's the latter, since windows are only frozen when we
> > > > grow the minibuffer, which shouldn't be happening here, I think.)
> > > >
> > > > In general, if the force_start flag of a window is set, that means we
> > > > shouldn't scroll, so bringing point back into view makes sense.
> > >
> > > That's likely me. Under certain conditions I do `recenter' with a
> > > negative argument in `post-command-hook' which basically looks like
> > >
> > > (recenter (max 0 (- (window-height) 7)))
> > >
> > > which triggers w->force_start being set here in xdisp.c:
> > >
> > > if (IT_CHARPOS (it) == PT)
> > > w->force_start = 1;
> >
> > That's what I thought.
> >
> > > So my case _is_ very likely special. Still "bringing point back into
> > > view" shouldn't make point appear on a partially visible line.
> >
> > No, that's likely the bug here. I will look into that.
>
> Does the patch below help? If not, can you tell where I goofed?
>
> === modified file 'src/xdisp.c'
> --- src/xdisp.c 2014-09-25 07:01:35 +0000
> +++ src/xdisp.c 2014-09-28 17:45:22 +0000
> @@ -16179,15 +16179,21 @@ redisplay_window (Lisp_Object window, bo
> && CHARPOS (startp) >= BEGV
> && CHARPOS (startp) <= ZV)
> {
> + ptrdiff_t it_charpos;
> +
> w->optional_new_start = 0;
> start_display (&it, w, startp);
> move_it_to (&it, PT, 0, it.last_visible_y, -1,
> MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
> - if (IT_CHARPOS (it) == PT)
> - w->force_start = 1;
> - /* IT may overshoot PT if text at PT is invisible. */
> - else if (IT_CHARPOS (it) > PT && CHARPOS (startp) <= PT)
> - w->force_start = 1;
> + it_charpos = IT_CHARPOS (it);
> + if (line_bottom_y (&it) < it.last_visible_y)
> + {
> + if (it_charpos == PT)
> + w->force_start = 1;
> + /* IT may overshoot PT if text at PT is invisible. */
> + else if (it_charpos > PT && CHARPOS (startp) <= PT)
> + w->force_start = 1;
> + }
> }
>
> force_start:
>
>
___________________________________________________________
Mode, hifi, maison,… J'achète malin. Je compare les prix avec Voila.fr http://shopping.voila.fr/
next prev parent reply other threads:[~2014-09-29 0:31 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-24 13:34 bug#18545: 24.4.50: Bug - forward-line inside with-selected-window lompik
2014-09-24 15:14 ` Stefan Monnier
2014-09-24 15:50 ` lompik
2014-09-25 13:55 ` Eli Zaretskii
2014-09-25 13:59 ` Eli Zaretskii
2014-09-25 15:20 ` Eli Zaretskii
2014-09-25 17:41 ` lompik
2014-09-25 17:51 ` Eli Zaretskii
2014-09-25 18:14 ` lompik
2014-09-25 18:31 ` Eli Zaretskii
2014-09-25 19:06 ` lompik
2014-09-25 19:18 ` Eli Zaretskii
2014-09-25 20:05 ` lompik
2014-09-26 7:31 ` Eli Zaretskii
2014-09-26 12:48 ` Stefan Monnier
2014-09-26 13:29 ` Eli Zaretskii
2014-09-26 14:13 ` Stefan Monnier
2014-09-26 15:20 ` Eli Zaretskii
2014-09-26 19:32 ` Stefan Monnier
2014-09-27 7:05 ` Eli Zaretskii
2014-09-27 14:45 ` lompik
2014-09-27 15:45 ` Eli Zaretskii
2014-09-27 7:35 ` martin rudalics
2014-09-27 8:53 ` Eli Zaretskii
2014-09-27 10:01 ` martin rudalics
2014-09-27 11:22 ` Eli Zaretskii
2014-09-27 13:36 ` martin rudalics
2014-09-27 16:06 ` Eli Zaretskii
2014-09-27 17:25 ` Stefan Monnier
2014-09-27 17:35 ` Eli Zaretskii
2014-09-27 17:53 ` Stefan Monnier
2014-09-27 19:03 ` martin rudalics
2014-09-27 19:38 ` Eli Zaretskii
2014-09-27 19:55 ` Eli Zaretskii
2014-09-28 9:34 ` martin rudalics
2014-09-28 16:29 ` Eli Zaretskii
2014-09-28 17:51 ` Eli Zaretskii
2014-09-28 19:03 ` martin rudalics
2014-09-28 19:25 ` Eli Zaretskii
2014-09-28 20:25 ` martin rudalics
2014-09-29 0:31 ` lompik [this message]
2014-09-29 6:16 ` Eli Zaretskii
2014-09-29 13:47 ` Eli Zaretskii
2014-09-29 14:21 ` lompik
2014-09-29 16:49 ` Eli Zaretskii
2014-09-29 22:56 ` lompik
2014-09-30 2:38 ` Eli Zaretskii
2014-09-27 19:01 ` martin rudalics
2014-09-27 19:27 ` Eli Zaretskii
2014-09-27 19:01 ` martin rudalics
2014-09-27 19:25 ` Eli Zaretskii
2014-09-28 9:33 ` martin rudalics
2014-09-28 16:33 ` Eli Zaretskii
2014-09-28 19:04 ` martin rudalics
2014-09-28 19:24 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=379420908.148791411950664752.JavaMail.www@wwinf7125 \
--to=lompik@voila.fr \
--cc=18545@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.