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

0 Members and 1 Guest are viewing this topic.

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: 28753
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: 169
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: 1398
  • 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: 3225
  • 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