all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* One more time: binding overwrite-mode to Apple kbd
@ 2006-07-16 16:07 kj
  2006-07-16 17:16 ` Pascal Bourguignon
  2006-07-17  8:44 ` don provan
  0 siblings, 2 replies; 14+ messages in thread
From: kj @ 2006-07-16 16:07 UTC (permalink / raw)





Apple keyboards apparently don't have an <insert> key (mine certainly
doesn't), which is a pain when one wants to toggle overwrite-mode.
Searching online I've found claims that the <help> key in these
keyboards serves as the <insert> key, but when I use it in Emacs,
the <help> key produces the help- prefix (reasonably enough); i.e.
it is equivalent to hitting C-h.  I'd be perfectly happy to jettison
this functionality, since I find C-h convenient enough.  I am
assuming that the <help> key emits a different code from what's
sent by C-h.  I have two questions: 1) can this raw *keyboard code*
be bound to an Emacs command? and if yes, 2) how do I determine
what this code is?

The situation on my MacBook portable's keyboard is even worse: it
doesn't even have a <help> key.  I suppose I'll just bind C-c i to
overwrite-mode.  Any better ideas?

Thanks!

kj
-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.

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

* Re: One more time: binding overwrite-mode to Apple kbd
  2006-07-16 16:07 One more time: binding overwrite-mode to Apple kbd kj
@ 2006-07-16 17:16 ` Pascal Bourguignon
  2006-07-16 18:39   ` kj
  2006-07-17  8:44 ` don provan
  1 sibling, 1 reply; 14+ messages in thread
From: Pascal Bourguignon @ 2006-07-16 17:16 UTC (permalink / raw)


kj <socyl@987jk.com.invalid> writes:

> Apple keyboards apparently don't have an <insert> key (mine certainly
> doesn't), which is a pain when one wants to toggle overwrite-mode.
> Searching online I've found claims that the <help> key in these
> keyboards serves as the <insert> key, but when I use it in Emacs,
> the <help> key produces the help- prefix (reasonably enough); i.e.
> it is equivalent to hitting C-h.  I'd be perfectly happy to jettison
> this functionality, since I find C-h convenient enough.  I am
> assuming that the <help> key emits a different code from what's
> sent by C-h.  I have two questions: 1) can this raw *keyboard code*
> be bound to an Emacs command? 

Yes.

> and if yes, 2) how do I determine
> what this code is?

You don't need to.

Just evaluate (and put in your ~/.emacs):

   (global-set-key (kbd "<help>") (function overwrite-mode))

> The situation on my MacBook portable's keyboard is even worse: it
> doesn't even have a <help> key.  I suppose I'll just bind C-c i to
> overwrite-mode.  

   (global-set-key (kbd "C-c i") (function overwrite-mode))

> Any better ideas?

No.

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

PUBLIC NOTICE AS REQUIRED BY LAW: Any use of this product, in any
manner whatsoever, will increase the amount of disorder in the
universe. Although no liability is implied herein, the consumer is
warned that this process will ultimately lead to the heat death of
the universe.

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

* Re: One more time: binding overwrite-mode to Apple kbd
  2006-07-16 17:16 ` Pascal Bourguignon
@ 2006-07-16 18:39   ` kj
  2006-07-16 18:59     ` Peter Dyballa
       [not found]     ` <mailman.4146.1153076350.9609.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: kj @ 2006-07-16 18:39 UTC (permalink / raw)


In <878xmtv5a2.fsf@thalassa.informatimago.com> Pascal Bourguignon <pjb@informatimago.com> writes:

>kj <socyl@987jk.com.invalid> writes:
>> and if yes, 2) how do I determine
>> what this code is?

>You don't need to.

>Just evaluate (and put in your ~/.emacs):

>   (global-set-key (kbd "<help>") (function overwrite-mode))

Beautiful.  Thanks!

What will this do when the keyboard available does not have "<help>"?
(I work from various workstations, Linux, Mac, Windows, connecting
to the same Linux server, so this is not an academic concern.)

kj

-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.

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

* Re: One more time: binding overwrite-mode to Apple kbd
  2006-07-16 18:39   ` kj
