TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: AIberto on August 07, 2015, 03:02:35 AM

Title: Can use notepad++ format lisp code ?
Post by: AIberto on August 07, 2015, 03:02:35 AM
Dear all

Can use notepad++ format lisp code ?  if not ,Please recommend a plugin. Thanks

Before formatting
(http://www.theswamp.org/index.php?action=dlattach;topic=49910.0;attach=30874;image)

After the formatting
(http://www.theswamp.org/index.php?action=dlattach;topic=49910.0;attach=30875;image)





Title: Re: Can use notepad++ format lisp code ?
Post by: nobody on August 07, 2015, 03:34:45 AM
If you have autocad the command "Vbaide" will open the lisp compiler / editor.  Although I'm not sure I'm addressing your question right.
Title: Re: Can use notepad++ format lisp code ?
Post by: AIberto on August 07, 2015, 03:43:10 AM
If you have autocad the command "Vbaide" will open the lisp compiler / editor.  Although I'm not sure I'm addressing your question right.

Vbaide is VBA editer , you mean "Vlide" ?

Oh .my question is about notepad++
Title: Re: Can use notepad++ format lisp code ?
Post by: irneb on August 07, 2015, 05:02:44 AM
I think Alien meant to state VLIDE (as in Visual Lisp IDE) from within AutoCAD's command line.


As for NotePad++ and AutoLisp, yes you can achieve such by some tweaking of the built-in Lisp lexers, but there are problems:
Of course an alternative is LispPad: http://www.theswamp.org/index.php?topic=44949.5
Title: Re: Can use notepad++ format lisp code ?
Post by: nobody on August 07, 2015, 05:08:48 AM
If you have autocad the command "Vbaide" will open the lisp compiler / editor.  Although I'm not sure I'm addressing your question right.

Vbaide is VBA editer , you mean "Vlide" ?

Oh .my question is about notepad++

oh sorry. I did mean vlide :) I wonder if netbeans would work
Title: Re: Can use notepad++ format lisp code ?
Post by: roy_043 on August 07, 2015, 06:18:09 AM
I think Alien meant to state VLIDE (as in Visual Lisp IDE) from within AutoCAD's command line.


As for NotePad++ and AutoLisp, yes you can achieve such by some tweaking of the built-in Lisp lexers, but there are problems:
  • N++ is just an editor for AutoLisp, you can't use it to test and/or debug anything - i.e. it's not an IDE. The only AutoLisp IDE is the VLIDE built into AutoCAD, but its editing and management functionality is decades behind stuff like N++.
  • AutoLisp has too many keywords to be defined inside N++'s keyword lists: https://gist.github.com/CADbloke/7481998
  • Comments cause problems in N++: http://forums.augi.com/showthread.php?120750-Best-editor-for-LISP
  • You don't get the autoformatting as VLIDE provides: http://www.cadtutor.net/forum/showthread.php?72439-Indent-and-select-in-NOTEPAD
Of course an alternative is LispPad: http://www.theswamp.org/index.php?topic=44949.5
I am a regular user of Notepad++. I don't have access to Vlide as I am a BricsCAD user.

I have created a user defined language for Lisp. This has two advantages over the built-in Lisp Lexer:
One thing Notepad++ can't do is recognize multiline comments in Lisp files (I am not sure if irneb is referring to this).
Code - Auto/Visual Lisp: [Select]
  1. ;|
  2. Multiline
  3. Multiline
  4. |;
Title: Re: Can use notepad++ format lisp code ?
Post by: AIberto on August 07, 2015, 07:32:06 AM
Thank you irneb and roy .
Title: Re: Can use notepad++ format lisp code ?
Post by: JohnK on August 07, 2015, 07:54:22 AM
I'm sick of seeing you people struggle with your text editors (you shouldnt be; you are in your editor more then you are AutoCAD) so I'm just going to keep this short and sweet. Make the switch to Emacs or Vim. The best I can come to listing their features is to say: "Highly customizable".
Title: Re: Can use notepad++ format lisp code ?
Post by: AIberto on August 07, 2015, 08:17:04 AM
I'm sick of seeing you people struggle with your text editors (you shouldnt be; you are in your editor more then you are AutoCAD) so I'm just going to keep this short and sweet. Make the switch to Emacs or Vim. The best I can come to listing their features is to say: "Highly customizable".

I have no requirements. I just want know  notepad++ whether can format lisp, if not  ,that's nothing.
Title: Re: Can use notepad++ format lisp code ?
Post by: JohnK on August 07, 2015, 08:20:06 AM
A text editor that can't format code is nothing? You might as well be carving your code into a banana then.  :)
Title: Re: Can use notepad++ format lisp code ?
Post by: Lee Mac on August 07, 2015, 08:49:37 AM
Personally, I find it easier to format the code as I go; each to their own I suppose.
Title: Re: Can use notepad++ format lisp code ?
Post by: JohnK on August 07, 2015, 09:03:23 AM
You shouldn't have to think/worry about formatting your code at all. A proper (aka: good) text editor should format as you type and/or allow you to refomat to your/industry standards at your whim (it should just work *period*). No thinking required. My text editor does what I want it to, not the other way around.
Title: Re: Can use notepad++ format lisp code ?
Post by: MP on August 07, 2015, 09:40:26 AM
Personally, I find it easier to format the code as I go; each to their own I suppose.

Times a million.

You shouldn't have to think/worry about formatting your code at all. A proper (aka: good) text editor should format as you type and/or allow you to refomat to your/industry standards at your whim (it should just work *period*). No thinking required. My text editor does what I want it to, not the other way around.

Because hitting the tab key with or without the shift key is so labor intensive. lol.
Title: Re: Can use notepad++ format lisp code ?
Post by: ChrisCarlson on August 07, 2015, 09:52:28 AM
I do my own formatting (visually I have a solid preferences file that theSwamp helped create) I just don't trust auto closing of parenthesis, I prefer to get lost in a seas of parenthesis, preferably my own where possible. 
Title: Re: Can use notepad++ format lisp code ?
Post by: JohnK on August 07, 2015, 10:03:00 AM
Personally, I find it easier to format the code as I go; each to their own I suppose.

Times a million.

You shouldn't have to think/worry about formatting your code at all. A proper (aka: good) text editor should format as you type and/or allow you to refomat to your/industry standards at your whim (it should just work *period*). No thinking required. My text editor does what I want it to, not the other way around.

Because hitting the tab key with or without the shift key is so labor intensive. lol.

Is that the mindset you take when writing your own programs (sometimes *it* works and sometimes *it* doesn't)? If I use a tool, I want it to just work that's why I ditched all the other editors I tried before I found one I liked (I tried a dozen or so). ...maybe I was mistaken in thinking this was an assembly of programmers (highly technically minded individuals who bend and shape computers to preform their bidding).

BTW, you don't really have to hit tab when you're typing do you (seriously)? I mean your editors do have auto indenting as you type right?

I do my own formatting (visually I have a solid preferences file that theSwamp helped create) I just don't trust auto closing of parenthesis, I prefer to get lost in a seas of parenthesis, preferably my own where possible. 

I don't like auto closing of parens either.

That's awesome! We really should get a repository going again to host stuff like that (preference files and such).
Title: Re: Can use notepad++ format lisp code ?
Post by: irneb on August 07, 2015, 10:06:44 AM
One thing Notepad++ can't do is recognize multiline comments in Lisp files (I am not sure if irneb is referring to this).
Code - Auto/Visual Lisp: [Select]
  1. ;|
  2. Multiline
  3. Multiline
  4. |;
Exactly the issue I had with it too. I thought I actually linked to that, must've mixed up some of the copy-pastes.
http://www.theswamp.org/index.php?topic=44804.0

As for using emacs/vim and/or formatting manually, yes I do agree with such - to an extent. The trouble usually comes when you copy-paste stuff, as the source indenting may not have been the same as the destination. In VLIDE (if you stick with one of the default formats) it becomes a one-click operation to sort that out. BTW, if anyone's been C#-ing you'd notice the newer VisualStudio (since 2013) actually formats as you type / paste. Strange how MS only got it working that way in the last-but-one release, I've had similar in SharpDevelop and MonoDevelop for a while now.

Personally, I don't mind the editor that much. Actually when programming outside of ACad I tend to use various tools, e.g. nearly all my DotNet stuff is done in MonoDev under Linux, while the rest I use Kate editor for languages such as Python / Haskell. IMO it's more capable and more customizable than N++. Though I'd definitely look at emacs for any sort of Lisp, perhaps Vim as 2nd choice. Definitely possible to use either for nearly all languages, and they do have some ways of even linking to runtimes (i.e. capable to debug nearly anything) - I can't remember just now, but there was some feature which I wanted and was completely impossible in Vim and very difficult in emacs, which was standard in Kate (the reason I'm using that instead).
Title: Re: Can use notepad++ format lisp code ?
Post by: Mark on August 07, 2015, 10:07:57 AM
...maybe I was mistaken in thinking this was an assembly of programmers (highly technically minded individuals who bend and shape computers to preform their bidding).

(http://www.theswamp.org/screens/mark/trolling_2.jpg)
Title: Re: Can use notepad++ format lisp code ?
Post by: MP on August 07, 2015, 10:23:45 AM
Is that the mindset you take when writing your own programs (sometimes *it* works and sometimes *it* doesn't)?

lol, troll harder. I'll let my record speak to that issue.

maybe I was mistaken in thinking this was an assembly of programmers (highly technically minded individuals who bend and shape computers to preform their bidding).

lol, troll harder. I'll let my record speak to that issue.

BTW, you don't really have to hit tab when you're typing do you (seriously)? I mean your editors do have auto indenting as you type right?

If one is harvesting code from forums (as I suspect the OP might be) it may need to be reformatted. That generally involves selecting a block of code and hitting tab or shift tab to orient the block appropriately.

UltraEdit, like any competent editor, has smart indenting, but you know that.

tl;dr: fail
Title: Re: Can use notepad++ format lisp code ?
Post by: hmspe on August 07, 2015, 11:13:09 AM
I'm sick of seeing you people struggle with your text editors (you shouldnt be; you are in your editor more then you are AutoCAD) so I'm just going to keep this short and sweet. Make the switch to Emacs or Vim. The best I can come to listing their features is to say: "Highly customizable".

John,

Care to share some of your customizations?  I have no problem with Emacs or Vim in general, but there aren't enough hours in the day for my normal work load plus starting from scratch on customizations for a new editor.   

Can you recommend sites to download Emacs for Windows and add-ins for AutoLisp?  There seem to be a lot of versions of Emacs available.  Vim is easier, but the add-ins for lisp seem to be for common lisp, not AutoLisp.  Trying to wade through all the links Google returns would take approximately forever. 

FWIW I am in Bricscad far more than in any editor.  Engineering is my day job.  I write code to support my engineering work when there's a need.
Title: Re: Can use notepad++ format lisp code ?
Post by: roy_043 on August 08, 2015, 10:57:54 AM
I am a regular user of Notepad++. I don't have access to Vlide as I am a BricsCAD user.

I have created a user defined language for Lisp. This has two advantages over the built-in Lisp Lexer:
  • Negative numbers and numbers in the scientific format (1e-8) are recognized.
  • You can use 8 keyword groups enabling you to split the large function list over two groups.
One thing Notepad++ can't do is recognize multiline comments in Lisp files (I am not sure if irneb is referring to this).
Code - Auto/Visual Lisp: [Select]
  1. ;|
  2. Multiline
  3. Multiline
  4. |;

Two more Notepad++ annoyances (apart from the problem with multiline comments):
Title: Re: Can use notepad++ format lisp code ?
Post by: roy_043 on August 08, 2015, 11:04:40 AM
This auto-indenter plugin works reasonably well:
http://code.google.com/p/indentbyfold/

You will probably want to switch off 'Allow folding of comments' when you use this plugin.
Title: Re: Can use notepad++ format lisp code ?
Post by: Lonnie on May 24, 2021, 01:32:46 PM
Not to open up old wounds but

https://forum.bricsys.com/discussion/32871/a-notepad-language-file-for-bricscad-lisp

It's latest changes are 2017

https://nedcad.nl/tools/

For me at least it helped.
Title: Re: Can use notepad++ format lisp code ?
Post by: BIGAL on May 25, 2021, 01:31:45 AM
Are you aware of the current extension that allows running Notepad++ lisp directly from Acad or Bricscad for me just type N++ and runs current code.
Title: Re: Can use notepad++ format lisp code ?
Post by: ribarm on June 28, 2022, 12:08:39 AM
What lunatic would run routine from notepad and debug?
Can you show us something more thoughtful?