Windows install

Started by jazper, May 06, 2013, 01:39:07 AM

Previous topic - Next topic

jazper

#15
Thanks, again, rickyboy. usb drives, at my workplace, are unfortunately even more verboten and reviled than handing out the permission I would need for java.  Insert one, and a so-called support person is sure to arrive (looking peeved) within seconds, and speaking in tongues :(



Nonetheless, I am glad you drew my attention to Portable Apps - great idea - I will try it for travelling - has promise for internet cafes at airports etc, where they have usually never *heard* of emacs.  



emacs(24) installed just fine on my work PC.  Things have come a long way in the last couple of years, because this was painless.  



When I have time, I'll scout around there for where to put the newLISP mode file - on Ubuntu 12.04, it will be in  ~/.emacs.d, which is currently empty, waiting for me to place a newlisp.el file there.

rickyboy

#16
See this for a discussion on the state of newlisp-mode: http://newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=4349">http://newlispfanclub.alh.net/forum/vie ... =16&t=4349">http://newlispfanclub.alh.net/forum/viewtopic.php?f=16&t=4349.
(λx. x x) (λx. x x)

jazper

#17
I finally found a folder at C:emacslispprogmodes (emacs on my setup is on C:emacs) containing a bunch of .el files that I assume are mode files, and placed newlisp.el in it.  Not a single posting or guide found thus far even mentions that folder.  Then I found a book I bought years ago on Gnu Emacs which was up to date for emacs 21.3, in which some poring (in chapter 13) revealed that my .emacs file should be placed in whatever folder is configured to be my HOME folder.   That was not yet defined, so I created that User Variable via Control Panel, and Advanced System Settings.  Then, I created the .emacs file, and copied the emacs load code from the newlisp.el README into it.  Naturally, I had to change the folder where newlisp.el is found, accordingly.  



So, I am at the point where emacs loads normally (until I got things right, it complained of not finding the file), and the result is ... hopeless.  Because, when I load a newlisp file, I get no syntax colouring, nor do I get the option of shelling out to program execution, and editing by turns, which is the whole point of the many hours that I have spent.  Ptooey!  Blech!



And that, sadly is the state of MY discussion on newlisp mode.



I did find a little program, though, named "LispIDE" for windows.  One has to create a batch file, containing for example:newlisp myprogram.lspname it [anything].bat (I used  myprogram.bat), and then (in LispIDE) use Tools menu to set the path, being that .bat file.  Once that's done, all one needs to do is use the reset icon each time the program is to be run.



Syntax highlighting is colourful and good, and, side-stepping my java isse, this will do just fine on Win 7 at work, because I do only small test programs there.



In the end, though, I am irked that I can't get emacs to work usefully for me on Windows - even for Latex, I resorted to TexWorks.  The exact same file that works fine in (Win 7) TexWorks results in many Latex errors under emacs in Win 7.  The PDF does finally print and is ok, but who wants to press OK sixty times to get a PDF?



On Ubuntu, I use both Emacs and TexWorks interchangeably for Latex without problems.  



Once again, if there is a newlisp user who is actually successfully using both emacs and newLISP on Win 7, it would be great if that person could share setup experience with me.



Having said all that, I am still grateful, as always, to rickyboy and whoever else lends a hand.

rickyboy

#18
Oops. Mea culpa, on the Emacs startup thing.  Stay tuned.  I'm going to put something together and get back to you here, as soon as I'm finished helping the fam get their day started.
(λx. x x) (λx. x x)

Lutz

#19
Note, that although you could not run the newLISP GS IDE, you still could run the Guiserver Java demos from the command line.



That means, you also can use the Emacs based IDE to edit/launch programs launching and communicating with the Java based guiserver. The problems you had, where just shelling out from Java, starting a new process, but you still can use Java from newLISP.



Ps: updated http://www.newlisp.org/code/newlisp.el">http://www.newlisp.org/code/newlisp.el to 10.5.0 and using the latest from here https://github.com/kosh04/newlisp-files">https://github.com/kosh04/newlisp-files



I believe kosh04 is the same kosh on this forum.

jazper

#20
I am not sure what is meant here:
QuoteThat means, you also can use the Emacs based IDE to edit/launch programs launching and communicating with the Java based guiserver. The problems you had, where just shelling out from Java, starting a new process, but you still can use Java from newLISP


Which IDE are we talking about here?  Emacs, LispIDE or newLISP GS IDE?

xytroxon

#21
Lutz, I am also having the same problem on Win 7 :o(



Back in March, I uninstalled Java 6 when it failed to upgrade to Java 7... (Downloading nearly 31 megabytes over a 28.8k phone modem over a rickety phone line in the country isn't pretty...) From the on going Java security problems I read about back then, I waited to download Java 7... (One article I read recomended uninstalling Java and to wait until fall 2013... or 2014... or...)



When I saw Jazper was having problems, I tried downloading Java 7... when lighting zapped my modem after about 27 megabytes. (expletives deleted)... So, I fired up my old Win 95/98 machine and... the moniter died... (expletives deleted)... then the clock battery died (more expletives deleted)...



Tried downloading via my Android tablet at MickyD's a couple of times... (9+ partial downloads  - severe eye and thumb strain - 3+ pounds weight gain)...



Finally!!! Downloaded Java 7u21 last weekend, (GetRight - 26.8k - 4+ hours) and... no (expletive deleted) USB port... Oh my old machine has the holes in the PC board and case for USB... but back in 1996, it was an optional upgrade...  Then the (expletives deleted) CD burner... I thought my Win 98 CD burner was dead... After several days of on and off hightech troubleshooting, it seems that old Win 98 CD burners don't like Win 7 DVD-R's... So after a (many, many more expletives deleted) month, I now have Java 7 on my Win 7 machine, a beautifully readable Win 98 screen on my HDTV, and a sore thumb from switching between TV and VGA modes on my remote control...



And while the newLISP GS IDE runs nicely on Win 7, using that cmd.exe shell process to run the demo programs dies like the dirty dog son of a Java security fix that blocks it!!!!!!!!!



Since I don't have an IT department at home blocking me, I fear this affects all WIn 7 machines with the Java 7 upgrade installed... I don't use the newLISP GS IDE *, so I don't care...



Also, as a point of reference, since I mostly use my home Win 7 machine offline, it has never been automatically molested by Microsoft security fixes...



Moral: Never use a software platform named after an island that angry coffee drinking volcano gods call home...

http://en.wikipedia.org/wiki/Volcanology_of_Java">//http://en.wikipedia.org/wiki/Volcanology_of_Java



-- xytroxon



P.S. * As for me and my house, we will worship the editor house of (w)SciTE forever...

http://www.scintilla.org/SciTE.html">//http://www.scintilla.org/SciTE.html
\"Many computers can print only capital letters, so we shall not use lowercase letters.\"

-- Let\'s Talk Lisp (c) 1976

rickyboy

#22
@jazper



I installed the kosh04 (kosh) newlisp-mode on a clean linux install (I don't have Windoze at home), but the following should work on Windoze equally well.



Two steps to activate newlisp-mode in Emacs (24).



1. First, you should have already obtained and placed newlisp.el (and other files (aka newlisp-mode files)) into a proper directory. I'm going to recommend they get placed in the directory ~/.emacs.d/newlisp-mode.  Here's one way to do it.


$ cd ~/.emacs.d
$ git clone git://github.com/kosh04/newlisp-files.git newlisp-mode

You should now have the newlisp-mode files in ~/.emacs.d/newlisp-mode.  Of course, the "$ " prefix indicates working at the *nix shell, you just do the same at the cmd.exe prompt.  Maybe on Windoze, at the cmd prompt, it would be something like this.


C:> cd %HOME%/.emacs.d
C:Usersme.emacs.d> git clone git://github.com/kosh04/newlisp-files.git newlisp-mode

Notice that the git clone command should be exactly the same as the *nix version.


QuoteBut what if you don't have git?  Oops, I originally didn't think about that.  My first answer would be, why not? :)  Then, my recommendation would be to get git installed on your Windoze box ... however ... in lieu of getting git, you could perform the folllowing steps as a "poor man's install" of newlisp-mode.

[*] Create the directory ~/.emacs.d/newlisp-mode.
  • [*] Simply copy Code Select
  • ;; Setup this handy variable to reference ~/.emacs.d.
    (setq dotemacsdotd-dir (file-name-as-directory (expand-file-name "~/.emacs.d")))

    ;; Turn on column number indicator in the mode-line. (Not related at
    ;; all to newlisp-mode BTW; just nice to have.)
    (column-number-mode t)

    ;; If you hit the TAB key to indent source, you want blanks, not
    ;; tabs. This is not newlisp-mode specific, but you'll want this
    ;; because tab insertion, when you hit the TAB key, is the default. :(
    (setq-default indent-tabs-mode nil)

    ;; This turns on syntax coloring (highlighting) for all "buffers whose
    ;; major mode supports it." (quote from the font-lock-mode func doc.)
    (global-font-lock-mode t)

    ;; newlisp-mode config -- these steps are taken from the header
    ;; comment in kosh04's newlisp.el.
    (add-to-list 'load-path
                 (file-name-as-directory
                  (concat dotemacsdotd-dir "newlisp-mode")))
    (require 'newlisp)
    (add-to-list 'auto-mode-alist '("\.lsp$" . newlisp-mode))
    (add-to-list 'interpreter-mode-alist '("newlisp" . newlisp-mode))

    I did this, restarted emacs, opened a file (I called it "try.lsp") and it put the buffer into newlisp-mode straight away.  There will be a "newLISP" menu in the Menu bar.  You can type an expression in the source file, access this menu to evaluate the whole buffer (source file) or only the expression before your cursor (note your cursor position of course).



    Man, this works so well for me that I'm going to switch to using this (the kosh) version over the current newlisp-mode I have been using, which is a fork of the TJ version.  Thank you, kosh!



    _____________________________________________

    UPDATE: I just found this little easter egg: if you're in a newLISP buffer, and you do a Meta-: -- i.e. type Alt : -- you will be given a prompt at the bottom of the Emacs window (it's called the minibuffer) where you can enter a one-off expression to get evaled by the running newLISP process.  Your hands never have to leave the keyboard.  Pretty cool.



    UPDATE #2:  Added one more config line in the ~/.emacs.d/init.el (above) to change Emacs's default behavior of possibly inserting a tab character in source files when you hit the TAB key, when all you really wanted was for the line of code to indent (with spaces, and never tabs).



    UPDATE #3: Added an optional "git-less" install of newlisp-mode (in step 1).  Sorry for all the updates.
    (λx. x x) (λx. x x)

    jazper

    #23
    @xytotron - my Win 7 newLISP setup on my (home) Dell Vostro works fine.  But.  You make me think.  I have not installed any Windows updates in quite a while.  What you say makes me think that if I do, I will arrive at the same situation I have at work.  So, in order to preserve my sanity, and my current newLISP setup, I won't be doing any Windows updates at home very soon :)



    You take me back to the time I was myself on a dial up modem (56kbb) on a rickety farm line.  I was running a mill on a small farm just south of Soweto in a high crime area, surrounded by car-jacking chop shops.  One morning, I found a stiff on the corner of my plot - gangster assassination, shot from behind the head.  I tell ya, those WEREN'T the days.  



    Now, I am safely in an apartment in Cape Town, the windows being battered by hail - one of our typical winter storms, a real Atlantic squall coming at us all the way from Antarctica (well, it feels like that), and my 3G connection goes way more west than the wind every few minutes.  And that is ... technology.  



    Btw, I also like Scite.  I used it for Lua when I used that before I found newLISP.  The IDE I mentioned named "LispIDE" uses a Scintilla base, says its author.



    @rickyboy.  An enormous thanks for all your caring and effort.  When the aforementioned storm eases up, I will have a go at things - what you mentioned about newLISP in the menu is what I expected at my last attempt, because when I use Emacs for Latex, a Tex menu appears as soon as a file with the extension ".tex" is loaded.  It is, in fact, the way Emacs handled Latex that got me interested in using it for newLISP.



    When I looked at Kosh's code for the newLISP mode, I suspected it was a cut above what I had already installed, so I am glad it has worked out for you.

    rickyboy

    #24
    @jazper



    kosh's code is still a cut above, even though I ran into a snag testing it my Windoze machine at work.



    It seems that a few hours ago, kosh re-organized his github space, splitting out what used to be in a repo called newlisp-files (the one I was using) into smaller repos.  This makes a lot of sense, considering that what was in newlisp-files was a collection of orthogonal components which are not components of newLISP mode for Emacs, per se.



    The problem that I ran into was the fact that, not only had the repo name changed (from newlisp-files to newlisp-mode.el), but that the Emacs Lisp file that defines newLISP mode in Emacs was renamed from newlisp.el to newlisp-mode.el.  However, the require primitive (which loads the mode) does NOT like the new filename because it apparently doesn't look for the mode code there (i.e. (require <mode>) will fail if your code is in a file called <mode>-mode.el; however require will find the code of it's in a file called <mode>.el).



    That kind if surprised me, because I could have sworn that I saw that scenario (i.e. <mode>-mode.el for (require <mode>)) work before in the past.  Hmmm.  Perhaps this condition used to prevail but doesn't anymore (in the new version of Emacs).  idk.



    At any rate, I noticed kosh about it: https://github.com/kosh04/newlisp-mode.el/issues/1">https://github.com/kosh04/newlisp-mode.el/issues/1.



    Of course, you can do the "git-less install" above and it should work just fine.  In the meantime, I'll stick with the git repo and help kosh iron out any problems from the user perspective.
    (λx. x x) (λx. x x)

    jazper

    #25
    @rickyboy, thanks for the advice:  I couldn't run into any problems, because this site was under migration to a new server, and I had not copied your emacs instructions yet.  



    Before trying them, I had a go at installing Winger's Scite config, and that worked out okay.  So, my immediate problems at work are out of the way.  



    However, as good as Scite is, I just want to use emacs: as I said, it has been such huge pleasure with LaTeX.  Also, there's always the feeling that useful additions are only some emacs lisp code away.  I am not saying that is easy, but that it is possible, where I am not sure how to go about hacking (or whether it will even be possible) with Scite and the others.



    So, I will be trying an Emacs install, following your post, at home on Win 7, and then I will have had enough practice hopefully to whistle through it at work, where time is tight.

    jazper

    #26
    @rickyboy, sorry to say, I still have not got Emacs working with newLISP.



    Perhaps it's to do with my Emacs being in C:emacs - how will it be initialised by files in C:Usersme.emacs.d?



    Maybe I should move emacs into C:Usermeemacs?  Then put the .emacs.d file into that, and move likewise the newlisp-mode folder, with the files it contains (init.el & newlisp.el)?



    The errror I get is  File mode specification error: (void-function newlisp-mode)

    rickyboy

    #27
    Hey jazper,



    Here's what my Emacs setup looks like on my Windoze desktop at work.  (In the following "directory" means "folder" and vice versa, as usual.)



    1. I installed Emacs into my AppData/Local directory -- I too don't have admin privs at work. (However, you can install it anywhere.)  So precisely, I have a directory


    C:/Users/rick/AppData/Local/emacs-24.3
    that contains the distro's files (the ones in http://downloads.sourceforge.net/project/ntemacs/ntemacs/20120825/ntemacs24-bin-20120825.7z">the .7z distro file).  The directory listing looks like this.


    C:/Users/rick/AppData/Local/emacs-24.3/
        bin/
        etc/
        info/
        leim/
        lisp/
        site-lisp/
        BUGS
        COPYING
        README
        README.W32

    And I do NOT touch the contents of this directory -- anything I change is under my user (HOME) directory in the folder called .emacs.d.





    2.  Speaking of that, my Emacs user config is in the directory


    C:/Users/rick/.emacs.d
    The following listing shows what's in there.


    C:/Users/rick/.emacs.d/
        auto-save-list/
        newlisp-mode/
            newlisp.el
        init.el

    (BTW the folder auto-save-list is created and maintained by Emacs.  The rest -- newlisp-mode/newlisp.el and init.el are the files I created there.)
    QuoteIn the above directory listings, anything that ends in a slash (/) is a folder, and anything that is indented further than what's immediately above it at a lower indentation, means containment -- for instance, this:


    newlisp-mode/
        newlisp.el

    means that newlisp-mode is a directory that contains a file newlisp.el.  Hope that's clear.

    Now, the contents of your init.el file (in your .emacs.d directory) should be something like -- or exactly -- the following (which is copied from a previous posting, but I include here without the comments).


    (setq dotemacsdotd-dir (file-name-as-directory (expand-file-name "~/.emacs.d")))
    (column-number-mode t)
    (setq-default indent-tabs-mode nil)
    (global-font-lock-mode t)
    (add-to-list 'load-path
                     (file-name-as-directory
                      (concat dotemacsdotd-dir "newlisp-mode")))
    (require 'newlisp)
    (add-to-list 'auto-mode-alist '("\.lsp$" . newlisp-mode))
    (add-to-list 'interpreter-mode-alist '("newlisp" . newlisp-mode))

    And the contents of newlisp.el (in the .emacs.d/newlisp-mode directory) should be what's in this resource: http://www.newlisp.org/code/newlisp.el">http://www.newlisp.org/code/newlisp.el.





    3. Well, that's all I did as far as file setup (starting from in a clean system, i.e. no Emacs).  The only other config, outside of the files, is that I set up this environment variable:


    HOME = C:/Users/rick
       

    I believe Emacs wants to see this -- that's how it finds your .emacs.d directory.



    Also, you have probably already done this -- but just for the sake of completion -- I set the environment variable


    NEWLISPDIR = C:/Users/rick/AppData/Local/newlisp

    (Notice in the above that I also installed newLISP into AppData/Local.  Hehehe.) and I put newLISP's location (which is the same as the value of NEWLISPDIR) in my PATH.  Putting newLISP in your PATH is important because when newlisp-mode wants to start a newLISP session, it only uses the bare command "newlisp" to do it.



    If you have any error messages or problems beyond that, I'll be glad to help, but I just wanted to be sure that you have these fundamentals squared away.  So, go check your setup, make sure it's basically like this, and report back any exception messages you get after verifying/aligning your basic setup.  It will be easier to proceed with troubleshooting this way.



    (And you can PM me here if you prefer.)
    (λx. x x) (λx. x x)

    jazper

    #28
    @rickyboy, regret to say, I still haven'rt Emacs going with newLISP on Win 7.  I followed your instructions to the letter, even allowing for the renamed newlisp[-mode].el (which I tried with both names).  Perhaps it's because my .emacs.d file is on C:Usersme, but Emacs is in fact installed on C:.  



    I've gone through the .el files to ensure that all file names match, and the newlisp.el and init.el files as well, but it, as you say, drops me into debug with an error.

    jazper

    #29
    @rickyboy, sorry, I have confused things somewhat.  Ignore my last post: it appeared that last night's had not gone through, and then all of a sudden it appeared, along with your reply to last night's.  Thanks