Change indentation in lisp file for selected section of code

Change indentation in lisp file for selected section of code

Anonymous
Not applicable
454 Views
1 Reply
Message 1 of 2

Change indentation in lisp file for selected section of code

Anonymous
Not applicable

Is there an easy way to change the indentation of a section of code?

I frequently have to add an if or cond and then have to change the indentation.

 

Example -

 

(defun C:TEST ()

  (princ "\nThis is a test.")

  (princ)

)

 

To - Add if to command then indent the princ line.

 

(defun C:TEST ()

  (if T

    (princ "\nThis is a test of True.")

  )

  (princ)

)


 

0 Likes
Accepted solutions (1)
455 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

Yes this is very easy to do.  If you open the lisp file in the visual lisp editor you can format the whole file or you can re-format a selection of code.

 

If you go to the tools menu and select format code in editor the entire file will get re-formated. if you have a selection highlighted format selection will be an option under tools.

 

There are formatting options under tools\Environment Options\Visual LISP Format Options...

 

 

Matthew

0 Likes