我正在尝试从setq运行lisp。
我确信有一种更有效的方法,但我很坚强&知识很少。
我有一个lisp,我想用于许多块插入、文本注释和其他一些事情。
我不是在寻找重写的代码,我只是需要能够从setq运行“defun”。
代码开头的setq是每个文件中唯一会更改的内容。我确实有代码工作,但必须去通过,找到并编辑每个差异。我正在努力使它更容易改变。
她是我代码的摘录。我有一个单独的c:defun,它运行并调用“the sub命令”&我在同一个lisp中编写了new1和new2 defun。我的问题是运行new1或new2
- (setq value-1 "changeable-value") ;this is the 1st stored value
- (setq new1 (strcat value-1 "generic text1")) ;this is the 1st stored value combined with a 1st generic value.
- (setq new2 (strcat value-1 "generic text2")) ;this is the 1st stored value combined with a 2nd generic value.
- (defun the-sub-command()
- (initget 1 "EXG PROP")
- (setq exg-prop (getkword "\nExisting or Proposed? [Existing/Proposed]: ")) ;get INFO
- (COND
- ((= exg-prop "EXG") new1)
- ((= exg-prop "PROP") new2)
- (T (prompt "\nOpps there was an error!"))
- )
- (princ)
- )
- (defun new1()
- ......the commands
- (princ)
- )
- (defun new2()
- ......the commands
- (princ)
- )
|