@ 2006-07-16 18:59     ` Peter Dyballa
       [not found]     ` <mailman.4146.1153076350.9609.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 14+ messages in thread
From: Peter Dyballa @ 2006-07-16 18:59 UTC (permalink / raw)



Am 16.07.2006 um 20:39 schrieb kj:

> What will this do when the keyboard available does not have "<help>"?

Nothing. Because you can't press a non-existing key. So the function  
can't be invoked.

--
Greetings

   Pete

The problem with the French is that they don't have a word for
«entrepreneur».                              - George W. Bush

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

* Re: One more time: binding overwrite-mode to Apple kbd
  2006-07-16 16:07 One more time: binding overwrite-mode to Apple kbd kj
  2006-07-16 17:16 ` Pascal Bourguignon
@ 2006-07-17  8:44 ` don provan
  2006-07-17 10:58   ` Mathias Dahl
  1 sibling, 1 reply; 14+ messages in thread
From: don provan @ 2006-07-17  8:44 UTC (permalink / raw)


kj <socyl@987jk.com.invalid> writes:

> Apple keyboards apparently don't have an <insert> key (mine certainly
> doesn't), which is a pain when one wants to toggle overwrite-mode.

Wait, you *want* to toggle the useless overwrite-mode on?
Are you crazy? I wish my PC keyboard *didn't* have an insert
key. Not that it's a problem with Emacs, of course, but in
Windows applications, accidentally finding myself in
overwrite mode drives me crazy.

-don provan

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

* Re: One more time: binding overwrite-mode to Apple kbd
  2006-07-17  8:44 ` don provan
@ 2006-07-17 10:58   ` Mathias Dahl
  2006-07-17 12:48     ` kj
  0 siblings, 1 reply; 14+ messages in thread
From: Mathias Dahl @ 2006-07-17 10:58 UTC (permalink / raw)


don provan <dprovan@comcast.net> writes:

> Wait, you *want* to toggle the useless overwrite-mode on?
> Are you crazy? I wish my PC keyboard *didn't* have an insert
> key. Not that it's a problem with Emacs, of course, but in
> Windows applications, accidentally finding myself in
> overwrite mode drives me crazy.

I tend to agree, but I won't count this guy out just yet :) Maybe he
has some smart way of working with that feature?

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

* Re: One more time: binding overwrite-mode to Apple kbd
  2006-07-17 10:58   ` Mathias Dahl
@ 2006-07-17 12:48     ` kj
  2006-07-17 13:56       ` David Kastrup
  2006-07-17 19:30       ` don provan
  0 siblings, 2 replies; 14+ messages in thread
From: kj @ 2006-07-17 12:48 UTC (permalink / raw)


In <uy7ussdji.fsf@gmail.com> Mathias Dahl <brakjoller@gmail.com> writes:

>don provan <dprovan@comcast.net> writes:

>> Wait, you *want* to toggle the useless overwrite-mode on?
>> Are you crazy? I wish my PC keyboard *didn't* have an insert
>> key. Not that it's a problem with Emacs, of course, but in
>> Windows applications, accidentally finding myself in
>> overwrite mode drives me crazy.

>I tend to agree, but I won't count this guy out just yet :) Maybe he
>has some smart way of working with that feature?

Nothing smart about it, I'm afraid.  I just *never* find myself
accidentally hitting the <insert> key so it is never a problem.
(The caps lock key, on the other hand, has more than once led to
massive mayhem and destruction in my rare sessions with
that-other-text-editor.) I think Emacs' overwrite-mode is very
handy whenever I'm editing text in which, for visual/legibility
reasons, the position of characters on the line matters; it's faster
than inserting the new and deleting the old.  If there's a better
alternative, I'm all ears.

kj

-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.

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

* Re: One more time: binding overwrite-mode to Apple kbd
  2006-07-17 12:48     ` kj
@ 2006-07-17 13:56       ` David Kastrup
  2006-07-19 19:02         ` Slawomir Nowaczyk
  2006-07-17 19:30       ` don provan
  1 sibling, 1 reply; 14+ messages in thread
From: David Kastrup @ 2006-07-17 13:56 UTC (permalink / raw)


kj <socyl@987jk.com.invalid> writes:

>>don provan <dprovan@comcast.net> writes:
>
>>> Wait, you *want* to toggle the useless overwrite-mode on?
>>> Are you crazy? I wish my PC keyboard *didn't* have an insert
>>> key. Not that it's a problem with Emacs, of course, but in
>>> Windows applications, accidentally finding myself in
>>> overwrite mode drives me crazy.
>
> Nothing smart about it, I'm afraid.  I just *never* find myself
> accidentally hitting the <insert> key so it is never a problem.
> (The caps lock key, on the other hand, has more than once led to
> massive mayhem and destruction in my rare sessions with
> that-other-text-editor.)

Configure the X server to make it another control.

> I think Emacs' overwrite-mode is very handy whenever I'm editing
> text in which, for visual/legibility reasons, the position of
> characters on the line matters; it's faster than inserting the new
> and deleting the old.  If there's a better alternative, I'm all
> ears.

M-x picture-mode RET

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: One more time: binding overwrite-mode to Apple kbd
  2006-07-17 12:48     ` kj
  2006-07-17 13:56       ` David Kastrup
@ 2006-07-17 19:30       ` don provan
  1 sibling, 0 replies; 14+ messages in thread
From: don provan @ 2006-07-17 19:30 UTC (permalink / raw)


kj <socyl@987jk.com.invalid> writes:

> In <uy7ussdji.fsf@gmail.com> Mathias Dahl <brakjoller@gmail.com> writes:
>
>>don provan <dprovan@comcast.net> writes:
>
> Nothing smart about it, I'm afraid.  I just *never* find myself
> accidentally hitting the <insert> key so it is never a problem.

Really? I hit it by accident almost as often as the caps lock.

> (The caps lock key, on the other hand, has more than once led to
> massive mayhem and destruction in my rare sessions with
> that-other-text-editor.)

Amen, brother.

> I think Emacs' overwrite-mode is very
> handy whenever I'm editing text in which, for visual/legibility
> reasons, the position of characters on the line matters; it's faster
> than inserting the new and deleting the old.  If there's a better
> alternative, I'm all ears.

I think deep down, I can see this, but I'm rarely in this position,
and when I am, I only think of delete/replace, never overwrite.

I'm sorry, I didn't mean to malign you or your decisions, it's just
that I feel exactly the same way about both buttons, so I'm sure you
can excuse my knee-jerk reaction.

Just don't get me started on the Windows "Application" key....

-don

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

* Re: One more time: binding overwrite-mode to Apple kbd
       [not found]     ` <mailman.4146.1153076350.9609.help-gnu-emacs@gnu.org>
@ 2006-07-18 20:35       ` bmovies
  2006-07-18 21:26         ` Peter Dyballa
  0 siblings, 1 reply; 14+ messages in thread
From: bmovies @ 2006-07-18 20:35 UTC (permalink / raw)



Peter Dyballa wrote:
> Am 16.07.2006 um 20:39 schrieb kj:
>
> > What will this do when the keyboard available does not have "<help>"?
>
> Nothing. Because you can't press a non-existing key. So the function
> can't be invoked.
>
> --
> Greetings
>
>    Pete
>
> The problem with the French is that they don't have a word for
> «entrepreneur».                              - George W. Bush

Phony quote:

http://www.snopes.com/quotes/bush.htm

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

* Re: One more time: binding overwrite-mode to Apple kbd
  2006-07-18 20:35       ` bmovies
@ 2006-07-18 21:26         ` Peter Dyballa
  0 siblings, 0 replies; 14+ messages in thread
From: Peter Dyballa @ 2006-07-18 21:26 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 18.07.2006 um 22:35 schrieb bmovies:

>> The problem with the French is that they don't have a word for
>> «entrepreneur».                              - George W. Bush
>
> Phony quote:
>
> http://www.snopes.com/quotes/bush.htm

How can you be sure that the site isn't phony itself? There are so  
many Government folks that reveal to particular journalists  
particular top secret stories ... could be the I.Q. level is a real  
number!

