To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 938
Subject: 
Any Emacs/LDraw users?
Newsgroups: 
lugnet.cad
Date: 
Mon, 15 Feb 1999 12:32:38 GMT
Viewed: 
719 times
  
I'm an Emacs user myself, and for Emacs users it is very common to make
a new major mode whenever one encounters a new data format.  So I have
started making a major mode for editing LDraw DAT files in Emacs.

It is still very unfinished, but for people already using Emacs, it may
be worthwile to check out.  So far, this is what I have implemented:

o Automatically colours the buffer with font-lock according to the
  contents.  Here's a screenshot to explain what I mean:

    http://www.math.uio.no/~fredrigl/technic/ldraw-mode/screenshot.gif

  Note that the line in which the cursor is located has a red warning
  font because it is syntactically wrong.  This feature enables you to
  quickly discover errors.

  Also note the two levels of inlining which has been performed.  More
  on this further down.

o User setable number of decimals to preserve.  Defaults to two
  decimals.

o Hitting C-c C-q cleans up the current line.  That is, it removes all
  surplus whitespace, rounds all digits, removes trailing ".00"'s and so
  on.

o Functions can easily be repeated over a number of lines.  As an
  example, hitting C-u C-c C-q will apply the "clean-up" function to all
  lines.  Hitting C-u - 6 C-c C-q applies it to the six preceding lines
  and so on.

o Parts, lines and polygons can be moved by typing C-c C-m.  If you
  want to move the five following lines, say, type C-u 5 C-c C-m.

o Parts, lines and polygons can be turned by typing C-c C-t.  Typing
  C-u C-c C-t will turn _all_ lines in the model simultaneously.

o Sub-Models, Parts and primitives can be inlined by hitting C-c C-i.
  This can be done recursively, so that parts contained in an inlined
  sub-model can themselves be inlined.  Note that the inliner does not
  handle the special colour 24 in the inlined parts yet.

TODO:

Here's a list of things I plan to add in the future:

o LEdit emulation mode.  At the user's option, the editor may be turned
  into a LEdit emulator which mimics the behavior of LEdit.  That way,
  experienced LEdit users can quickly add parts, rotate them, and so on.
  Obviously, it will not actually render the parts, but all other
  aspects of LEdit will be emulated.  Exit the emulator by pressing "ESC
  F E", as usual.

o Pull down menus.  I normally don't use pull down menus on Emacs, but I
  figure other people like them, so they should be added for the LDraw
  functions.

o Interaction with LDLITE/LDraw.  Render all or parts of the model
  edited by launching LDLITE or LDraw.  So far, I have only used Emacs
  on my Linux system, so I haven't implemented this yet.

o Handle indentation.

o Handle special LDLITE declarations.

o Better documentation.

Here's the GPL'ed sourced for the LDraw major mode:

    http://www.math.uio.no/~fredrigl/technic/ldraw-mode/ldraw-mode.el

Please report any bugs, and issue any questions to me (or to the
newsgroup).  I have only tested this on my Linux system, but I assume it
should also run on an Emacs running in the Windows environment, possibly
with some modifications.

Fredrik


Subject: 
Re: Any Emacs/LDraw users?
Newsgroups: 
lugnet.cad
Date: 
Mon, 15 Feb 1999 15:02:55 GMT
Viewed: 
748 times
  
Fredrik Glöckner (fredrik.glockner@bio.uio.no) announced
LDraw mode for Emacs.

I'll have a look.

Play well,

Jacob

        --------------------------------------------
        --  E-mail:         sparre@nbi.dk         --
        --  Web...: <URL:http://hugin.risoe.dk/>  --
        --------------------------------------------

LDraw FAQ:      <URL:http://hugin.risoe.dk/JJ_Memorial/FAQ/>


Subject: 
Re: Any Emacs/LDraw users?
Newsgroups: 
lugnet.cad
Date: 
Tue, 16 Feb 1999 10:09:32 GMT
Viewed: 
535 times
  
sparre@sys-323.risoe.dk (Jacob Sparre Andersen) writes:

I'll have a look.

Well, thanks.

I'm fully aware that there will only be very narrow interest for the
ldraw-mode I'm authoring, of course.  Most users here seem to be native
Windows users with limited experience with Emacs.  And it is probably
not worthwile for a non-Emacs user to learn to use Emacs just to use
this ldraw-mode.

But the software will be very useful for myself once I get myself a
proper computer at home, so that I can install Emacs on the (very small)
Windows partition on it.

Fredrik


Subject: 
Re: Any Emacs/LDraw users?
Newsgroups: 
lugnet.cad
Date: 
Sun, 21 Feb 1999 19:40:20 GMT
Viewed: 
940 times
  
Wow! Excellent!
As a long time emacs user, I'm very impressed.
Since I often have trouble remembering part numbers,
any chance of adding a query-lookup?  E.g. if I have the
cursor on the string "wing", and I do M-x-ldraw-lookup,
I would get a propt listing all the .dat files with "wing" in the
description?

-gyug

"Fredrik Glöckner" wrote:

I'm an Emacs user myself, and for Emacs users it is very common to make
a new major mode whenever one encounters a new data format.  So I have
started making a major mode for editing LDraw DAT files in Emacs.



Subject: 
Re: Any Emacs/LDraw users?
Newsgroups: 
lugnet.cad
Date: 
Mon, 22 Feb 1999 10:27:51 GMT
Viewed: 
611 times
  
Paul Gyugyi <paul@gyugyi.com> writes:

Wow! Excellent!  As a long time emacs user, I'm very impressed.

Thanks, I'm happy _someone_ actually uses it!  :-) For a while, I was
thinking I was just programming this for my own use.

BTW, are you using this on Emacs 20 or Emacs 19?  I'm thinking that the
file coding system thing, which makes sure DAT-files get the correct
EOL-style, may not work in Emacs 19.

Since I often have trouble remembering part numbers, any chance of
adding a query-lookup?

Yes, I this is on the planning stage.  But I'm not sure how this should
look.  There are two alternatives:

o Use the "parts.lst" file.  This should be fairly fast, but only
registred parts in the "\parts" directory can be searched.

o Build and maintain a "database" in Lisp.  Once a database is made,
searching would be very fast.  And parts everywhere can be searched.
(Actually, the user could choose which dirs to include in the database.)
But the database needs to be reconstructed when new parts/models are
added, which will probably be slow.

Also, I'm working on finishing the LEdit emulation, which should be done
first.

BTW, the newest addition is the feature which downloads and views the
part on the current line in the correct colour.  This is triggered with
"C-c C-p".  I currently don't maintain any version number, and new
updates of the source are added "all the time", which makes things
difficult for any users, I guess.

And when LDraw-mode is engaged, you can press "C-h m" to list the
current key-bindings.

Fredrik


©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR