[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]
elisp question
- To: "'emacspeak@xxxxxxxxxxx'" <emacspeak@xxxxxxxxxxx>
- Subject: elisp question
- From: "McCleary, Maureen" <mmcclear@xxxxxxxxxxx-Harris.COM>
- Date: Wed, 28 Oct 1998 09:16:33 -0500
- Old-Return-Path: <mmcclear@xxxxxxxxxxx-Harris.COM>
- Resent-Date: Wed, 28 Oct 1998 09:16:40 -0500
- Resent-From: emacspeak@xxxxxxxxxxx
- Resent-Message-ID: <"fAg9ZB.A.bn.9cyN2"@hub>
- Resent-Sender: emacspeak-request@xxxxxxxxxxx
Hi listers,
Our company wants to have on-line code reviews to increase productivity.
Want we need is a macro for emacs to open a blank line above the line where
point is currently, and insert a /* opening comment delimiter, 3 # signs and
the user's login name. Then 2 blank lines and an ending comment delimiter
*/. At the end the currsor will be placed on the line above the end comment
delim.
Here is the macro and key binding I wrote:
;;; Provides a macro named code-review-comment to aid online code reviews.
(fset 'code-review-comment
[?\C-a ?\C-o ?/ ?* ? ?# ?# ?# ? ?- ? escape ?1 escape ?! ?e ?c ?h ?o ?
?$ ?U ?S ?E ?R return ?\C-x ?\C-x return return ?* ?/ ?\C-p ?\C-a])
;;; Binds macro code-review-comment to control-c control-r.
(global-set-key "\C-c\C-r" 'code-review-comment)
I recorded the macro with C-x ( and stopped it with C-x ). Then I
named the macro code-review-comment. Next I inserted it into a file with
the M-x insert-kbd-macro.
This macro will be loaded from a shell script by invoking emacs with the -l
option and supplying the file which contains the macro and key binding. It
can also be used by adding the line
(load "code_review_comment.el")
in the .emacs file.
The trouble is that not everyone uses the same shell. The macro works fine
for me and I use c shell, but someone tried this out who used tcsh and had
problems.
Should I set the value of shell-file-name to "/bin/csh" at the beginning of
the macro file?
In order to get the value of the users login name I'm recording escape !
echo $USER in the macro. Is there a way in elisp to directly access the
value of environment variables?
Any suggestions would be appreciated.
Mo
-----------------------------------------------------------------------------
To unsubscribe or change your address send mail to
"emacspeak-request@xxxxxxxxxxx" with a subject of "unsubscribe" or "help"
Emacspeak Files |
Subscribe |
Unsubscribe