--
Greetings

   Pete

Rain is saved up in cloud banks.

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

* Re: One more time: binding overwrite-mode to Apple kbd
  2006-07-17 13:56       ` David Kastrup
@ 2006-07-19 19:02         ` Slawomir Nowaczyk
  2006-07-20 22:31           ` Kevin Rodgers
  0 siblings, 1 reply; 14+ messages in thread
From: Slawomir Nowaczyk @ 2006-07-19 19:02 UTC (permalink / raw)


On Mon, 17 Jul 2006 15:56:32 +0200
David Kastrup <dak@gnu.org> wrote:

#> M-x picture-mode RET

It there some reason why there is no picture-mode-toggle command?

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( slawomir.nowaczyk.847@student.lu.se )

Tact is the knack of making a point without making an enemy.

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

* Re: One more time: binding overwrite-mode to Apple kbd
  2006-07-19 19:02         ` Slawomir Nowaczyk
@ 2006-07-20 22:31           ` Kevin Rodgers
  2006-07-21  1:11             ` Slawomir Nowaczyk
  0 siblings, 1 reply; 14+ messages in thread
From: Kevin Rodgers @ 2006-07-20 22:31 UTC (permalink / raw)


Slawomir Nowaczyk wrote:
> On Mon, 17 Jul 2006 15:56:32 +0200
> David Kastrup <dak@gnu.org> wrote:
> 
> #> M-x picture-mode RET
> 
> It there some reason why there is no picture-mode-toggle command?

Try this:

(defvar toggle-picture-mode nil
   "The previous major mode, before Picture mode.")

(defadvice picture-mode (before toggle-major-mode activate)
   "Set `toggle-picture-mode'."
   (set (make-local-variable 'toggle-picture-mode) major-mode)
   (put 'toggle-picture-mode 'permanent-local t))

(defun toggle-picture-mode ()
   "Select the previous major mode."
   (if toggle-picture-mode
       (progn
	(setq toggle-picture-mode nil)
	(funcall toggle-picture-mode))
     (error "No previous major mode")))

-- 
Kevin Rodgers
Sr. Software Engineer, IHS

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

* Re: One more time: binding overwrite-mode to Apple kbd
  2006-07-20 22:31           ` Kevin Rodgers
@ 2006-07-21  1:11             ` Slawomir Nowaczyk
  0 siblings, 0 replies; 14+ messages in thread
From: Slawomir Nowaczyk @ 2006-07-21  1:11 UTC (permalink / raw)


On Thu, 20 Jul 2006 16:31:21 -0600
Kevin Rodgers <ihs_4664@yahoo.com> wrote:

#>> It there some reason why there is no picture-mode-toggle command?
#>
#> Try this:
#>   <snip>

Well, I guess a simple (not tested)

#> (defun toggle-picture-mode ()
#>    "Toggle"
#>    (if (eq major-mode 'picture-mode)
#> 	(picture-mode-exit)
#> 	(picture-mode)))

would suffice. It's just that it seems to me like a function that
should be in the Emacs itself.

--
 Best wishes,
   Slawomir Nowaczyk
     ( slawomir.nowaczyk.847@student.lu.se )

To become a Jedi, use Emacs you have to.

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

end of thread, other threads:[~2006-07-21  1:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-16 16:07 One more time: binding overwrite-mode to Apple kbd kj
2006-07-16 17:16 ` Pascal Bourguignon
2006-07-16 18:39   ` kj
2006-07-16 18:59     ` Peter Dyballa
     [not found]     ` <mailman.4146.1153076350.9609.help-gnu-emacs@gnu.org>
2006-07-18 20:35       ` bmovies
2006-07-18 21:26         ` Peter Dyballa
2006-07-17  8:44 ` don provan
2006-07-17 10:58   ` Mathias Dahl
2006-07-17 12:48     ` kj
2006-07-17 13:56       ` David Kastrup
2006-07-19 19:02         ` Slawomir Nowaczyk
2006-07-20 22:31           ` Kevin Rodgers
2006-07-21  1:11             ` Slawomir Nowaczyk
2006-07-17 19:30       ` don provan

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.