Simon Butler wrote:
Hi Tony, thx for getting back to me, my comments below:
On May 11, 2007, at 3:42 PM, A.J.Mechelynck wrote:
Simon Butler wrote:
hi, when i write this skill (cadence extension language) fragment in
emacs i get the following:
procedure( vscCheckpointHier( @key lib cell view message inclibs )
let(( ddCVs )
vscPrint0(sprintf( nil "Hierarchy for %s,%s,%s ..." lib cell
view ))
when( ddCVs = vscGetHierarchyDDs( ?lib lib ?cell cell ?view view
?inclibs inclibs )
vscPrint0(sprintf( nil " %d cellviews." length(ddCVs) ))
vscCheckpoint( ddCVs ?message message)
); when ddCVs
); let
); procedure vscCheckpointHier
Notice all the comments placed on the closing brackets. Is there a
way to make vim do this?
TIA
In Vimscript, IIUC what you mean, a comment starts with a double
quote. Most statements accept a comment after them; a few don't,
because they see the quote as part of their arguments. See ":help
:quote".
There is a workaround to add comments even after the commands (such as
:map) which don't accept them (see ":help :comment"):
exe 'map <F9> <C-]>' |" find tag under cursor
So you could do (not sure whether I read emacs syntax correctly, but
the following should give you a notion of what is possible):
function vscCheckpointHere(key, lib, cell, view, message, inclibs)
let ddCVS = vscPrint0(printf("Hierarchy for %s, %s, %s ...",
\ a:lib, a:cell, a:view))
if ddCVS == vscGetHierarchyDDs(a:lib, a:cell, a:view, a:inclibs)
let ddCVS = vscPrint0(printf(" %d cellviews.", length(ddCVS))
call vsCheckpoint(a:message)
endif " ddCVS
" endfunction vsCheckpointHere
endfunction
(I'm not sure whether or not a comment is allowed after
":endfunction", see ":help :endfunction")
how do i set this up? do i need something in my .vimrc?
The ability to use comments in vimscript (including in your vimrc) is part of
Vim. You don't need to set up anything, except maybe write the comments when
you write the code.
If your vim code is properly indented, you might also have less need
for this kind of comments.
the indenting was correct when i send the email but the formatting
changed by the time it made it to the list i guess
thx!
I mean: the differences between a C-like language like vimscript and a
lisp-like language like emacs-script might perhaps make this kind of comments
less necessary if the code is properly indented.
Best regards,
Tony.
--
The rain it raineth on the just
And also on the unjust fella,
But chiefly on the just, because
The unjust steals the just's umbrella.