Author Topic: Can use notepad++ format lisp code ?  (Read 14826 times)

0 Members and 1 Guest are viewing this topic.

AIberto

  • Guest
Can use notepad++ format lisp code ?
« 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


After the formatting







nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: Can use notepad++ format lisp code ?
« Reply #1 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.

AIberto

  • Guest
Re: Can use notepad++ format lisp code ?
« Reply #2 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++

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Can use notepad++ format lisp code ?
« Reply #3 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
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: Can use notepad++ format lisp code ?
« Reply #4 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

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Can use notepad++ format lisp code ?
« Reply #5 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:
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:
  • 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. |;

AIberto

  • Guest
Re: Can use notepad++ format lisp code ?
« Reply #6 on: August 07, 2015, 07:32:06 AM »
Thank you irneb and roy .

JohnK

  • Administrator
  • Seagull
  • Posts: 10634
Re: Can use notepad++ format lisp code ?
« Reply #7 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".
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

AIberto

  • Guest
Re: Can use notepad++ format lisp code ?
« Reply #8 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.

JohnK

  • Administrator
  • Seagull
  • Posts: 10634
Re: Can use notepad++ format lisp code ?
« Reply #9 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.  :)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Can use notepad++ format lisp code ?
« Reply #10 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.

JohnK

  • Administrator
  • Seagull
  • Posts: 10634
Re: Can use notepad++ format lisp code ?
« Reply #11 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.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Can use notepad++ format lisp code ?
« Reply #12 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.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ChrisCarlson

  • Guest
Re: Can use notepad++ format lisp code ?
« Reply #13 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. 

JohnK

  • Administrator
  • Seagull
  • Posts: 10634
Re: Can use notepad++ format lisp code ?
« Reply #14 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).
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Can use notepad++ format lisp code ?
« Reply #15 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).
« Last Edit: August 07, 2015, 10:14:15 AM by irneb »
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Can use notepad++ format lisp code ?
« Reply #16 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).


TheSwamp.org  (serving the CAD community since 2003)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Can use notepad++ format lisp code ?
« Reply #17 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
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

hmspe

  • Bull Frog
  • Posts: 362
Re: Can use notepad++ format lisp code ?
« Reply #18 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.
"Science is the belief in the ignorance of experts." - Richard Feynman

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Can use notepad++ format lisp code ?
« Reply #19 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):
  • Some files encoded in ANSI are opened as 'UTF8 without BOM'. This depends on the characters used.
  • The dash '-' is identified as a 'word break character'. This makes it impossible to select a function name like 'vl-string-right-trim' with a double click. Strangely, Scite (the basis for Notepad++) has a word.characters setting allowing the user to change this behaviour.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Can use notepad++ format lisp code ?
« Reply #20 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.

Lonnie

  • Newt
  • Posts: 175
Re: Can use notepad++ format lisp code ?
« Reply #21 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.

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Can use notepad++ format lisp code ?
« Reply #22 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.
A man who never made a mistake never made anything

ribarm

  • Gator
  • Posts: 3272
  • Marko Ribar, architect
Re: Can use notepad++ format lisp code ?
« Reply #23 on: June 28, 2022, 12:08:39 AM »
What lunatic would run routine from notepad and debug?
Can you show us something more thoughtful?
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube