Emacs without Lisp [closed] - emacs

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
Should I learn to use Emacs with no intention to learn Lisp, if my other option is to get familiar with vi?

Yes. With all the resources out there (FAQ, Emacs wiki, and the Stack Exchange Emacs site) and custom (M-x custom). You don't need to know Lisp. You just cut/paste what you find.
You can drive a Ferrari/Yugo without knowing the internals of the combustion engine or how a Formula One transmission works...

Why not?
You can still learn vi (probably Vim or Elvis).
You can learn jEdit. Or nano and Pico. Or whatever other editor, environment, and language-host you fancy.
Why put such an arbitrary restriction on things? While your Emacs experience will be better if you learn at least basic Emacs Lisp (a .. derelict .. Lisp implementation), it's not required. But at the end of the day, it's a tool. Get as many useful tools as you can. "Useful" also really depends on context.

I have used Emacs for several years with next to no knowledge of Lisp and it served me well for all of the projects I used it for.
You can always simply assume that the configuration you're writing is not in Emacs Lisp and that it is just some funny configuration format - there a lot stranger examples out there (such as Sendmail).
I should warn you though that once I started learning Emacs Lisp my Emacs mastery expanded extremely rapidly - now that I understand the details of the language I can easily bend any configuration to my needs and more importantly I started writing my own extension to Emacs, which add to it even more capabilities.
If you decided to start with Emacs, I recommend to read first this great book - it taught me a lot of things for Emacs at the beginning and it assumes no Lisp knowledge. It won't teach you any Lisp either. Afterwards my advice would be read the official Emacs manual and start exploring the Emacs Wiki and #emacs on Freenode.
Learning Emacs truly is a journey that is not for the faint of heart, but it is journey that is most certainly worth it...

Configuring Emacs is a journey, and it's something that you're going to want to do. Being able to customize your developing environment is one of Emacs' greatest strengths. It's almost unavoidable. You pick up bits and pieces just by looking at other people's .emacs files.
Knowing just a little bit of Lisp goes a long way in Emacs.

You don't need to learn Lisp to use Emacs. Even basic customization of Emacs works fine without Lisp knowledge. If you need something beyond your capabilities, there are many helpful Emacs users.
Learning a bit Emacs Lisp will later enhance your understanding of Emacs.
Emacs Lisp is a relatively simple Lisp dialect. Basic Emacs Lisp is not that difficult to learn. As an experienced Lisp user I have to say that Emacs is available quite some time and the users have written some amazing things in Emacs (like Org-mode). Some of the Emacs extensions are very very well written and it is a pleasure to read the code.

Well, if you don't want to customize your Emacs, you won't need Lisp, either. And you can also do some basic modifications using the build-in customize functionality and by copy&pasting code of others. But truth being: I have written several hundreds of lines of code to customize Emacs to suit my needs. On the other side, as far as I know, vi is not as customizable as Emacs, so in the end it is probably more about what editor you like more and you should try both.

I know little Lisp and use Emacs to edit my C and OCaml programs on Windows and Linux.

I've been using Emacs for a year and a half, and really only picked up whatever Emacs Lisp came without trying. I have a heavily extended set of configurations (first in a .emacs file, and now in ~/.emacs.d/init.el and friends), which are totally a result of cutting and pasting from the excellent resources found online.
Aside from, of course, the EmacsWiki, you should see the fine Emacs Starters Kit and subscribe to Planet Emacsen --- preferably in a feed reader. It's prettier.
Having said that, after you have a working setup you might yield to the temptation to learn a little Emacs Lisp. I've just started the free Introduction to Programming In Emacs Lisp, which comes with Emacs and is best read from within Emacs Info. It assumes neither programming ability nor Lisp knowledge, and is a friendly introduction to the 'vibe' of Emacs Lisp which I find to be well-written in the extreme, friendly and concise, and worth 10x every minute I have spent with it.

Related

Is it worth learning to use Emacs for web development

