My guess is that you need to quote (s clause) when passing it to 
(concat).  Better still: loose the (concat), since tempo-template already
concatenates strings for you. Consider this line:

     "'(l '> \"if (\" (p \"if-clause: \" clause) \") \""

It will evaluate to '(l '> "if (" (p "if-clause: " clause) )"
which then gets passed to the tempo-template code.

Your problem line has this:

     "(concat \" // end of if (\" (s clause) \")\")"

which I would expect to become

     (concat " // end of if (" (s clause) ")")
and then
     " // end of if (XXX)" ;; XXX is failed eval of (s clause)
when getting sent to tempo-template.

I bet that something like this
     "\" // end of if (\" (s clause) \")\""
would work fine.

Failing that, try quoting (s clause) so that it isn't evaluated when
you call concat.


In message <[EMAIL PROTECTED]>, Mark Mynsted <[email protected].
com> writes:
: OK.  I attempted to get some code working this week-end to toggle
: comments for the auto-generated code, and failed.  The problem I am
: having is that the "(s clause)" code keeps getting run as lisp code
: rather than as part of the tempo template.
: 
: Does anybody have any idea how to get this to work?  The following is
: a example.
: 
: I set up a boolean variable called jde-gen-comments as follows:
: 
: (defcustom jde-gen-comments t
:   "*If no-nil, use comments, else do not use comments.
: with comments:
: 
:       try 
:       {
:        
: 
:       } catch (Exception e) 
:       {
:        
:       } // end of try-catch
: 
: witout comments:
: 
:       try 
:       {
:        
: 
:       } catch (Exception e) 
:       {
:        
:       }
: 
: Setting this variable to t, uses comments in skeletons and templates."
:   :group 'jde-gen
:   :type 'boolean)
: 
: 
: Here is an example of what I am attempting to do and how it does not
: work.  The error is "Symbol's function definition is void: s".  I
: assume this is because the code is in a (l expression) block, and so
: the (s clause) is being evaluated.  I have tried everything I can
: think of, even putting the (s clause) in a variable then appending it
: if applicable...  If I do that, then the the literal text (s clause)
: is written in the comment rather then the value stored by tempo in
: clause.  I would really like to figure this out.  Altering the
: templates via customize is far too time consuming.  I would rather
: alter the jde-gen.el once, that keep altering via customize...
: 
: (defcustom jde-gen-cflow-if
:   '(
:     "(if (jde-parse-comment-or-quoted-p)"
:     "'(l \"if\")"
:     "'(l '> \"if (\" (p \"if-clause: \" clause) \") \""
:     "(if jde-gen-k&r "
:     "()"
:     "'>'n)"
:     "\"{\"'>'n'>'r'n"
:     "\"}\""
:     "(if jde-gen-comments "
:     "(concat \" // end of if (\" (s clause) \")\")"
:     "())"
:     "'>'n'>)"
:     ")"
:     )
:   "Skeleton if statement. To insert the if statement at point, type if 
: and then space. Note that abbrev mode must be enabled. See 
: `jde-enable-abbrev-mode'"
:   :group 'jde-gen
:   :type '(repeat string)
:   :set '(lambda (sym val)
:         (jde-gen-define-abbrev-template
:          "if"
:          (jde-gen-read-template val))
:         (set-default sym val)))
: 
: 
: Please help.  
: 
: 
: -- 
: Sincerely yours;
: 
: Mark Mynsted
: 
: VHA Management Information Systems Client Services
: 972.830.0592, internal x1592
: 
: 
:  /"\
:  \ /     ASCII Ribbon Campaign
:   X      Against HTML Mail
:  / \
:         
: 

Reply via email to