-----Original Message-----
From: Chitale, Sandip V [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 16, 2003 9:58 PM
To: Jayakrishnan Nair; [EMAIL PROTECTED]
Subject: RE: Auto Indending


It is due to the (IMHO) extraneous (c-indent-defun) call at the end of
jde-gen-cflow-if template. Customize it and remove the call.

(Reasoning: why should every if statement indent the whole functions?
Maybe the call should be substituted with indent-region, assuming the
whole if statement is wrapped by a region.)

(defcustom jde-gen-cflow-if
  '(
    "(if (jde-parse-comment-or-quoted-p)"
    " '(l \"if\")"
    " '(l '> \"if\" jde-gen-conditional-padding-1 "
    "  \"(\" jde-gen-conditional-padding-2 (p \"if-clause: \" clause)"
    "        jde-gen-conditional-padding-2 \")\""
    " (if jde-gen-k&r "
    "   jde-gen-conditional-padding-3 "
    "  '>'n)"
    " \"{\"'>'n'>'r'n"
    " \"}\""
    " (if jde-gen-comments "
    " '(l \" // end of if (\" (s clause) \")\"))"
    " '>'n'> (c-indent-defun))"
    " )"
    )



> -----Original Message-----
> From: Jayakrishnan Nair [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, July 16, 2003 5:50 PM
> To: [EMAIL PROTECTED]
> Subject: Auto Indending
> 
> 
> Hi,
>  
> I am using JDE 2.3.2 on Win2K. Everything works fine. If I 
> type an if() then it just does it without any problem. But 
> later, due to some key combination I am pressing, when I type 
> if(), it says "Indenting.." And waits for a while and then 
> puts the open and close curly brace and all. It takes some 
> time and is irritating. How does this mode get turned on ?
>  
> Cheers,
>  
> JK
>  
> 


How about creating a JDE customization variable to control if
c-indent-defun is called by any JDE abbreviations?  It seems a few
people experienced performance issues with this, and it is in three
different templates (if, while, and try-catch).

At the bottom is a patch to the jde-gen.el in 2.3.3Beta5 (revision
1.64). It creates a new JDE customization variable called
jde-gen-cindent. If it is set to true, the default, the abbreviations
behave as currently implemented. If it is set to false, if, while, and
try-catch will not call the c-indent-defun.

David

-------------------- jde-gen.patch -------------------------------
--- jde-gen.el.old      2003-07-16 11:21:41.000000000 -0400
+++ jde-gen.el  2003-07-16 12:23:55.000000000 -0400
@@ -2220,6 +2220,13 @@
   :group 'jde-gen
   :type 'boolean)
 
+(defcustom jde-gen-cindent t
+  "*If nil, disables the call to c-indent-defun at the end of
+any templates where it is included.  This can improve performance
+on very large source files."
+  :group 'jde-gen
+  :type 'boolean)
+
 ;; (makunbound 'jde-gen-cflow-if)
 (defcustom jde-gen-cflow-if
   '(
@@ -2235,7 +2242,9 @@
     " \"}\""
     " (if jde-gen-comments "
     " '(l \" // end of if (\" (s clause) \")\"))"
-    " '>'n'> (c-indent-defun))"
+    " '>'n'>"
+    " (if jde-gen-cindent"
+    "  (c-indent-defun)))"
     " )"
     )
   "Skeleton if statement. To insert the if statement at point, type if
@@ -2357,7 +2366,9 @@
     " \"}\""
     " (if jde-gen-comments "
     "  '(l \" // end of while (\" (s clause) \")\"))"
-    " '>'n'> (c-indent-defun))"
+    " '>'n'>"
+    " (if jde-gen-cindent"
+    "  (c-indent-defun)))"
     " )"
     )
   "Skeleton while statement. To insert the statement at point, type while
@@ -2546,7 +2557,9 @@
     " \"}\""
     "  (if jde-gen-comments "
     "  '(l \" // end of try-catch\"))"
-    " '>'n'> (c-indent-defun))"
+    " '>'n'>"
+    " (if jde-gen-cindent"
+    "  (c-indent-defun)))"
     " )"
     )
   "Skeleton try-catch statement. To insert the statement at point, type try
-------------------- jde-gen.patch -------------------------------






Reply via email to