unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* trouble binding to  <next> & <prior>
@ 2008-07-07 15:37 Mirko
  2008-07-07 16:59 ` Pascal J. Bourguignon
  0 siblings, 1 reply; 11+ messages in thread
From: Mirko @ 2008-07-07 15:37 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I have a following keybinding, parts of which do not work.  In
particular I am trying to bind view-previous-entry to the page-up key
on the standard PC keyboard (using Emacs 22.1).  I used both h-k and h-
l to determine that this key is identified with "<prior>" & <next>".

(defvar iop-alert-mode-map nil
  "Keymap for IOP-alert mode")
(unless iop-alert-mode-map
  (setq iop-alert-mode-map (copy-keymap text-mode-map))
  (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
  (define-key iop-alert-mode-map (kbd "<next>") 'view-next-entry)
  (define-key iop-alert-mode-map (kbd "d") 'mark-entry-for-deletion)
  (define-key iop-alert-mode-map "m" 'mark-entry-for-save))

When in a buffer with iop-alert mode, doing h-m gives me the following
output on keybindings:
... stuff skipped
< n e		Prefix Command
< p r		Prefix Command
< n e x		Prefix Command
< p r i		Prefix Command
< n e x t	Prefix Command
< p r i o	Prefix Command
< n e x t >	view-next-entry
< p r i o r	Prefix Command
< p r i o r >	view-previous-entry

It seems <prior> and <next> are bound to the character sequence
"<prior>" and "<next>".  Pressing those characters will invoke the
commands.  But pressing the Page-up/down keys will not.

Indeed, doing a h-k shows that page-up/down are still bound to scroll
up/down.

What am I doing wrong?

Thank you,

Mirko



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

* Re: trouble binding to  <next> & <prior>
  2008-07-07 15:37 trouble binding to <next> & <prior> Mirko
@ 2008-07-07 16:59 ` Pascal J. Bourguignon
  2008-07-07 17:32   ` Mirko
  0 siblings, 1 reply; 11+ messages in thread
From: Pascal J. Bourguignon @ 2008-07-07 16:59 UTC (permalink / raw)
  To: help-gnu-emacs

Mirko <mvukovic@nycap.rr.com> writes:

> Hello,
>
> I have a following keybinding, parts of which do not work.  In
> particular I am trying to bind view-previous-entry to the page-up key
> on the standard PC keyboard (using Emacs 22.1).  I used both h-k and h-
> l to determine that this key is identified with "<prior>" & <next>".
>
> (defvar iop-alert-mode-map nil
>   "Keymap for IOP-alert mode")
> (unless iop-alert-mode-map
>   (setq iop-alert-mode-map (copy-keymap text-mode-map))
>   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
>   (define-key iop-alert-mode-map (kbd "<next>") 'view-next-entry)
>   (define-key iop-alert-mode-map (kbd "d") 'mark-entry-for-deletion)
>   (define-key iop-alert-mode-map "m" 'mark-entry-for-save))
>
> When in a buffer with iop-alert mode, doing h-m gives me the following
> output on keybindings:
> ... stuff skipped
> < n e		Prefix Command
> < p r		Prefix Command
> < n e x		Prefix Command
> < p r i		Prefix Command
> < n e x t	Prefix Command
> < p r i o	Prefix Command
> < n e x t >	view-next-entry
> < p r i o r	Prefix Command
> < p r i o r >	view-previous-entry
>
> It seems <prior> and <next> are bound to the character sequence
> "<prior>" and "<next>".  Pressing those characters will invoke the
> commands.  But pressing the Page-up/down keys will not.
>
> Indeed, doing a h-k shows that page-up/down are still bound to scroll
> up/down.
>
> What am I doing wrong?

emacs-version   --> "22.2.1"
(kbd "<prior>") --> [prior]

if you don't get this vector with one symbol for (kbd "<prior>"),
indeed you have a problem.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

WARNING: This product warps space and time in its vicinity.


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

* Re: trouble binding to <next> & <prior>
  2008-07-07 16:59 ` Pascal J. Bourguignon