I have never used Emacs before and the first time I tried it I was so repulsed by its interface which seemed not very user friendly . But since then I have heard a lot about it improving productivity and this has rekindled my interest . But is it true for the case of web development as well? for the likes of php,python,javascript/jquery etc . How good are the code completion features?
Please suggest some resources to get me started in the right direction.
I'm a bit of a religious user when it comes to Emacs so please take this with a few bags of salt. I'll try to state my reasons for using Emacs (including for web development).
Emacs' primary strength is it's extensibility and the fact that at it's core, it's a lisp interpreter with a bunch of primitive functions useful for text editing and display. This makes it "programmable". You can customise it almost endlessly.
This has spurred a number of libraries which do (common) things like code completion, source code browsing, test harness integration, refactoring tool integration, version control integration etc. If a developer working on a project is an Emacs user, it's not uncommon to see her adding something to her project just to get it to work well with Emacs. The extensibility has also spurred a number of less that conventional libraries like mail clients, web browsers, IRC clients, music players etc.
Many Emacs users keep most of their work (except for maybe their browsers) inside Emacs. This allows them to use the same keystrokes and high level techniques for everything that they use. I myself use it for my daily coding, for my email, as my PIM and a bunch of other things. I can for example, while working on my code, just write something like "TBD" as a comment somewhere and let the PIM part remember this as a TODO item next time I open the editor. I can also for example while coding simply switch to another "buffer" (the emacs term for windows) with an IRC client and ask questions I might have to other people who are online. This makes me quite productive and quick. Also, the keystrokes are almost the same on a large number of command line UNIX programs (like my shell etc.) which helps me do my work faster.
Another advantage is that Emacs is old. People have tweaked and polished it endlessly and still do. The result is a set of commands for editing that I didn't even know that I needed. Things like "capitalise word" to make the first letter of the word my cursor is on upper case sounds trivial but while you're editing, it's quite useful.
Being extensible, Emacs has "modes". These are environments for specific programming languages. Indentation rules, syntaxes, completion etc. will change depending on the mode you're in. There are modes for almost all modern languages and they provide substantial help while editing. You have things for javascript, php etc. which help you while coding in those languages. There are also web specific tools (e.g. Emacs can talk to MozRepl so that you can refresh you browser and things while editing). People write modes all the time for what they want and it's not too hard. I recently started using jekyll to maintain my blog and wrote a mode to make my life easier). The modes add functionality but at a base level are the same (e.g. same keys to delete a character, move forward by a sentence etc.). I like this because I don't have to learn a whole new set of keys and get used to them just to code in another language.
That being said, Emacs is a tool for a different kind of developer. Most hardcore Emacs users (and there are quite a few famous ones out there) don't use many IDE type features. They usually like just a window (Without toolbars, menu bars and all that) so that the real estate for code is maximum. If you're used to leaning on a feature heavy IDE to do your work, Emacs might not be the right tool for you (I think this is what Trey meant in his comment). If however, you want a programmers editor that stays out of the way and let's you get your job done with minimum hassle, it's something you should definitely try out.
Okay, resources. The first thing to do is to start up Emacs and type Ctrl-h t. This gives you a "hands on" tutorial you can use to learn the editor basics. Once you're done with that, you can read the fine manual at http://www.gnu.org/software/emacs/manual/html_node/emacs/index.html. Once you're happy with that, you can read the Emacs lisp tutorial and start extending and customising Emacs as per your wishes. The EmacsWiki is a great place for tips, tricks and docs as is the Emacs IRC channel.
All the best!
If you don't like the interface, it's not worth it.
The question isn't is it worth learning Emacs, it is do you want to learn the interface?
If you do, then it's worth it. If you don't, then it's not.
More concretely, I'll answer your broad question with a series of links you could have gotten from the Emacs wiki:
http://www.emacswiki.org/emacs/JavaDevelopmentEnvironment
http://www.emacswiki.org/emacs/NxhtmlMode
http://www.emacswiki.org/emacs/HtmlMode
http://www.emacswiki.org/emacs/MuMaMo
http://www.emacswiki.org/emacs/PhpMode
http://www.emacswiki.org/emacs/php-completion.el
http://www.emacswiki.org/emacs/php-mode-improved.el
http://www.emacswiki.org/emacs/JavaScriptMode
http://www.emacswiki.org/emacs/FlymakeJavaScript
http://www.emacswiki.org/emacs/PythonMode
http://www.emacswiki.org/emacs/PythonProgrammingInEmacs
http://www.emacswiki.org/emacs/CategoryProgrammerUtils
Yes, people like using Emacs for web development. The above is just a sampling of modes people have written and use on a daily basis.
Is it for you? I don't know.
Is it better than editor X? or IDE Y? Yes for some things, no for others.
The code completion features are great! (unless they're not) It depends on what you want, what languages you're talking about, etc. etc. etc.
People use vi, people use Emacs, people use Notepad, people use all sorts of text editors.
Note: asking vague questions leads to vague answers.
The ultimate web programming mode is arguably nxhtml mode. You might start by taking a look at it. You might also want to check out some rich preexisting Emacs configurations like the Emacs Starter Kit or the Emacs Dev Kit.
The PHP & Python modes in Emacs are not particularly great, but are fairly decent. The JavaScript mode is certainly great. Packages such as autocomplete mode provide good completion almost everywhere.
I'm certainly biased, but I think that if you do spend some time exploring Emacs you'll find out that it will boost your productivity.
As some other posters have eluded to, it all depends on what you want out of it. If you want to feel as good about the customizations you've been able to get working in emacs as you do about the actual code that you write, then sure.. Emacs is great ;)
(Before anyone jumps down my throat, emacs is by far my favorite editor for 'nix C/C++ editing, but that's not what the OP's looking for here ;))
In my crusade to find the most productive editor for PHP, Python, Javascript etc, my favorite thus far has been Komodo Edit. It features not only code completion, but jump-to-definition (as well as many other features that a full-featured IDE should have) and is really the closest thing to Visual Studio for OS scripting development that I've seen. Oh, and it's free.
Honestly, braces against the rotten fruit/vegetables that will surely be thrown my way I've recently become a fan of the NetBeans IDE for web development. Particularly when It comes to PHP.
But to answer you question: It's only worth it if it's worth it to you. Sorry, vague questions get vague answers. ;)
If you're using an existing IDE that can do web development, than use the IDE. If not Emacs is worthwhile to learn as the text editor to go to for text editing or for programming in language that do not have a good IDE.

Scheme dialect of Lisp in Emacs [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How do I get the EMACS lisp interpreter use the Scheme dialect of LISP. I am going over the SICP book and am new to EMACS (just finished learning the navigation and file access commands)?
To do SICP, you should use an external scheme interpreter as Emacs Lisp is different from Scheme and no correct implementation of scheme has been created on top of Emacs Lisp. One other reason you should use an external scheme interpreter is for speed of execution.
The simple solution is to use PLT Scheme now called Racket :
Download and Install scheme from Racket site.
Then configure the variable scheme-program-name to the value mzscheme
Finally run the command run-scheme : it will run mzscheme process into a *scheme* buffer.
The *scheme* buffer use the inferior-scheme-mode major mode which defines the following keys :
C-c C-k scheme-compile-file
C-c C-l scheme-load-file
C-x C-e scheme-send-last-sexp
C-M-x scheme-send-definition
Jerome's answer is a good simple way to get started. If you plan on working through longer exercises in SICP, I strongly suggest installing Quack, which is an Emacs package that provides many useful features for formatting, editing, and running Scheme code. It's the de facto standard.
You'll still have to install your preferred dialect of Scheme (I also suggest Racket here) independently, and then use Emacs to communicate with it.
This page and this other page might help you with some other resources for setting up and using Emacs for this purpose.
You don't, at least not directly. What people generally do is spawn a scheme process and communicate directly with that.
See external-lisp documentation for how to do that, as well as the Emacs Wiki page for Scheme.
Ok, I was a little wrong, it looks as though a couple of people have written Scheme interpreters on top of Emacs Lisp (see the Wiki link above), though they are not fully featured Schemes.
You don't. GNU Emacs LISP is built into GNU Emacs, and much of GNU Emacs is written in GNU Emacs LISP. You can't change the built-in LISP interpreter without massively breaking Emacs.
GNU/MIT Scheme includes the Edwin editor, an Emacs-like editor written in Scheme. You might be able to use that instead of GNU Emacs.
The other guy's recommendation of spawing a scheme process and communicating with that seems like the better idea.
I found it was easiest to use MIT scheme in Emacs with M-x run-scheme - instructions for setting this up are here:
http://praveen.kumar.in/2011/03/06/gnu-emacs-and-mit-scheme-on-mac-os-x/

Looking for good Lisp code to read [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Examples of excellent Common Lisp code?
I'm currently trying to get proficient in Common Lisp and to learn some of the tricks for writing compact, clear and beautiful code in it.
So, I want to know if you have any sources of good Common Lisp, preferably free and online but books are also OK.
The most admirable modern Common Lisp I've seen is in Edi Weitz's libraries. (Look within the outline area NerdStuff/Common Lisp/Code available on this server.) His CL-PPCRE library is worth studying in depth.
Large codebases can be schizophrenic, because there are often many contributors to the project. I would also say that contributors tend to want to add new features rather than re-write some code because it could be coded in a slightly more elegant way.
Paul Graham is attributed with good coding style. The link points to pages where his coding style in ANSI Common Lisp is commented upon.
Peter Norvig has also written about good Lisp coding style here.
Practical Common Lisp
Complete book (HTML) is free.
http://www.gigamonkeys.com/book/
Most open source Common Lisp (CL) environments ship with a lot of CL source code.
Take a look at CMUCL, CLISP and SBCL.
Cliki (the Common Lisp Wiki) has many open source CL packages.
Google Code Search is another large repository of CL code. Setting the language to "Lisp" will return both CL and non-CL files, like Emacs Lisp (.el) files. To narrow the results, set the Files text box to .lisp$ so only file names that end in .lisp are returned.
Paradigms of AI Programming. The code is online, though the book itself is not to be missed.
On Lisp is also very fine.

Emacs exercises to become more comfortable and familiar with the editor itself as well as Lisp? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
There's a great project called the Ruby Koans, it's a series of tasks to exercise yourself in the Ruby language, stepping you through the standard library using the Ruby Unit Testing suite as a learning tool. It's a great project.
I'd love to see something similar for Emacs.
Can anyone recommend any Lisp exercises to be done inside of Emacs to both exercise Lisp and Emacs usage? Perhaps also while completing the Ruby Koans?
There used to be lesson in .el format (emacs lisp) at http://www.gnuvola.org/software/elisp-tutorial/.
You can find a copy of the tutorial here now.
I learned a lot from them. You read them in emacs in lisp interactive mode, and practice within the text.
The book, "Writing GNU Emacs Extensions", comes pretty close to what you're asking for.
But, if you don't want a book, there are three similar questions already in stackoverflow: What's the best way to learn lisp,
How to quickly get started at using and learning emacs, and Tips for learning elisp.
I don't know a "walk through" series that exists, but have found that the best way is to start thinking about little things you wish it did, and then trying to make it work (asking here helps). Even if Emacs already provides such functionality, you might find it more interesting to solve problems you want solved, rather than a bunch of throw-away lessons that hold little interest to you.
The The Little Schemer is a book of Lisp exercises. You need to be aware that some of them are impossible in Emacs Lisp, as it doesn't support closures.
It is also focused on teaching recursion to non-programmers, meaning that you won't cover the full range of Lisp statements (most exercises just use (cond ...) recursively.)
I really enjoyed it though.
A very old Oreilly book, Writing GNU Emacs Extensions, has some, if I remember correctly. You might also want to look at the "Emacs Lisp Intro" found in the info pages (you access them using M-x info.
Honestly, the best way to learn Emacs is to change the way you look at it. Don't look at is a text editor to be learned, but as an environment for writing text editors to be explored. Think to yourself: What did I always want in a text editor but never found in the editors that I have used? Set yourself about making it. You'll learn far more, more quickly, trying to make your "own" editor piece-by-piece than by trying to remember lessons learned from some loosely (if at all) linked exercises that have no context in a problem to be solved.
How is this one:
Write a simple program to open a particular file ("~/ekoans.txt") and select a random line from that text file, that is displayed to the user in a new temporary buffer. Call the function ekoan-random, and make it callable by the user.
The first few lines of ekoans.txt are:
Make ekoan-random open up a new file for you instead of a temporary buffer, and insert apropos header text in the new buffer.
Write an ekoan-sequential function that behaves like ekoan-random, except it works in sequential order
Make ekoan-sequential persist through a customization variable
Make the name of the koan file changeable by a customization variable
I call this Koan-strapping!

Resources for learning Emacs [duplicate]

This question already has answers here:
Good Resources For Emacs [closed]
(9 answers)
What to teach a beginner in Emacs? [closed]
(13 answers)
Closed 9 years ago.
I'd like to learn Emacs, and was wondering if anyone had any good resources (free or otherwise) to recommend. I'm mostly interested in programming Emacs, starting from the basics, and lots of "exercises". I have used Emacs and most of its editing features, although I'm a bit rusty so a very quick refresher on that would be useful as well.
Thanks
Edit: Thanks for the suggestions. I'll have a look and update with what I liked...
GNU Emacs manual
GNU Emacs lisp reference
emacswiki
Programming in Emacs Lisp (Second Edition) - free online book
One thing to bear in mind is that all emacs configuration is programming.
PlanetEmacsen is a good RSS feed with lots of tips.
Xah Lee although he is apparently considered a bad troll, has some great emacs programming stuff.
Also whenever there's a function or keyboard shortcut you're not sure of, try C-h f and C-h k respectively, then follow the link to the source code for that command.
For exercises, Lair of the DustBunny did a very long series on rewriting python mode from scratch.
You could also try writing the PLEAC elisp section. That's a very good way to compare elisp to your favourite language.
Emacs itself includes a tutorial with exercises that guides you through the basic features and editing commands. You can find it in the Menu under 'Help' or by pressing C-h t (i.e. press Control and 'h' together and then 't' alone).
Last week I purchased this Peepcode screencast and really liked it. It walks you through the basic features (editing, loading saving, buffers) but also dives into some advances topics, like programming emacs lisp:
http://peepcode.com/products/meet-emacs
Definitely the best book about Emacs is Bob Glickstein's "Writing GNU Emacs Extensions".
Really informative. Really good examples. And, for a technical book a pleasure to read. It is one of the best computer books I have. (Thereunder are such treasures like my "VIC-20 Technical Manual" from 1982 :-)
Some PDFs are available online, but for the full fun I suggest purchasing a hard-copy.
Emacs's own help system is your friend --- ask Emacs. Learn the main C-h keys and apropos.
These too can help:
http://www.emacswiki.org/emacs/HelpPlus
http://www.emacswiki.org/emacs/EmacsNewbieWithIcicles