From: David Young <dove.young@gmail.com>
To: Thorsten Jolitz <tjolitz@googlemail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: about global-set-key
Date: Sat, 1 Sep 2012 11:54:25 +0800 [thread overview]
Message-ID: <CAK97FfNvjp2tH2EGU+t-ORP9BTzWoQtaOiR4vi5Ji3OzWDedBQ@mail.gmail.com> (raw)
In-Reply-To: <871uima91j.fsf@googlemail.com>
[-- Attachment #1: Type: text/plain, Size: 2622 bytes --]
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 <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 "_"
> > 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
[-- Attachment #2: Type: text/html, Size: 3845 bytes --]
next prev parent reply other threads:[~2012-09-01 3:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-31 23:12 about global-set-key etienne mann
2012-09-01 0:20 ` Thorsten Jolitz
2012-09-01 3:54 ` David Young [this message]
[not found] ` <mailman.7893.1346482862.855.help-gnu-emacs@gnu.org>
2012-09-01 13:19 ` Stefan Monnier
2012-09-11 8:21 ` etienne
2012-09-11 8:15 ` etienne
[not found] <mailman.7891.1346455860.855.help-gnu-emacs@gnu.org>
2012-09-01 13:17 ` Stefan Monnier
2012-09-11 8:30 ` etienne
2012-09-11 9:21 ` Peter Dyballa
2012-09-11 8:59 ` etienne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK97FfNvjp2tH2EGU+t-ORP9BTzWoQtaOiR4vi5Ji3OzWDedBQ@mail.gmail.com \
--to=dove.young@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=tjolitz@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.