all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#18712: 24.3; IELM fails to move point in a working buffer that is also displayed
@ 2014-10-13 22:16 Trevor Murphy
  2014-10-14 15:41 ` Glenn Morris
  2014-10-14 18:53 ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Trevor Murphy @ 2014-10-13 22:16 UTC (permalink / raw)
  To: 18712

Hi, list.  I just noticed the following.  If I start from `emacs 
-Q', then go:
 1. M-x ielm RET
 2. C-c C-b *scratch* RET
 3. Type `(goto-char 1)' at the ELISP prompt and hit RET
 4. C-x 4 C-o *scratch* RET

Then I see the *scratch* buffer in the other window with its point 
on the first character in the buffer (the first `;' on the first 
line).

However, if I reverse the order of steps (3) and (4) above, again 
starting from `emacs -Q':
 1. M-x ielm RET
 2. C-c C-b *scratch* RET
 3. C-x 4 C-o *scratch* RET
 4. Type `(goto-char 1)' at the ELISP prompt and hit RET

Then I see the *scratch* buffer in the other window with its point 
unmoved (still at the start of the second line after the initial 
scratch message).

Is this a bug?  And, if so, is it reproducible given the info 
below?

Thanks in advance.

In GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.12.2)
 of 2014-06-11 on var-lib-archbuild-staging-i686-jgc
Windowing system distributor `The X.Org Foundation', version 
11.0.11601000
System Description:	Arch Linux

Configured using:
 `configure '--prefix=/usr' '--sysconfdir=/etc' 
 '--libexecdir=/usr/lib'
 '--localstatedir=/var' '--with-x-toolkit=gtk3' '--with-xft'
 'CFLAGS=-march=i686 -mtune=generic -O2 -pipe 
 -fstack-protector-strong
 --param=ssp-buffer-size=4'
 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''
Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

--
Trevor Murphy
GnuPG Key: 0x83881C0A





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

* bug#18712: 24.3; IELM fails to move point in a working buffer that is also displayed
  2014-10-13 22:16 bug#18712: 24.3; IELM fails to move point in a working buffer that is also displayed Trevor Murphy
@ 2014-10-14 15:41 ` Glenn Morris
  2014-10-14 18:53 ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2014-10-14 15:41 UTC (permalink / raw)
  To: Trevor Murphy; +Cc: 18712

Trevor Murphy wrote:

> 1. M-x ielm RET
> 2. C-c C-b *scratch* RET
> 3. Type `(goto-char 1)' at the ELISP prompt and hit RET
> 4. C-x 4 C-o *scratch* RET
>
> Then I see the *scratch* buffer in the other window with its point on
> the first character in the buffer (the first `;' on the first line).
>
> However, if I reverse the order of steps (3) and (4) above, again
> starting from `emacs -Q':
> 1. M-x ielm RET
> 2. C-c C-b *scratch* RET
> 3. C-x 4 C-o *scratch* RET
> 4. Type `(goto-char 1)' at the ELISP prompt and hit RET
>
> Then I see the *scratch* buffer in the other window with its point
> unmoved (still at the start of the second line after the initial
> scratch message).

I think this is not a bug; you are seeing the difference between "window
point" and "point". See section "Windows and Point" in the elisp manual.





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

* bug#18712: 24.3; IELM fails to move point in a working buffer that is also displayed
  2014-10-13 22:16 bug#18712: 24.3; IELM fails to move point in a working buffer that is also displayed Trevor Murphy
  2014-10-14 15:41 ` Glenn Morris
@ 2014-10-14 18:53 ` Stefan Monnier
  2014-10-14 19:57   ` Josh
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2014-10-14 18:53 UTC (permalink / raw)
  To: Trevor Murphy; +Cc: 18712

> Is this a bug?

No, but it's a common trap.  Every buffer has as many "points" as it has
windows displaying it (plus one for the buffer itself).
So if you want to move point in a specific window, you need to either
select the window before moving, or use `set-window-point'.


        Stefan





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

* bug#18712: 24.3; IELM fails to move point in a working buffer that is also displayed
  2014-10-14 18:53 ` Stefan Monnier
@ 2014-10-14 19:57   ` Josh
  2014-10-14 23:49     ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Josh @ 2014-10-14 19:57 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Trevor Murphy, 18712

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

On Tue, Oct 14, 2014 at 11:53 AM, Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> > Is this a bug?
>
> No, but it's a common trap.  Every buffer has as many "points" as it has
> windows displaying it (plus one for the buffer itself).
> So if you want to move point in a specific window, you need to either
> select the window before moving, or use `set-window-point'.
>

What would be involved in implementing something like a
`ielm-change-working-window-buffer' that behaved as the OP
expected?

[-- Attachment #2: Type: text/html, Size: 1035 bytes --]

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

* bug#18712: 24.3; IELM fails to move point in a working buffer that is also displayed
  2014-10-14 19:57   ` Josh
@ 2014-10-14 23:49     ` Stefan Monnier
  2014-10-17 19:05       ` Trevor Murphy
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2014-10-14 23:49 UTC (permalink / raw)
  To: Josh; +Cc: Trevor Murphy, 18712

> What would be involved in implementing something like a
> `ielm-change-working-window-buffer' that behaved as the OP
> expected?

The same kind of code as used in ielm-change-working-buffer.


        Stefan





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

* bug#18712: 24.3; IELM fails to move point in a working buffer that is also displayed
  2014-10-14 23:49     ` Stefan Monnier
@ 2014-10-17 19:05       ` Trevor Murphy
  0 siblings, 0 replies; 6+ messages in thread
From: Trevor Murphy @ 2014-10-17 19:05 UTC (permalink / raw)
  To: Glenn Morris, Stefan Monnier, Josh; +Cc: 18712

Glenn Morris <rgm@gnu.org> writes:

> I think this is not a bug; you are seeing the difference between 
> "window point" and "point". See section "Windows and Point" in 
> the elisp manual.

Thank you for the manual reference, Glenn.

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

> 
> No, but it's a common trap.  Every buffer has as many "points" 
> as it has windows displaying it (plus one for the buffer 
> itself).  So if you want to move point in a specific window, you 
> need to either select the window before moving, or use 
> `set-window-point'.

Window points!  That makes so much sense now.

Rather than rewrite the `ielm-change-working-buffer' code, I've 
just after-advised `ielm-send-input' to set the window point in 
the working buffer.

Thanks, all!

--
Trevor Murphy
GnuPG Key: 0x83881C0A





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

end of thread, other threads:[~2014-10-17 19:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-13 22:16 bug#18712: 24.3; IELM fails to move point in a working buffer that is also displayed Trevor Murphy
2014-10-14 15:41 ` Glenn Morris
2014-10-14 18:53 ` Stefan Monnier
2014-10-14 19:57   ` Josh
2014-10-14 23:49     ` Stefan Monnier
2014-10-17 19:05       ` Trevor Murphy

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.