help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: macro only for shell-mode


From: Andreas Politz
Subject: Re: macro only for shell-mode
Date: Sun, 05 Oct 2008 11:33:00 +0200
User-agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724)

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]