From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Young Newsgroups: gmane.emacs.help Subject: Re: about global-set-key Date: Sat, 1 Sep 2012 11:54:25 +0800 Message-ID: References: <871uima91j.fsf@googlemail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec51d20548c4ec604c89bdec5 X-Trace: ger.gmane.org 1346482869 13068 80.91.229.3 (1 Sep 2012 07:01:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Sep 2012 07:01:09 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Thorsten Jolitz Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 01 09:01:11 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T7hhe-0002K3-Cb for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Sep 2012 09:01:10 +0200 Original-Received: from localhost ([::1]:54654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7hhb-0007KX-Vc for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Sep 2012 03:01:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7enI-0001UL-Jb for help-gnu-emacs@gnu.org; Fri, 31 Aug 2012 23:54:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T7enH-0005Yj-6f for help-gnu-emacs@gnu.org; Fri, 31 Aug 2012 23:54:48 -0400 Original-Received: from mail-vc0-f169.google.com ([209.85.220.169]:57685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7enH-0005Yf-0C for help-gnu-emacs@gnu.org; Fri, 31 Aug 2012 23:54:47 -0400 Original-Received: by vcbfl13 with SMTP id fl13so4479891vcb.0 for ; Fri, 31 Aug 2012 20:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=ZMn3K5jlv0+AGRaXns2tYrkJv0pBto2y9GbPB6Z1ubQ=; b=BC703ZqCjskkql8hkqoif6pvk0/jePBFyL/mba0oyYZySAGyTMgdFbAoc1ORptirzV yTc3XWvfviQM97AGZFRRKMUw9nly/1DtBXdtSJGILRiJM9j3auDV06WBha/xiGm5AP14 GCg7FUuomN37wQvozVGcbhJd5aQIf+XOyqmm47iUGatxezHgfYJ8l3qiUMw7beGVm9cQ 6+FK26tciYky6QHxXty6obCziaUVML3Y8//1ES9UeVMqhjJsjyEB0D/dO3KcCNm5Jjgw v4CbbnOW5BfpPXs6LVFJbud+M9a8QMZ6tf3sL3KI3JRfDi1DUeUNGq7nL/tLKV934N/w qAMw== Original-Received: by 10.52.38.42 with SMTP id d10mr5694902vdk.132.1346471686065; Fri, 31 Aug 2012 20:54:46 -0700 (PDT) Original-Received: by 10.58.32.201 with HTTP; Fri, 31 Aug 2012 20:54:25 -0700 (PDT) In-Reply-To: <871uima91j.fsf@googlemail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.220.169 X-Mailman-Approved-At: Sat, 01 Sep 2012 03:01:00 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86622 Archived-At: --bcaec51d20548c4ec604c89bdec5 Content-Type: text/plain; charset=ISO-8859-1 I tried this with skeleton, and got similar problems. I cannot trigger the abbrev with _ character even it do listed in the abbrev list. But when I bound the abbrev to character i, it works fine. (define-skeleton underscore "when I type _, Emacs writes _{}" "" "_{}" ) (define-abbrev org-mode-abbrev-table "_" "" 'underscore) (define-abbrev org-mode-abbrev-table "i" "" 'underscore) (org-mode-abbrev-table) "1exp" 3 "" 1exp "1prop" 4 "" 1prop "1src" 6 "" 1src "6W" 1 "" 6W "^" 0 "" carrot "_" 0 "" underscore "bexp" 11 "BEGIN_EXAMPLE" "eexp" 10 "END_EXAMPLE" "i" 3 "" underscore "iexp" 10 "" 1exp "ihtml" 1 "" insert-emacser-code "iprop" 0 "" 1prop "isrc" 8 "" 1src 2012/9/1 Thorsten Jolitz > etienne mann writes: > > Hello, > > > 1) I am struggeling with my .emacs file: I want that when I press "_" > > emacs write "_{ }". > > So I write this in my .emacs file > > > > (defun souligne () (interactive) > > (insert "_{}") (forward-char -1)) > > (global-set-key "_" 'souligne) > > > > It does not work. What is strange is that if I put > > (defun souligne () (interactive) > > (insert "_{}") (forward-char -1)) > > (global-set-key "z" 'souligne) > > when I press "z", emacs write "_{}" !!! > > > > So in emacs, I try to M-x global-unset-key then _ but it does not work > > in emacs. the button _ still works !!! > > > > I also wanted to press ^ and get ^{} and press $ and have $ $ but it > > not works ! > > > > Notice that for ( ) or {} it works fine > > > > 2) my second question is about an historical file and menu.Is it > > possible that emacs have a menu with the last 10 files that I opened ? > > Just a curiosity - I'm currently writing an Emacs mode for the > PicoLisp-Wiki that requires exactly this syntax: > > ,---- > | _{} > | ^{} > | !{} > `---- > > (and quite a few others ...) > > Are we, just by casuality, working on the same thing without being > aware of it? > > My mode is almost done and lets you insert and fontificate these > constructs. I only need to add a few commands. I probably publish a Beta > version this weekend on Github, will announce it here on the list. > > -- > cheers, > Thorsten > > > -- M-x Thinks --bcaec51d20548c4ec604c89bdec5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I tried this with skeleton, and got similar problems.=A0 I cannot trigger t= he abbrev with _ character even it do listed in the abbrev list.

Bu= t when I bound the abbrev to character i, it works fine.

(define-ske= leton underscore
=A0 "when I type _, Emacs writes _{}"
=A0 ""
=A0 = "_{}"
)

(define-abbrev org-mode-abbrev-table "_&qu= ot; "" 'underscore)

(define-abbrev org-mode-abbrev-tab= le "i"=A0 "" 'underscore)


(org-mode-abbrev-table)

"1exp"=A0=A0=A0=A0=A0=A0= =A0=A0 3=A0=A0=A0 ""=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 1exp
"1prop"=A0=A0=A0=A0=A0=A0=A0 4=A0= =A0=A0 ""=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 1prop
"1src"=A0=A0=A0=A0=A0=A0=A0=A0 6=A0=A0=A0 &= quot;"=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 1src
"6W"=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 1=A0=A0=A0 ""=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 6W
"^&= quot;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0=A0=A0=A0 ""=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 carrot
"_&qu= ot;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0=A0=A0=A0 ""=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 underscore
"bexp"=A0=A0=A0=A0=A0=A0=A0=A0 11=A0=A0 "BEGIN_EXAMPLE"=
"eexp"=A0=A0=A0=A0=A0=A0=A0=A0 10=A0=A0 "END_EXAMPLE&quo= t;
"i"=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 3=A0=A0=A0 ""= ;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 undersc= ore
"iexp"=A0=A0=A0=A0=A0=A0=A0=A0 10=A0=A0 ""=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 1exp
"ihtml"=A0=A0=A0=A0=A0=A0=A0 1=A0=A0=A0 ""=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 insert-emacser-code<= br>"iprop"=A0=A0=A0=A0=A0=A0=A0 0=A0=A0=A0 ""=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 1prop
"is= rc"=A0=A0=A0=A0=A0=A0=A0=A0 8=A0=A0=A0 ""=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 1src




2012/9/1 Thorsten Jolitz <= tjolitz@googlemail.com>
etienne mann <etienne.mann@gmail.com> writes:

Hello,

> 1) I am struggeling with my .emacs file: I want that when I press &quo= t;_"
> emacs write "_{ }".
> So I write this in my .emacs file
>
> (defun souligne () (interactive)
> =A0=A0=A0=A0=A0=A0=A0=A0 (insert "_{}") (forward-char -1)) > (global-set-key "_" 'souligne)
>
> It does not work. What is strange is that if I put
> (defun souligne () (interactive)
> =A0=A0=A0=A0=A0=A0=A0=A0 (insert "_{}") (forward-char -1)) > (global-set-key "z" 'souligne)
> when I press "z", emacs write "_{}" !!!
>
> So in emacs, I try to M-x global-unset-key then _ but it does not work=
> in emacs. the button _ still works !!!
>
> I also wanted to press ^ and get ^{} and press $ and have $ $ but it > not works !
>
> Notice that for ( ) or {} it works fine
>
> 2) my second question is about an historical file and menu.Is it
> possible that emacs have a menu with the last 10 files that I opened ?=

Just a curiosity - I'm currently writing an Emacs mode for = the
PicoLisp-Wiki that requires exactly this syntax:

,----
| _{}
| ^{}
| !{}
`----

(and quite a few others ...)

Are we, just by casuality, working on the same thing without being
aware of it?

My mode is almost done and lets you insert and fontificate these
constructs. I only need to add a few commands. I probably publish a Beta version this weekend on Github, will announce it here on the list.

--
cheers,
Thorsten





--
M-x Think= s

--bcaec51d20548c4ec604c89bdec5--