if (condition)
{
(prompt here)
}
else
{
}
####
(require 'dmacro)
;;; load my macros:
(dmacro-load "C:/emacs/dmacro/joe.dm")
;;; my macros use this function for tabbing:
;;; (indent-region doesn't bring the {'s with it in perl-mode.)
(def-dmacro-function perltab perl-indent-command)
####
#######
# MODE: nil
######
#
#######
fori indent for statement (prompts for variable name)
for (~(prompt var "Variable: ") = 0; ~prompt < ~@; ~prompt++) ~perltab
{ ~perltab
~perltab ~mark
} ~perltab
#
#######
fore indent interactive foreach type statment (prompts for variable names)
foreach my ~(prompt loopVar "loop var: ") (~(prompt loopList "list/array to loop over: ")) ~perltab
{ ~perltab
~perltab ~@
} ~perltab
#
#
#######
if expand if statement
if (~(prompt conditionString "Condition: ")) ~perltab
{ ~perltab
~perltab ~@
} ~perltab
#
#
#######
ifelse expand if-else statement
if (~(prompt conditionString "Condition: ")) ~perltab
{ ~perltab
~perltab ~@
} ~perltab
else ~perltab
{ ~perltab
~perltab ~mark
} ~perltab
#
#
#######
sub expand create a new sub
\# Name: ~(prompt subName "sub name: ")
\# Synopsis:
\# Arguments:
\# Returns:
\# Notes:
\#
sub ~prompt ~perltab
{ ~perltab
~perltab ~@
} ~perltab
#