unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13361: 24.2.91; [regression] window point incompatible change
@ 2013-01-05  6:13 Leo Liu
  2013-01-05  6:32 ` Leo Liu
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Liu @ 2013-01-05  6:13 UTC (permalink / raw)
  To: 13361

I have just spent this morning trying to fix a 3rd party library
behaviour change only to find this annoying regression.

To reproduce

0. emacs -q
1. Create two buffers A and B and make them both visible in the frame
2. Insert some text in A and leave point at the end of buffer A
3. Switch to buffer B and eval
    
      (with-current-buffer "A" (goto-char (point-min)))

You will see point in buffer A doesn't change.

Leo





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#13361: 24.2.91; [regression] window point incompatible change
  2013-01-05  6:13 bug#13361: 24.2.91; [regression] window point incompatible change Leo Liu
@ 2013-01-05  6:32 ` Leo Liu
  2013-01-05  8:36   ` Glenn Morris
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Liu @ 2013-01-05  6:32 UTC (permalink / raw)
  To: 13361

Sorry not a regression. Sorry for the noise.

It is the same (albeit odd) behaviour in 24.2 too. Any idea why it
behaves so subtly like this?

Thanks,
Leo





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#13361: 24.2.91; [regression] window point incompatible change
  2013-01-05  6:32 ` Leo Liu
@ 2013-01-05  8:36   ` Glenn Morris
  2013-01-05  9:41     ` Leo Liu
  0 siblings, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2013-01-05  8:36 UTC (permalink / raw)
  To: Leo Liu; +Cc: 13361

Leo Liu wrote:

> It is the same (albeit odd) behaviour in 24.2 too. Any idea why it
> behaves so subtly like this?

Are you asking why window-point exists and is not always equal to point?

(with-current-buffer "A"
  (message "%s:%s:%s:%s"
           (point)
           (window-point (get-buffer-window "A"))
           (progn
             (goto-char (point-min))
             (point))
           (window-point (get-buffer-window "A")))
  (sit-for 1)
  (set-window-point (get-buffer-window "A") (point-min)))





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#13361: 24.2.91; [regression] window point incompatible change
  2013-01-05  8:36   ` Glenn Morris
@ 2013-01-05  9:41     ` Leo Liu
  2013-01-05 11:27       ` martin rudalics
  2013-01-05 19:13       ` Glenn Morris
  0 siblings, 2 replies; 7+ messages in thread
From: Leo Liu @ 2013-01-05  9:41 UTC (permalink / raw)
  To: 13361

On 2013-01-05 16:36 +0800, Glenn Morris wrote:
> Are you asking why window-point exists and is not always equal to point?

Yeah. For example some packages use with-current-buffer and move point
using goto-char and don't realise it can not be moved if the window is
visible but not current.

Leo






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#13361: 24.2.91; [regression] window point incompatible change
  2013-01-05  9:41     ` Leo Liu
@ 2013-01-05 11:27       ` martin rudalics
  2013-01-05 19:13       ` Glenn Morris
  1 sibling, 0 replies; 7+ messages in thread
From: martin rudalics @ 2013-01-05 11:27 UTC (permalink / raw)
  To: Leo Liu; +Cc: 13361

 > Yeah. For example some packages use with-current-buffer and move point
 > using goto-char and don't realise it can not be moved if the window is
 > visible but not current.

If these packages are part of Emacs, please write an appropriate bug
report.  Otherwise, kindly notify the respective author.

Thanks, martin





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#13361: 24.2.91; [regression] window point incompatible change
  2013-01-05  9:41     ` Leo Liu
  2013-01-05 11:27       ` martin rudalics
@ 2013-01-05 19:13       ` Glenn Morris
  2013-01-07  2:31         ` Leo Liu
  1 sibling, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2013-01-05 19:13 UTC (permalink / raw)
  To: Leo Liu; +Cc: 13361

Leo Liu wrote:

> On 2013-01-05 16:36 +0800, Glenn Morris wrote:
>> Are you asking why window-point exists and is not always equal to point?
>
> Yeah. For example some packages use with-current-buffer and move point
> using goto-char and don't realise it can not be moved if the window is
> visible but not current.

As the example I gave showed, point does move. In any case, I don't see
any bug here.







^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#13361: 24.2.91; [regression] window point incompatible change
  2013-01-05 19:13       ` Glenn Morris
@ 2013-01-07  2:31         ` Leo Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Leo Liu @ 2013-01-07  2:31 UTC (permalink / raw)
  To: 13361

On 2013-01-06 03:13 +0800, Glenn Morris wrote:
> As the example I gave showed, point does move. In any case, I don't see
> any bug here.

Point is moved in that context but it is reset to window point
immediately after the window being selected. I think this subtle point
would trip a lot of elisp authors. I have already seen one in
slime-fuzzy.el (3rd party lib).

Leo






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-01-07  2:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-05  6:13 bug#13361: 24.2.91; [regression] window point incompatible change Leo Liu
2013-01-05  6:32 ` Leo Liu
2013-01-05  8:36   ` Glenn Morris
2013-01-05  9:41     ` Leo Liu
2013-01-05 11:27       ` martin rudalics
2013-01-05 19:13       ` Glenn Morris
2013-01-07  2:31         ` Leo Liu

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).