From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Forrest Newsgroups: gmane.emacs.help Subject: Re: `global-set-key' doesn't work in my console Date: Wed, 9 Jan 2008 00:32:05 +0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1044949126==" X-Trace: ger.gmane.org 1199809969 27895 80.91.229.12 (8 Jan 2008 16:32:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Jan 2008 16:32:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 08 17:33:04 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JCHNr-0006rw-5Q for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Jan 2008 17:32:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JCHNT-0005Uc-TJ for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Jan 2008 11:32:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JCHN4-0005Qt-Bd for help-gnu-emacs@gnu.org; Tue, 08 Jan 2008 11:32:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JCHN1-0005Q8-Nz for help-gnu-emacs@gnu.org; Tue, 08 Jan 2008 11:32:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JCHN1-0005Q5-J1 for help-gnu-emacs@gnu.org; Tue, 08 Jan 2008 11:32:07 -0500 Original-Received: from fk-out-0910.google.com ([209.85.128.186]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JCHN1-0001kq-5a for help-gnu-emacs@gnu.org; Tue, 08 Jan 2008 11:32:07 -0500 Original-Received: by fk-out-0910.google.com with SMTP id 26so9988026fkx.10 for ; Tue, 08 Jan 2008 08:32:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=HYsOTZ6dozroTy+nVMvBrIa4tJs0MKPJa34ySOXXxm8=; b=HOMu32ya6zGYRX1xZZoEugS5ZPwWmTejZD3lqB/1h58PXNeOagISbpaRx0XZ6MVV6BQXFgYDkqq99Ma5h7I/mF2ulP+O9HHvsVZNqhaxlR0YkeKLQZEOQitsTHYlSclz8hVueCXhi5VbDxjhdezmc2YIofECgGAbSCsg1o/eaSY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=BXg3Ap9l6ib4OhpqUwa/iD327IS2TsfujqfJoFt7OMahoakD2c9nRcawZBGruUIGKTYIoTJbN91Rq1wm0CYNXrN5O3ytcsjB1hRDwXmShoBvbsp9w/Q7DR5SzBK1GfhFlXufStk6RoKMI4Df3n11anJ+fnQ6ngavL4rItLhdc9U= Original-Received: by 10.78.122.16 with SMTP id u16mr24984678huc.21.1199809925779; Tue, 08 Jan 2008 08:32:05 -0800 (PST) Original-Received: by 10.78.134.3 with HTTP; Tue, 8 Jan 2008 08:32:05 -0800 (PST) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:50589 Archived-At: --===============1044949126== Content-Type: multipart/alternative; boundary="----=_Part_50952_26009463.1199809925550" ------=_Part_50952_26009463.1199809925550 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline > Mike Mattie writes: > > On Tue, 8 Jan 2008 15:38:08 +0800 > > Forrest wrote: > > > > > > > global-set-key (kbd "C-,") > > > > > '(lambda () "scroll the page down" (interactive) (scroll- > > > > > down 1))) > > > > try a space like this: > > (kbd "C-c ,") > > Have you tried this? It won't work. i tried, it worked > > > If that fixes it try using a function I previously posted that eliminates > > the errors from the process of defining keys. > > If it were so simple don't you think Emacs would do this? > > > (defun insert-key-notation () > > "inject a complete \(kbd \"sequence\"\) with key notation for a key sequence given by prompt" > > (interactive) > > (insert "(kbd \"") > > (insert (format-kbd-macro (read-key-sequence "Key? " nil t))) > > (insert "\")")) > > > > it will define the kbd sexp for you after it prompts you for the key sequence. > > It looks like the reason that it doesn't work has already been explained but > Forrest has decided not to accept the answer (or perhaps there is a > communication problem)... that's what you think, not what i think > > > > > The console and other terminal emulations can only produce "key > > > > events" in the ASCII or extended ASCII range, i.e. 8 bit characters > > > > (man ascii). Therefore not every time you hold down the control > > > > "modifier" key and press some other key something with a meaning is > > > > produced. It's like when you're scribbling on paper: not every > > > > "picture" is a letter or a digit or worth an exhibition at MOMA ... > > > > C-, can work X which has its own concept of events that are > > > > abstracted from ASCII codes. > > > > > > C-x C-c work well in console, so i guess there must be something > > > wrong with my key-binding settings. and also, emacs was designed in > > > ages when X was not popular, it's unreasonable that custom > > > key-binding doesn't work > > Do "man ascii". This is 128 character set and 96, or thereabout, are printing > characters. If there were a control character counterpart for each one that > would result in 192 character set. Presumably control characters only exist > for C-@ to C-_ (0 to 32, @ to _ being 64 to 96). thank you for your patience, however, do you mean that only printing characters and C-@ to C-_ can be processed by emacs? then what if you press F1~F12? and Home, End, Del, Ins? and Left, Right, Up, Down? 96 + (96 - 64) = 128 i hope i had understood you > > > > i'm a newbie, could you give me any detailed clue to solve it? > > On a normal console, I don't think you can. > > -- > Nick http://www.inet.net.nz/~nickrob Forrest -- Stupid is as stupid does. ------=_Part_50952_26009463.1199809925550 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline  
> Mike Mattie writes:
> > On Tue, 8 Jan 2008 15:38:08 +0800
> > Forrest <forrest.yu@gmail.com> wrote:
> >
> > > > > global-set-key (kbd "C-,")
> > > > > '(lambda () "scroll the page down" (interactive) (scroll-
> > > > > down 1)))
> >
> > try a space like this:
> > (kbd "C-c ,")
>
> Have you tried this? It won't work.

i tried, it worked

>
> > If that fixes it try using a function I previously posted that eliminates
> > the errors from the process of defining keys.
>
> If it were so simple don't you think Emacs would do this?
>
> > (defun insert-key-notation ()
> > "inject a complete \(kbd \"sequence\"\) with key notation for a key sequence given by prompt"
> > (interactive)
> > (insert "(kbd \"")
> > (insert (format-kbd-macro (read-key-sequence "Key? " nil t)))
> > (insert "\")"))
> >
> > it will define the kbd sexp for you after it prompts you for the key sequence.
>
> It looks like the reason that it doesn't work has already been explained but
> Forrest has decided not to accept the answer (or perhaps there is a
> communication problem)...

that's what you think, not what i think

>
> > > > The console and other terminal emulations can only produce "key
> > > > events" in the ASCII or extended ASCII range, i.e. 8 bit characters
> > > > (man ascii). Therefore not every time you hold down the control
> > > > "modifier" key and press some other key something with a meaning is
> > > > produced. It's like when you're scribbling on paper: not every
> > > > "picture" is a letter or a digit or worth an exhibition at MOMA ...
> > > > C-, can work X which has its own concept of events that are
> > > > abstracted from ASCII codes.
> > >
> > > C-x C-c work well in console, so i guess there must be something
> > > wrong with my key-binding settings. and also, emacs was designed in
> > > ages when X was not popular, it's unreasonable that custom
> > > key-binding doesn't work
>
> Do "man ascii". This is 128 character set and 96, or thereabout, are printing
> characters. If there were a control character counterpart for each one that
> would result in 192 character set. Presumably control characters only exist
> for C-@ to C-_ (0 to 32, @ to _ being 64 to 96).

thank you for your patience, however, do you mean that only printing characters and C-@ to C-_ can be processed by emacs?
then what if you press F1~F12? and Home, End, Del, Ins? and Left, Right, Up, Down?

96 + (96 - 64) = 128  i hope i had understood you

>
> > > i'm a newbie, could you give me any detailed clue to solve it?
>
> On a normal console, I don't think you can.
>
> --
> Nick http://www.inet.net.nz/~nickrob

Forrest

--
Stupid is as stupid does. ------=_Part_50952_26009463.1199809925550-- --===============1044949126== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ help-gnu-emacs mailing list help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============1044949126==--