@ 2008-07-07 17:32   ` Mirko
  2008-07-07 18:09     ` Lennart Borgman (gmail)
       [not found]     ` <mailman.14341.1215454191.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 11+ messages in thread
From: Mirko @ 2008-07-07 17:32 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 7, 12:59 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
> Mirko <mvuko...@nycap.rr.com> writes:
> > Hello,
>
> > I have a following keybinding, parts of which do not work.  In
> > particular I am trying to bind view-previous-entry to the page-up key
> > on the standard PC keyboard (using Emacs 22.1).  I used both h-k and h-
> > l to determine that this key is identified with "<prior>" & <next>".
>
> > (defvar iop-alert-mode-map nil
> >   "Keymap for IOP-alert mode")
> > (unless iop-alert-mode-map
> >   (setq iop-alert-mode-map (copy-keymap text-mode-map))
> >   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
> >   (define-key iop-alert-mode-map (kbd "<next>") 'view-next-entry)
> >   (define-key iop-alert-mode-map (kbd "d") 'mark-entry-for-deletion)
> >   (define-key iop-alert-mode-map "m" 'mark-entry-for-save))
>
> > When in a buffer with iop-alert mode, doing h-m gives me the following
> > output on keybindings:
> > ... stuff skipped
> > < n e           Prefix Command
> > < p r           Prefix Command
> > < n e x         Prefix Command
> > < p r i         Prefix Command
> > < n e x t       Prefix Command
> > < p r i o       Prefix Command
> > < n e x t >  view-next-entry
> > < p r i o r     Prefix Command
> > < p r i o r >        view-previous-entry
>
> > It seems <prior> and <next> are bound to the character sequence
> > "<prior>" and "<next>".  Pressing those characters will invoke the
> > commands.  But pressing the Page-up/down keys will not.
>
> > Indeed, doing a h-k shows that page-up/down are still bound to scroll
> > up/down.
>
> > What am I doing wrong?
>
> emacs-version   --> "22.2.1"
> (kbd "<prior>") --> [prior]
>
> if you don't get this vector with one symbol for (kbd "<prior>"),
> indeed you have a problem.
>
> --
> __Pascal Bourguignon__                    http://www.informatimago.com/
>
> WARNING: This product warps space and time in its vicinity.

I tried that, and I get exactly as you suggested.

(kbd "<prior>") --> [prior]

Mirko


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

* Re: trouble binding to <next> & <prior>
  2008-07-07 17:32   ` Mirko
@ 2008-07-07 18:09     ` Lennart Borgman (gmail)
       [not found]     ` <mailman.14341.1215454191.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 11+ messages in thread
From: Lennart Borgman (gmail) @ 2008-07-07 18:09 UTC (permalink / raw)
  To: Mirko; +Cc: help-gnu-emacs

