unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problem binding mouse-1 to Info-mouse-follow-nearest-node
@ 2011-04-11  9:35 martin rudalics
  2011-04-11  9:46 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: martin rudalics @ 2011-04-11  9:35 UTC (permalink / raw
  To: emacs-devel

With yesterday's trunk and emacs -Q yanking the following forms into
*scratch*

(setq debug-on-error t)

(add-hook
  'Info-mode-hook
  '(lambda ()
     (define-key Info-mode-map [mouse-1]
       'Info-mouse-follow-nearest-node)))

and evaluating them, firing up Info via C-h i and doing mouse-1
somewhere in the *info* buffer gets me (with a short delay)

Debugger entered--Lisp error: (args-out-of-range 1 1083)
   buffer-substring-no-properties(1 1083)
   deactivate-mark()

This is part of (probably silly) code that used to work from my .emacs
for many years.  Could a knowing soul please tell me what might have
happened here lately?

Thanks in advance, martin


GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
  of 2011-04-10 on NESTOR




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

* Re: Problem binding mouse-1 to Info-mouse-follow-nearest-node
  2011-04-11  9:35 Problem binding mouse-1 to Info-mouse-follow-nearest-node martin rudalics
@ 2011-04-11  9:46 ` Eli Zaretskii
  2011-04-11 12:36   ` martin rudalics
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2011-04-11  9:46 UTC (permalink / raw
  To: martin rudalics; +Cc: emacs-devel

> Date: Mon, 11 Apr 2011 11:35:51 +0200
> From: martin rudalics <rudalics@gmx.at>
> 
> With yesterday's trunk and emacs -Q yanking the following forms into
> *scratch*
> 
> (setq debug-on-error t)
> 
> (add-hook
>   'Info-mode-hook
>   '(lambda ()
>      (define-key Info-mode-map [mouse-1]
>        'Info-mouse-follow-nearest-node)))
> 
> and evaluating them, firing up Info via C-h i and doing mouse-1
> somewhere in the *info* buffer gets me (with a short delay)
> 
> Debugger entered--Lisp error: (args-out-of-range 1 1083)
>    buffer-substring-no-properties(1 1083)
>    deactivate-mark()

Can you tell which was the last revision where it worked?



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

* Re: Problem binding mouse-1 to Info-mouse-follow-nearest-node
  2011-04-11  9:46 ` Eli Zaretskii
@ 2011-04-11 12:36   ` martin rudalics
  2011-04-11 13:44     ` Juanma Barranquero
  2011-04-11 14:50     ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: martin rudalics @ 2011-04-11 12:36 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: emacs-devel

 > Can you tell which was the last revision where it worked?

I'm quite sure that it worked with my last build before the lexbind
merge, that must have been one or two days before that merge took place.

I'd like to avoid bisecting the revision history since this would
involve repeated bootstrappings which take around 30 minutes here.

Could you reproduce the behavior I described on your machine?

martin



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

* Re: Problem binding mouse-1 to Info-mouse-follow-nearest-node
  2011-04-11 12:36   ` martin rudalics
@ 2011-04-11 13:44     ` Juanma Barranquero
  2011-04-11 14:50     ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Juanma Barranquero @ 2011-04-11 13:44 UTC (permalink / raw
  To: martin rudalics; +Cc: Eli Zaretskii, emacs-devel

On Mon, Apr 11, 2011 at 14:36, martin rudalics <rudalics@gmx.at> wrote:

> Could you reproduce the behavior I described on your machine?

I see it too.

    Juanma



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

* Re: Problem binding mouse-1 to Info-mouse-follow-nearest-node
  2011-04-11 12:36   ` martin rudalics
  2011-04-11 13:44     ` Juanma Barranquero
@ 2011-04-11 14:50     ` Eli Zaretskii
  2011-04-11 15:53       ` martin rudalics
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2011-04-11 14:50 UTC (permalink / raw
  To: martin rudalics; +Cc: emacs-devel

> Date: Mon, 11 Apr 2011 14:36:12 +0200
> From: martin rudalics <rudalics@gmx.at>
> CC: emacs-devel@gnu.org
> 
> Could you reproduce the behavior I described on your machine?

I couldn't try that where I wrote the previous message, but I can
now.  Yes, I see it.  And no, it wasn't introduced after the lex-bind
merge, because I see it in revision 103755 (I happen to have a binary
for that revision in one of my branches).

The immediate problem which triggers the error is that deactivate-mark
is called after Info-mouse-follow-nearest-node already changed the
node displayed in the *info* buffer, which involves narrowing the
buffer to a different range of character positions, and that causes
the region to reference the portion of the buffer outside the current
restriction.



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

* Re: Problem binding mouse-1 to Info-mouse-follow-nearest-node
  2011-04-11 14:50     ` Eli Zaretskii
@ 2011-04-11 15:53       ` martin rudalics
  2011-04-11 16:59         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: martin rudalics @ 2011-04-11 15:53 UTC (permalink / raw
  To: Eli Zaretskii; +Cc: emacs-devel

 >> Could you reproduce the behavior I described on your machine?
 >
 > I couldn't try that where I wrote the previous message, but I can
 > now.  Yes, I see it.  And no, it wasn't introduced after the lex-bind
 > merge, because I see it in revision 103755 (I happen to have a binary
 > for that revision in one of my branches).

For some reason I must have missed it all the time.

 > The immediate problem which triggers the error is that deactivate-mark
 > is called after Info-mouse-follow-nearest-node already changed the
 > node displayed in the *info* buffer, which involves narrowing the
 > buffer to a different range of character positions, and that causes
 > the region to reference the portion of the buffer outside the current
 > restriction.

We could simply try doing

(buffer-substring-no-properties
  (max (region-beginning) (point-min))
  (min (region-end) (point-max)))

in `deactivate-mark'.  But I have no idea how the region should be
defined when it's not entirely within the accessible portion of a
buffer.

martin



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

* Re: Problem binding mouse-1 to Info-mouse-follow-nearest-node
  2011-04-11 15:53       ` martin rudalics
@ 2011-04-11 16:59         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2011-04-11 16:59 UTC (permalink / raw
  To: martin rudalics; +Cc: emacs-devel

> Date: Mon, 11 Apr 2011 17:53:31 +0200
> From: martin rudalics <rudalics@gmx.at>
> CC: emacs-devel@gnu.org
> 
>  > The immediate problem which triggers the error is that deactivate-mark
>  > is called after Info-mouse-follow-nearest-node already changed the
>  > node displayed in the *info* buffer, which involves narrowing the
>  > buffer to a different range of character positions, and that causes
>  > the region to reference the portion of the buffer outside the current
>  > restriction.
> 
> We could simply try doing
> 
> (buffer-substring-no-properties
>   (max (region-beginning) (point-min))
>   (min (region-end) (point-max)))
> 
> in `deactivate-mark'.  But I have no idea how the region should be
> defined when it's not entirely within the accessible portion of a
> buffer.

If it were up to me, I'd like first to understand (a) how come there's
an active region in this case, (b) why deactivate-mark doesn't try to
validate the region, and (c) why doesn't narrowing clip the region to
the accessible portion.



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

end of thread, other threads:[~2011-04-11 16:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-11  9:35 Problem binding mouse-1 to Info-mouse-follow-nearest-node martin rudalics
2011-04-11  9:46 ` Eli Zaretskii
2011-04-11 12:36   ` martin rudalics
2011-04-11 13:44     ` Juanma Barranquero
2011-04-11 14:50     ` Eli Zaretskii
2011-04-11 15:53       ` martin rudalics
2011-04-11 16:59         ` Eli Zaretskii

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