* Re: macro only for shell-mode
[not found] <mailman.275.1223196072.25473.help-gnu-emacs@gnu.org>
@ 2008-10-05 9:33 ` Andreas Politz
0 siblings, 0 replies; 7+ messages in thread
From: Andreas Politz @ 2008-10-05 9:33 UTC (permalink / raw)
To: help-gnu-emacs
Stefan Thomas wrote:
> Dear all,
> sorry for bothering You again, but I didn't succed with all my trials until
> now. But I think what I want is very simple:
> I want, if I press the key "4" in shell-mode,
> the curser moves first one space to the left, then prints "4" and then goes
> to the end of the line.
> In other words:
> I want to substitue "4" with:
> C-b 4 C-e
> I have defined a macro ("viertel") wich does C-b 4 C-e, but I'm not able to
> associate this macro to the key 4.
> It would be great if I could get an advice how this can be done!
> Thanks for Your support,
> Stefan
>
(defun viertel ()
(interactive)
(backward-char)
(insert "4")
(end-of-line))
(defun my-shell-mode-hook ()
(local-set-key [?4] 'viertel)
;;...
)
(add-hook 'shell-mode-hook 'my-shell-mode-hook)
-ap
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: macro only for shell-mode
@ 2008-10-05 8:41 Stefan Thomas
0 siblings, 0 replies; 7+ messages in thread
From: Stefan Thomas @ 2008-10-05 8:41 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 542 bytes --]
Dear all,
sorry for bothering You again, but I didn't succed with all my trials until
now. But I think what I want is very simple:
I want, if I press the key "4" in shell-mode,
the curser moves first one space to the left, then prints "4" and then goes
to the end of the line.
In other words:
I want to substitue "4" with:
C-b 4 C-e
I have defined a macro ("viertel") wich does C-b 4 C-e, but I'm not able to
associate this macro to the key 4.
It would be great if I could get an advice how this can be done!
Thanks for Your support,
Stefan
[-- Attachment #2: Type: text/html, Size: 653 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* macro only for shell-mode
@ 2008-10-03 13:04 Stefan Thomas
2008-10-03 14:43 ` Peter Dyballa
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Thomas @ 2008-10-03 13:04 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 152 bytes --]
Dear emacs-user,
I have (succesfully!!) defined some macros.
But I want them to use only in shell-mode.
How can I do that?
Thanks for Your help!
Stefan
[-- Attachment #2: Type: text/html, Size: 192 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: macro only for shell-mode
2008-10-03 13:04 Stefan Thomas
@ 2008-10-03 14:43 ` Peter Dyballa
2008-10-03 14:49 ` Stefan Thomas
[not found] ` <mailman.145.1223045354.25473.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 7+ messages in thread
From: Peter Dyballa @ 2008-10-03 14:43 UTC (permalink / raw)
To: Stefan Thomas; +Cc: help-gnu-emacs
Am 03.10.2008 um 15:04 schrieb Stefan Thomas:
> I have (succesfully!!) defined some macros.
> But I want them to use only in shell-mode.
You can customise shell-mode-hook.
--
Mit friedvollen Grüßen
Pete
Der Unterschied zwischen Theorie und Praxis ist in der Praxis meist
größer als in der Theorie
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: macro only for shell-mode
2008-10-03 14:43 ` Peter Dyballa
@ 2008-10-03 14:49 ` Stefan Thomas
[not found] ` <mailman.145.1223045354.25473.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 7+ messages in thread
From: Stefan Thomas @ 2008-10-03 14:49 UTC (permalink / raw)
To: Peter Dyballa; +Cc: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 494 bytes --]
Dear Peter,
thanks for Your fast answer.
But how can I customize shell-mode-hook?
2008/10/3 Peter Dyballa <Peter_Dyballa@web.de>
>
> Am 03.10.2008 um 15:04 schrieb Stefan Thomas:
>
> I have (succesfully!!) defined some macros.
>> But I want them to use only in shell-mode.
>>
>
>
> You can customise shell-mode-hook.
>
> --
> Mit friedvollen Grüßen
>
> Pete
>
> Der Unterschied zwischen Theorie und Praxis ist in der Praxis meist größer
> als in der Theorie
>
>
>
[-- Attachment #2: Type: text/html, Size: 1014 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <mailman.145.1223045354.25473.help-gnu-emacs@gnu.org>]
* Re: macro only for shell-mode
[not found] ` <mailman.145.1223045354.25473.help-gnu-emacs@gnu.org>
@ 2008-10-03 22:38 ` Barry Margolin
2008-10-04 10:48 ` Xah
1 sibling, 0 replies; 7+ messages in thread
From: Barry Margolin @ 2008-10-03 22:38 UTC (permalink / raw)
To: help-gnu-emacs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 962 bytes --]
In article <mailman.145.1223045354.25473.help-gnu-emacs@gnu.org>,
"Stefan Thomas" <kontrapunktstefan@googlemail.com> wrote:
> Dear Peter,
> thanks for Your fast answer.
> But how can I customize shell-mode-hook?
>
> 2008/10/3 Peter Dyballa <Peter_Dyballa@web.de>
>
> >
> > Am 03.10.2008 um 15:04 schrieb Stefan Thomas:
> >
> > I have (succesfully!!) defined some macros.
> >> But I want them to use only in shell-mode.
> >>
> >
> >
> > You can customise shell-mode-hook.
> >
> > --
> > Mit friedvollen Grüßen
> >
> > Pete
> >
> > Der Unterschied zwischen Theorie und Praxis ist in der Praxis meist größer
> > als in der Theorie
> >
> >
> >
(defun my-shell-mode-hook ()
(local-set-key ...)
(local-set-key ...))
(add-to-list 'shell-mode-hook 'my-shell-mode-hook)
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: macro only for shell-mode
[not found] ` <mailman.145.1223045354.25473.help-gnu-emacs@gnu.org>
2008-10-03 22:38 ` Barry Margolin
@ 2008-10-04 10:48 ` Xah
1 sibling, 0 replies; 7+ messages in thread
From: Xah @ 2008-10-04 10:48 UTC (permalink / raw)
To: help-gnu-emacs
Stefan Thomas wrote:
«
I have (succesfully!!) defined some macros.
But I want them to use only in shell-mode.
But how can I customize shell-mode-hook?
»
Here's a example:
(add-hook 'html-mode-hook
(lambda ()
(define-key html-mode-map (kbd "<M-left>") 'sgml-skip-tag-backward)
(define-key html-mode-map (kbd "<M-right>") 'sgml-skip-tag-forward)
;...
; your macro definition here
)
)
Xah
∑ http://xahlee.org/
☄
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-10-05 9:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.275.1223196072.25473.help-gnu-emacs@gnu.org>
2008-10-05 9:33 ` macro only for shell-mode Andreas Politz
2008-10-05 8:41 Stefan Thomas
-- strict thread matches above, loose matches on Subject: below --
2008-10-03 13:04 Stefan Thomas
2008-10-03 14:43 ` Peter Dyballa
2008-10-03 14:49 ` Stefan Thomas
[not found] ` <mailman.145.1223045354.25473.help-gnu-emacs@gnu.org>
2008-10-03 22:38 ` Barry Margolin
2008-10-04 10:48 ` Xah
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).