Mirko wrote:
> On Jul 7, 12:59 pm, p...@informatimago.com (Pascal J. Bourguignon)
> wrote:
>> Mirko <mvuko...@nycap.rr.com> writes:
>>> Hello,
>>> I have a following keybinding, parts of which do not work.  In
>>> particular I am trying to bind view-previous-entry to the page-up key
>>> on the standard PC keyboard (using Emacs 22.1).  I used both h-k and h-
>>> l to determine that this key is identified with "<prior>" & <next>".
>>> (defvar iop-alert-mode-map nil
>>>   "Keymap for IOP-alert mode")
>>> (unless iop-alert-mode-map
>>>   (setq iop-alert-mode-map (copy-keymap text-mode-map))
>>>   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
>>>   (define-key iop-alert-mode-map (kbd "<next>") 'view-next-entry)
>>>   (define-key iop-alert-mode-map (kbd "d") 'mark-entry-for-deletion)
>>>   (define-key iop-alert-mode-map "m" 'mark-entry-for-save))
>>> When in a buffer with iop-alert mode, doing h-m gives me the following
>>> output on keybindings:
>>> ... stuff skipped
>>> < n e           Prefix Command
>>> < p r           Prefix Command
>>> < n e x         Prefix Command
>>> < p r i         Prefix Command
>>> < n e x t       Prefix Command
>>> < p r i o       Prefix Command
>>> < n e x t >  view-next-entry
>>> < p r i o r     Prefix Command
>>> < p r i o r >        view-previous-entry
>>> It seems <prior> and <next> are bound to the character sequence
>>> "<prior>" and "<next>".  Pressing those characters will invoke the
>>> commands.  But pressing the Page-up/down keys will not.
>>> Indeed, doing a h-k shows that page-up/down are still bound to scroll
>>> up/down.
>>> What am I doing wrong?
>> emacs-version   --> "22.2.1"
>> (kbd "<prior>") --> [prior]
>>
>> if you don't get this vector with one symbol for (kbd "<prior>"),
>> indeed you have a problem.
>>
>> --
>> __Pascal Bourguignon__                    http://www.informatimago.com/
>>
>> WARNING: This product warps space and time in its vicinity.
> 
> I tried that, and I get exactly as you suggested.
> 
> (kbd "<prior>") --> [prior]
> 
> Mirko

It looks like you have been doing

  (define-key iop-alert-mode-map "<prior>" 'view-previous-entry)

instead of

  (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)




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

* Re: trouble binding to <next> & <prior>
       [not found]     ` <mailman.14341.1215454191.18990.help-gnu-emacs@gnu.org>
@ 2008-07-07 18:59       ` Mirko
  2008-07-07 20:04         ` Lennart Borgman (gmail)
                           ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Mirko @ 2008-07-07 18:59 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 7, 2:09 pm, "Lennart Borgman (gmail)"
<lennart.borg...@gmail.com> wrote:
> Mirko wrote:
> > On Jul 7, 12:59 pm, p...@informatimago.com (Pascal J. Bourguignon)
> > wrote:
> >> Mirko <mvuko...@nycap.rr.com> writes:
> >>> Hello,
> >>> I have a following keybinding, parts of which do not work.  In
> >>> particular I am trying to bind view-previous-entry to the page-up key
> >>> on the standard PC keyboard (using Emacs 22.1).  I used both h-k and h-
> >>> l to determine that this key is identified with "<prior>" & <next>".
> >>> (defvar iop-alert-mode-map nil
> >>>   "Keymap for IOP-alert mode")
> >>> (unless iop-alert-mode-map
> >>>   (setq iop-alert-mode-map (copy-keymap text-mode-map))
> >>>   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
> >>>   (define-key iop-alert-mode-map (kbd "<next>") 'view-next-entry)
> >>>   (define-key iop-alert-mode-map (kbd "d") 'mark-entry-for-deletion)
> >>>   (define-key iop-alert-mode-map "m" 'mark-entry-for-save))
> >>> When in a buffer with iop-alert mode, doing h-m gives me the following
> >>> output on keybindings:
> >>> ... stuff skipped
> >>> < n e           Prefix Command
> >>> < p r           Prefix Command
> >>> < n e x         Prefix Command
> >>> < p r i         Prefix Command
> >>> < n e x t       Prefix Command
> >>> < p r i o       Prefix Command
> >>> < n e x t >  view-next-entry
> >>> < p r i o r     Prefix Command
> >>> < p r i o r >        view-previous-entry
> >>> It seems <prior> and <next> are bound to the character sequence
> >>> "<prior>" and "<next>".  Pressing those characters will invoke the
> >>> commands.  But pressing the Page-up/down keys will not.
> >>> Indeed, doing a h-k shows that page-up/down are still bound to scroll
> >>> up/down.
> >>> What am I doing wrong?
> >> emacs-version   --> "22.2.1"
> >> (kbd "<prior>") --> [prior]
>
> >> if you don't get this vector with one symbol for (kbd "<prior>"),
> >> indeed you have a problem.
>
> >> --
> >> __Pascal Bourguignon__                    http://www.informatimago.com/
>
> >> WARNING: This product warps space and time in its vicinity.
>
> > I tried that, and I get exactly as you suggested.
>
> > (kbd "<prior>") --> [prior]
>
> > Mirko
>
> It looks like you have been doing
>
>   (define-key iop-alert-mode-map "<prior>" 'view-previous-entry)
>
> instead of
>
>   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)

Nope.  This is what I have

 (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)

Thanks,

Mirko


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

* Re: trouble binding to <next> & <prior>
  2008-07-07 18:59       ` Mirko
@ 2008-07-07 20:04         ` Lennart Borgman (gmail)
  2008-07-08  2:00         ` Kevin Rodgers
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Lennart Borgman (gmail) @ 2008-07-07 20:04 UTC (permalink / raw)
  To: Mirko; +Cc: help-gnu-emacs

Mirko wrote:
> On Jul 7, 2:09 pm, "Lennart Borgman (gmail)"
> <lennart.borg...@gmail.com> wrote:
>> Mirko wrote:
>>> On Jul 7, 12:59 pm, p...@informatimago.com (Pascal J. Bourguignon)
>>> wrote:
>>>> Mirko <mvuko...@nycap.rr.com> writes:
>>>>> Hello,
>>>>> I have a following keybinding, parts of which do not work.  In
>>>>> particular I am trying to bind view-previous-entry to the page-up key
>>>>> on the standard PC keyboard (using Emacs 22.1).  I used both h-k and h-
>>>>> l to determine that this key is identified with "<prior>" & <next>".
>>>>> (defvar iop-alert-mode-map nil
>>>>>   "Keymap for IOP-alert mode")
>>>>> (unless iop-alert-mode-map
>>>>>   (setq iop-alert-mode-map (copy-keymap text-mode-map))
>>>>>   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
>>>>>   (define-key iop-alert-mode-map (kbd "<next>") 'view-next-entry)
>>>>>   (define-key iop-alert-mode-map (kbd "d") 'mark-entry-for-deletion)
>>>>>   (define-key iop-alert-mode-map "m" 'mark-entry-for-save))
>>>>> When in a buffer with iop-alert mode, doing h-m gives me the following
>>>>> output on keybindings:
>>>>> ... stuff skipped
>>>>> < n e           Prefix Command
>>>>> < p r           Prefix Command
>>>>> < n e x         Prefix Command
>>>>> < p r i         Prefix Command
>>>>> < n e x t       Prefix Command
>>>>> < p r i o       Prefix Command
>>>>> < n e x t >  view-next-entry
>>>>> < p r i o r     Prefix Command
>>>>> < p r i o r >        view-previous-entry
>>>>> It seems <prior> and <next> are bound to the character sequence
>>>>> "<prior>" and "<next>".  Pressing those characters will invoke the
>>>>> commands.  But pressing the Page-up/down keys will not.
>>>>> Indeed, doing a h-k shows that page-up/down are still bound to scroll
>>>>> up/down.
>>>>> What am I doing wrong?
>>>> emacs-version   --> "22.2.1"
>>>> (kbd "<prior>") --> [prior]
>>>> if you don't get this vector with one symbol for (kbd "<prior>"),
>>>> indeed you have a problem.
>>>> --
>>>> __Pascal Bourguignon__                    http://www.informatimago.com/
>>>> WARNING: This product warps space and time in its vicinity.
>>> I tried that, and I get exactly as you suggested.
>>> (kbd "<prior>") --> [prior]
>>> Mirko
>> It looks like you have been doing
>>
>>   (define-key iop-alert-mode-map "<prior>" 'view-previous-entry)
>>
>> instead of
>>
>>   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
> 
> Nope.  This is what I have
> 
>  (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
> 
> Thanks,
> 
> Mirko

Could you try to re-evaluate the code. Place point inside the defvar and 
do C-M-x (this will just set iop-alert-mode-map to nil again). Then 
place point inside the unless form and do C-M-x again.

Does this correct the keymap?




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

* Re: trouble binding to <next> & <prior>
  2008-07-07 18:59       ` Mirko
  2008-07-07 20:04         ` Lennart Borgman (gmail)
@ 2008-07-08  2:00         ` Kevin Rodgers
  2008-07-08  3:34         ` Xah
       [not found]         ` <mailman.14345.1215461048.18990.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 11+ messages in thread
From: Kevin Rodgers @ 2008-07-08  2:00 UTC (permalink / raw)
  To: help-gnu-emacs

Mirko wrote:
> On Jul 7, 2:09 pm, "Lennart Borgman (gmail)"
> <lennart.borg...@gmail.com> wrote:
>> Mirko wrote:
>>> On Jul 7, 12:59 pm, p...@informatimago.com (Pascal J. Bourguignon)
>>> wrote:
>>>> Mirko <mvuko...@nycap.rr.com> writes:
>>>>> Hello,
>>>>> I have a following keybinding, parts of which do not work.  In
>>>>> particular I am trying to bind view-previous-entry to the page-up key
>>>>> on the standard PC keyboard (using Emacs 22.1).  I used both h-k and h-
>>>>> l to determine that this key is identified with "<prior>" & <next>".
>>>>> (defvar iop-alert-mode-map nil
>>>>>   "Keymap for IOP-alert mode")
>>>>> (unless iop-alert-mode-map
>>>>>   (setq iop-alert-mode-map (copy-keymap text-mode-map))
>>>>>   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
>>>>>   (define-key iop-alert-mode-map (kbd "<next>") 'view-next-entry)
>>>>>   (define-key iop-alert-mode-map (kbd "d") 'mark-entry-for-deletion)
>>>>>   (define-key iop-alert-mode-map "m" 'mark-entry-for-save))
>>>>> When in a buffer with iop-alert mode, doing h-m gives me the following
>>>>> output on keybindings:
>>>>> ... stuff skipped
>>>>> < n e           Prefix Command
>>>>> < p r           Prefix Command
>>>>> < n e x         Prefix Command
>>>>> < p r i         Prefix Command
>>>>> < n e x t       Prefix Command
>>>>> < p r i o       Prefix Command
>>>>> < n e x t >  view-next-entry
>>>>> < p r i o r     Prefix Command
>>>>> < p r i o r >        view-previous-entry
>>>>> It seems <prior> and <next> are bound to the character sequence
>>>>> "<prior>" and "<next>".  Pressing those characters will invoke the
>>>>> commands.  But pressing the Page-up/down keys will not.
>>>>> Indeed, doing a h-k shows that page-up/down are still bound to scroll
>>>>> up/down.
>>>>> What am I doing wrong?
>>>> emacs-version   --> "22.2.1"
>>>> (kbd "<prior>") --> [prior]
>>>> if you don't get this vector with one symbol for (kbd "<prior>"),
>>>> indeed you have a problem.
>>>> --
>>>> __Pascal Bourguignon__                    http://www.informatimago.com/
>>>> WARNING: This product warps space and time in its vicinity.
>>> I tried that, and I get exactly as you suggested.
>>> (kbd "<prior>") --> [prior]
>>> Mirko
>> It looks like you have been doing
>>
>>   (define-key iop-alert-mode-map "<prior>" 'view-previous-entry)
>>
>> instead of
>>
>>   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
> 
> Nope.  This is what I have
> 
>  (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)

Pascal is right: _something_ has bound "<prior>" in iop-alert mode.
Perhaps there is another library earlier in load-path, or an out-of-date
compiled version of the library.

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* Re: trouble binding to <next> & <prior>
  2008-07-07 18:59       ` Mirko
  2008-07-07 20:04         ` Lennart Borgman (gmail)
  2008-07-08  2:00         ` Kevin Rodgers
@ 2008-07-08  3:34         ` Xah
  2008-07-09 16:32           ` Mirko
       [not found]         ` <mailman.14345.1215461048.18990.help-gnu-emacs@gnu.org>
  3 siblings, 1 reply; 11+ messages in thread
From: Xah @ 2008-07-08  3:34 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 7, 11:59 am, Mirko <mvuko...@nycap.rr.com> wrote:
> Nope.  This is what I have
>
>  (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)

For debugging purposes, you might try first to replace the
“(kbd "<prior>")” with just “[prior]”. If that still doesn't work, at
least you get rid of one possbibility of problem.

Also, simply try to bind something to the PageUp key, e.g.
(global-set-key (kbd "<next>") 'find-file)
and see if your emacs recognize that at all.

What build or platform is your emacs on?

Few monhts ago i tried “Emacs.app” (the emacs build for Mac OS X and
NeXTStep, based on cacoa), it has a known bug that it won't recognize
keybindings on the numerical keypad. The author said he doesn't know
what's the problem or how to fix. (“Emacs.app” has several major bugs
that i couldn't adapt it as my emacs. The oher one is unicode ...)

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trouble binding to <next> & <prior>
       [not found]         ` <mailman.14345.1215461048.18990.help-gnu-emacs@gnu.org>
@ 2008-07-08 12:49           ` Mirko
  2008-07-08 17:26             ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 11+ messages in thread
From: Mirko @ 2008-07-08 12:49 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 7, 4:04 pm, "Lennart Borgman (gmail)"
<lennart.borg...@gmail.com> wrote:
> Mirko wrote:
> > On Jul 7, 2:09 pm, "Lennart Borgman (gmail)"
> > <lennart.borg...@gmail.com> wrote:
> >> Mirko wrote:
> >>> On Jul 7, 12:59 pm, p...@informatimago.com (Pascal J. Bourguignon)
> >>> wrote:
> >>>> Mirko <mvuko...@nycap.rr.com> writes:
> >>>>> Hello,
> >>>>> I have a following keybinding, parts of which do not work.  In
> >>>>> particular I am trying to bind view-previous-entry to the page-up key
> >>>>> on the standard PC keyboard (using Emacs 22.1).  I used both h-k and h-
> >>>>> l to determine that this key is identified with "<prior>" & <next>".
> >>>>> (defvar iop-alert-mode-map nil
> >>>>>   "Keymap for IOP-alert mode")
> >>>>> (unless iop-alert-mode-map
> >>>>>   (setq iop-alert-mode-map (copy-keymap text-mode-map))
> >>>>>   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
> >>>>>   (define-key iop-alert-mode-map (kbd "<next>") 'view-next-entry)
> >>>>>   (define-key iop-alert-mode-map (kbd "d") 'mark-entry-for-deletion)
> >>>>>   (define-key iop-alert-mode-map "m" 'mark-entry-for-save))
> >>>>> When in a buffer with iop-alert mode, doing h-m gives me the following
> >>>>> output on keybindings:
> >>>>> ... stuff skipped
> >>>>> < n e           Prefix Command
> >>>>> < p r           Prefix Command
> >>>>> < n e x         Prefix Command
> >>>>> < p r i         Prefix Command
> >>>>> < n e x t       Prefix Command
> >>>>> < p r i o       Prefix Command
> >>>>> < n e x t >  view-next-entry
> >>>>> < p r i o r     Prefix Command
> >>>>> < p r i o r >        view-previous-entry
> >>>>> It seems <prior> and <next> are bound to the character sequence
> >>>>> "<prior>" and "<next>".  Pressing those characters will invoke the
> >>>>> commands.  But pressing the Page-up/down keys will not.
> >>>>> Indeed, doing a h-k shows that page-up/down are still bound to scroll
> >>>>> up/down.
> >>>>> What am I doing wrong?
> >>>> emacs-version   --> "22.2.1"
> >>>> (kbd "<prior>") --> [prior]
> >>>> if you don't get this vector with one symbol for (kbd "<prior>"),
> >>>> indeed you have a problem.
> >>>> --
> >>>> __Pascal Bourguignon__                    http://www.informatimago.com/
> >>>> WARNING: This product warps space and time in its vicinity.
> >>> I tried that, and I get exactly as you suggested.
> >>> (kbd "<prior>") --> [prior]
> >>> Mirko
> >> It looks like you have been doing
>
> >>   (define-key iop-alert-mode-map "<prior>" 'view-previous-entry)
>
> >> instead of
>
> >>   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
>
> > Nope.  This is what I have
>
> >  (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
>
> > Thanks,
>
> > Mirko
>
> Could you try to re-evaluate the code. Place point inside the defvar and
> do C-M-x (this will just set iop-alert-mode-map to nil again). Then
> place point inside the unless form and do C-M-x again.
>
> Does this correct the keymap?

Yes and no.

Following your instructions to the keystroke, I first set the map to
nil, and then re-assigned it.  And now h-m gives a much saner
response:
<next>		view-next-entry
<prior>		view-previous-entry

(In my defense, I did try restarting emacs and reloading the file,
before starting this topic).

However, h-k on page up and page down still gives:
<next> runs the command scroll-up
  which is an interactive built-in function in `C source code'.
It is bound to C-v, <next>.
(scroll-up &optional arg)

??

Thanks,

Mirko


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

* Re: trouble binding to <next> & <prior>
  2008-07-08 12:49           ` Mirko
@ 2008-07-08 17:26             ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 11+ messages in thread
From: Lennart Borgman (gmail) @ 2008-07-08 17:26 UTC (permalink / raw)
  To: Mirko; +Cc: help-gnu-emacs

Mirko wrote:
> On Jul 7, 4:04 pm, "Lennart Borgman (gmail)"
> <lennart.borg...@gmail.com> wrote:
>> Mirko wrote:
>>> On Jul 7, 2:09 pm, "Lennart Borgman (gmail)"
>>> <lennart.borg...@gmail.com> wrote:
>>>> Mirko wrote:
>>>>> On Jul 7, 12:59 pm, p...@informatimago.com (Pascal J. Bourguignon)
>>>>> wrote:
>>>>>> Mirko <mvuko...@nycap.rr.com> writes:
>>>>>>> Hello,
>>>>>>> I have a following keybinding, parts of which do not work.  In
>>>>>>> particular I am trying to bind view-previous-entry to the page-up key
>>>>>>> on the standard PC keyboard (using Emacs 22.1).  I used both h-k and h-
>>>>>>> l to determine that this key is identified with "<prior>" & <next>".
>>>>>>> (defvar iop-alert-mode-map nil
>>>>>>>   "Keymap for IOP-alert mode")
>>>>>>> (unless iop-alert-mode-map
>>>>>>>   (setq iop-alert-mode-map (copy-keymap text-mode-map))
>>>>>>>   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
>>>>>>>   (define-key iop-alert-mode-map (kbd "<next>") 'view-next-entry)
>>>>>>>   (define-key iop-alert-mode-map (kbd "d") 'mark-entry-for-deletion)
>>>>>>>   (define-key iop-alert-mode-map "m" 'mark-entry-for-save))
>>>>>>> When in a buffer with iop-alert mode, doing h-m gives me the following
>>>>>>> output on keybindings:
>>>>>>> ... stuff skipped
>>>>>>> < n e           Prefix Command
>>>>>>> < p r           Prefix Command
>>>>>>> < n e x         Prefix Command
>>>>>>> < p r i         Prefix Command
>>>>>>> < n e x t       Prefix Command
>>>>>>> < p r i o       Prefix Command
>>>>>>> < n e x t >  view-next-entry
>>>>>>> < p r i o r     Prefix Command
>>>>>>> < p r i o r >        view-previous-entry
>>>>>>> It seems <prior> and <next> are bound to the character sequence
>>>>>>> "<prior>" and "<next>".  Pressing those characters will invoke the
>>>>>>> commands.  But pressing the Page-up/down keys will not.
>>>>>>> Indeed, doing a h-k shows that page-up/down are still bound to scroll
>>>>>>> up/down.
>>>>>>> What am I doing wrong?
>>>>>> emacs-version   --> "22.2.1"
>>>>>> (kbd "<prior>") --> [prior]
>>>>>> if you don't get this vector with one symbol for (kbd "<prior>"),
>>>>>> indeed you have a problem.
>>>>>> --
>>>>>> __Pascal Bourguignon__                    http://www.informatimago.com/
>>>>>> WARNING: This product warps space and time in its vicinity.
>>>>> I tried that, and I get exactly as you suggested.
>>>>> (kbd "<prior>") --> [prior]
>>>>> Mirko
>>>> It looks like you have been doing
>>>>   (define-key iop-alert-mode-map "<prior>" 'view-previous-entry)
>>>> instead of
>>>>   (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
>>> Nope.  This is what I have
>>>  (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
>>> Thanks,
>>> Mirko
>> Could you try to re-evaluate the code. Place point inside the defvar and
>> do C-M-x (this will just set iop-alert-mode-map to nil again). Then
>> place point inside the unless form and do C-M-x again.
>>
>> Does this correct the keymap?
> 
> Yes and no.
> 
> Following your instructions to the keystroke, I first set the map to
> nil, and then re-assigned it.  And now h-m gives a much saner
> response:
> <next>		view-next-entry
> <prior>		view-previous-entry

That is good.

Just a short note to avoid confusing other readers: I think you mean 
`C-h m' here when you write `h-m'. And below you probably mean `C-h k'.

> (In my defense, I did try restarting emacs and reloading the file,
> before starting this topic).

Did you happen to compile the file? The compiled file takes precedence 
over the uncompiled. This is confusing and I have fallen in that trap 
myself. (There is a warning in the *Message* buffer but that is a bit to 
shy in my opinion.)

> However, h-k on page up and page down still gives:
> <next> runs the command scroll-up
>   which is an interactive built-in function in `C source code'.
> It is bound to C-v, <next>.
> (scroll-up &optional arg)
> 
> ??

There are many keymaps involved. You can use `C-h b' to see all the key 
bindings.

There is rather much in the manual describing this, for example

   (info "(elisp) Searching the Active Keymaps")


> Thanks,
> 
> Mirko
> 




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

* Re: trouble binding to <next> & <prior>
  2008-07-08  3:34         ` Xah
@ 2008-07-09 16:32           ` Mirko
  0 siblings, 0 replies; 11+ messages in thread
From: Mirko @ 2008-07-09 16:32 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 7, 11:34 pm, Xah <xah...@gmail.com> wrote:
> On Jul 7, 11:59 am, Mirko <mvuko...@nycap.rr.com> wrote:
>
> > Nope.  This is what I have
>
> >  (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
>
> For debugging purposes, you might try first to replace the
> “(kbd "<prior>")” with just “[prior]”. If that still doesn't work, at
> least you get rid of one possbibility of problem.
>
> Also, simply try to bind something to the PageUp key, e.g.
> (global-set-key (kbd "<next>") 'find-file)
> and see if your emacs recognize that at all.
>
> What build or platform is your emacs on?
>
> Few monhts ago i tried “Emacs.app” (the emacs build for Mac OS X and
> NeXTStep, based on cacoa), it has a known bug that it won't recognize
> keybindings on the numerical keypad. The author said he doesn't know
> what's the problem or how to fix. (“Emacs.app” has several major bugs
> that i couldn't adapt it as my emacs. The oher one is unicode ...)
>
>   Xah
> ∑http://xahlee.org/
>
> ☄

OK, there were a couple of problems:

1) old *.elc file
2) I was creating a derived mode
3) Outside of the define-derived-mode expression, I was separately
using the construct:
(unless iop-alert-mode-map
  (setq iop-alert-mode-map (copy-keymap text-mode-map))
 (define-key iop-alert-mode-map (kbd "<prior>") 'view-previous-entry)
...

So, what was happening most likely was that the derived mode was
creating the mode-map, and this prevented the (unless iop-alert-mode-
map  from operating.

I moved the define-key inside the define-derived-mode expression.

Thank you all for putting up with this.

Mirko


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

end of thread, other threads:[~2008-07-09 16:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-07 15:37 trouble binding to <next> & <prior> Mirko
2008-07-07 16:59 ` Pascal J. Bourguignon
2008-07-07 17:32   ` Mirko
2008-07-07 18:09     ` Lennart Borgman (gmail)
     [not found]     ` <mailman.14341.1215454191.18990.help-gnu-emacs@gnu.org>
2008-07-07 18:59       ` Mirko
2008-07-07 20:04         ` Lennart Borgman (gmail)
2008-07-08  2:00         ` Kevin Rodgers
2008-07-08  3:34         ` Xah
2008-07-09 16:32           ` Mirko
     [not found]         ` <mailman.14345.1215461048.18990.help-gnu-emacs@gnu.org>
2008-07-08 12:49           ` Mirko
2008-07-08 17:26             ` Lennart Borgman (gmail)

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