Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Catalyst-proof
May 11, 2011

better waste some time with you
code:

      ..      .                                                  .x+=:.   
   x88f` `..x88. .>                                             z`    ^%  
 :8888   xf`*8888%     ..    .     :                               .   <k 
:8888f .888  `"`     .888: x888  x888.        u           .      .@8Ned8" 
88888' X8888. >"8x  ~`8888~'888X`?888f`    us888u.   .udR88N   .@^%8888"  
88888  ?88888< 888>   X888  888X '888>  .@88 "8888" <888'888k x88:  `)8b. 
88888   "88888 "8%    X888  888X '888>  9888  9888  9888 'Y"  8888N=*8888 
88888 '  `8888>       X888  888X '888>  9888  9888  9888       %8"    R88 
`8888> %  X88!        X888  888X '888>  9888  9888  9888        @8Wou 9%  
 `888X  `~""`   :    "*88%""*88" '888!` 9888  9888  ?8888u../ .888888P`   
   "88k.      .~       `~    "    `"`   "888*""888"  "8888P'  `   ^"F     
     `""*==~~`                           ^Y"   ^Y'     "P'                

What is Emacs?

Well, that's kind of a difficult question to answer. No answer anyone gives will be the complete one -- or even the right one -- because Emacs is a lot of things to a lot of people.

So let me give you my definition. Emacs is a layer over your operating system that allows you to work in a consistent, unified, inter-connected manner -- and a piece of software which contains the curious property that you can continually improve it, and use those improvements to continue improving it. It is a technological singularity in and of itself.

Emacs isn't just an improvement to how you edit text -- be it for screenplays, source code, or scientific papers. Emacs is an improvement to how you improve.

What is Emacs fundamentally? That's a bit easier. Emacs is a text editor that exposes its internals. This allows you to modify how it works to fit your needs, and extend it when it doesn't fit your needs. These improvements are made in Emacs Lisp, a decent programming language that revolves around the modification of text in places called buffers. The layman may mistake buffers as files in a word processor, or tabs in a web browser: simply a means to collect content in one place. But buffers are blank slates -- you can do whatever you need to in them, and modes allow you to change the behavior of your input in that buffer.

The Most Important Part

The most important part about Emacs, overarching anything you may have possibly heard about it, is that it is self-documenting. What this means is that all of its possible behavior is exposed to you in such a way that you can understand it, be it a manual, or the source code itself. It also means that you can learn the name of anything you can do, even if you don't know you want to do it yet. It also means you can find out what will happen if you do anything.

This is all rather nebulous, could you give me something concrete?

Sure. Download Emacs from your friendly package manager (apt-get install emacs on Ubuntu and Debian, brew install emacs from Homebrew on OS X, search the internet for Windows.

The globally accessible chord for learning about Emacs is C-h. Hit it twice to see all the available help options. Hit C-h t to start a tutorial.

Wait, what the gently caress? What's a chord?

A chord (though not a widely used term) is still the best way to describe entering commands in Emacs. They're not keyboard shortcuts, they're chords. Entering a chord doesn't necessarily mean something happens. Another chord may be required to actually perform an action. For example, the universal version control chord in Emacs is C-x v -- which means holding down the Ctrl key, pressing 'x', releasing both, and pressing 'v'. But all that does is give you access to another set of chords: pressing 'g' after the fact shows you a blame. Pressing 'v' does the next logical action, like adding a file to source control or commiting the existing changes. Therefore, the total chord to do the next logical action is C-x v v.

I am overwhelmed!

You shouldn't be. Most Emacs zealots start proselytizing the wrong way, describing all the wonderful things you can do in it, showing off their extensions and customizations. That belies a necessary truth: that none of us knew how to do any of that off the bad. You road to Emacs enlightenment starts with learning how Emacs itself works, and then applying that knowledge to the things you wish to do.

Don't download any starter kits! I'm serious. The crap you find online is, just like it says on the tin, usually crap. Customizing Emacs is like building a lightsaber: the meaning is in doing it yourself. You'll find the things that you need to change, and you'll learn how to do it, and in doing so, will improve how you do everything in Emacs -- which, if you're like me, includes quite a lot.

Well, are there any standouts?

Yes. Working in Python in Emacs is a joy due to great modes, on-the-fly pep8 and pylint checking, ipython support, and a debugger that works with open files to point out your current breakpoint.

Org mode is something special, a set of tools that you can use to create your perfect scheduling, e-mailing, todo-list making, agenda aggregating, blog writing juggernaut. I work in it extensively.

If you work in LaTeX, auctex is miraculous. It can render parts of your paper inline so you can see how they'll look.

So, what's this thread for?

It's for getting people on the right track to Emacs, and for users to discuss their awesome setups, idioms, and stories.

And it starts now!

Catalyst-proof fucked around with this message at 22:15 on Oct 7, 2011

Adbot
ADBOT LOVES YOU

Catalyst-proof
May 11, 2011

better waste some time with you
Where do I start?

Start with the tutorial I mentioned above. It may be a bit underwhelming but it's important you start learning how to operate Emacs before you learn how to do what it is you want to do. Once you get there, come back to the thread, ask a question, and we'll see what direction you need to go in.

Some useful information

Emacs 24 is the current version of Emacs in development. I am using the HEAD release of Emacs 24 to no disadvantage.

Emacs provides fantastic utilities out of the box for:

* Editing files (even on other computers
* Navigating directories (even on other computers)
* Writing in nearly any programming language under the sun
* Reading e-mail
* Input completion in drat nearly every aspect of Emacs
* Tiled window management

and countless many more.

Emacs 24 adds package management to this list, making it easier than ever to extend Emacs to do the things you want. If you are using Emacs 24, make sure to add the Marmalade repo to your list of available repositories. It contains a lot more packages than the GNU package server, and allows you to upload your own.

Don't use Emacs until you map Caps Lock to Control!

Seriously. when was the last time you needed Caps Lock? This will prevent a lot of pain and agony known as 'Emacs pinky' in the future.

How do I use all this self-documentation stuff?

Use C-h. The following characters, after it, will do the following things:

* a will enter apropos mode, which means you can type in any part of a variable name, function name, or any other symbol in Emacs, and get its definition.

* m will enter mode help, which shows you the available interesting chords in the current buffer you are in.

* k will enter chord help. It expects another key command immediately after the chord, and it will tell you what that chord does in the buffer you are in.

* i will enter info mode, an interface to your system's Info pages, including (typically) the entire manual for Emacs, and a primer and full reference to Emacs Lisp, the language used to extend Emacs.

Where do I start?

Start with the tutorial I mentioned above. It may be a bit underwhelming but it's important you start learning how to operate Emacs before you learn how to do what it is you want to do. Once you get there, come back to the thread, ask a question, and we'll see what direction you need to go in.

Where can I learn more?

As above, you can learn more about Emacs from using Emacs and activating its help system. If you want a friendlier approach, I've heard good things about Meet Emacs, though a video-cast and costs 12 dollars to view. I am not affiliated with Peepcode, I've never even seen the thing myself.

Well I'm not paying 12 bucks to learn an editor. What else?

Steve Yegge has written some pretty good posts about Emacs, including (in increasing order of difficulty):

* http://sites.google.com/site/steveyegge2/my-dot-emacs-file
* http://steve-yegge.blogspot.com/2008/01/emergency-elisp.html
* http://sites.google.com/site/steveyegge2/effective-emacs

For a kind of long-winded primer about Lisp, see: http://www.defmacro.org/ramblings/lisp.html

I'm looking for some specific feature for a language!

Notorious b.s.d. posted:

There are a ton of these projects to talk down a pipe to a language-specific process. They're usually minor modes, rather than major modes. SLIME is an exception to that rule, if i recall correctly

For example, in ruby, there is a major mode to handle syntax highlighting and indentation (enh-ruby-mode), then a minor mode (robe-mode) to talk down a pipe to get completion and code re-loading and so on.

You should always be using the major mode for every language -- there's pretty much no cost/effort. The minor modes are more effort to set up, but they get you more IDE-like features: code analysis, completion, refactoring

The ones I use on a regular basis:
  • Ruby

    enh-ruby-mode -- major
    robe-mode -- minor

  • Perl

    cperl-mode -- major, built into emacs
    Sadly, I don't have a minor mode to provide perl reflection.

  • Scala

    scala-mode2 -- major
    ensime -- minor

  • Java. There are lots of options for java, but this is what I use.

    java-mode -- major, built into emacs
    eclim -- minor


Awesome contributions from other posters

vlack posted:

Addendum: If you're new to Emacs and you keep hearing about how it's got an email client and a web browser, some caution. Those things won't replace Safari and Mail (or whatever you use) for anything approaching "normal use". If youre curmudeony enough to be able to stomach using Emacs as your MUA, you're probably already doing it. Even jwz doesn't read his email in Emacs anymore. If you're aware of all this and want to experiment, then do so by all means... just don't expect GNUS to be a drop-in Gmail replacement. Like. At all.

OTOH if you're way beyond this and just can't get enough Emacs, I recommend checking out conkeror. It's a browser based on Mozilla XULRunner, which means you get fancy new features like JAVASCRIPT and even BROWSER PLUGINS (unlike emacs-w3m), in a mostly Emacs friendly way. I've tried it several times and I think it's just not for me, but it's at least a step in the right direction. (Unlike, IMO, emacs-w3m.) You might also be interested in stumpwm, which is an X11 window manager written in Lisp in an Emacsy way with an Emacsy UI. When I tried it last, it was pretty nice, but I don't run Linux on the desktop any more so I never use it.

Comedy option: Don't do any of that but instead use SXEmacs. In addition to being a mail and IRC client, SXEmacs can also be your X11 window manager and login shell! (Though apparently not at the same time; "We wouldn't recommend trying to run an X session from it" as your shell.) Terrifying.


Fake edit: also, I have had caps lock mapped to control for years and I have some serious Emacs pinky right now (for the first time in my life). It loving sucks.

Real edit: some binaries links for the OP, if you want them:

On Windows, I used to get them from here. These binaries work, but they're old. They are the only ones to come with a workable installer. If you're brand new, you should probably start here... just click the "Download latest EmacsW32+Emacs patched" button from the download page. If you want Emacs24, you'll have to get it without the installer (which does stuff like register file associations and such) from the official alpha builds distribution point.

On Mac OS X the situation is all so much simpler. You can get some good pre-built packages from https://emacsformacosx.com, including pretest releases such as for Emacs24 from the builds page. (The brew install method may also work very well, I've just never used it for Emacs.)

Catalyst-proof fucked around with this message at 12:06 on Feb 16, 2015

hey mom its 420
May 12, 2007

I use vim but I just wanted to say that's a cool avatar.

Scaevolus
Apr 16, 2007

Can emacs wrap lines?
This is crucial for my own
programming needs. Thanks.

Scaevolus fucked around with this message at 23:26 on Sep 30, 2011

Catalyst-proof
May 11, 2011

better waste some time with you

Bonus posted:

I use vim but I just wanted to say that's a cool avatar.

Thanks it's from Interplays Lord of the Rings, the game that lets you be a horse

Catalyst-proof
May 11, 2011

better waste some time with you
quote not edit

comedyblissoption
Mar 15, 2006

Scaevolus posted:

Can emacs wrap lines?
This is crucial for my own
programming needs. Thanks.
M-x visual-lines-mode

M-x toggle-truncate-lines if you want lines to not wrap

Your Computer
Oct 3, 2008




Grimey Drawer
Disclaimer: This applies just as much to vim, I'm just posting it here since it's a relevant thread.

What makes these text editors better than an IDE? I guess I'm very "new-school" with how I program, but I wouldn't want to switch over to something that does not have autocomplete, method-lookups, auto-import and other niceties such as browsing project folders by the click of a mouse and copy-pasting code between files/projects. I get that they're more portable than an IDE, but I only have one workstation so that's not a very strong point to me. To me these text editors feel more like a cult in which members embrace an obsolete technology. I mean, haven't we since invented graphic displays and mice?

Pardon my ignorance, I honestly want to know what's great about these!

TasteMyHouse
Dec 21, 2006

Your Computer posted:

Disclaimer: This applies just as much to vim, I'm just posting it here since it's a relevant thread.

What makes these text editors better than an IDE? I guess I'm very "new-school" with how I program, but I wouldn't want to switch over to something that does not have autocomplete, method-lookups, auto-import and other niceties such as browsing project folders by the click of a mouse and copy-pasting code between files/projects. I get that they're more portable than an IDE, but I only have one workstation so that's not a very strong point to me. To me these text editors feel more like a cult in which members embrace an obsolete technology. I mean, haven't we since invented graphic displays and mice?

Pardon my ignorance, I honestly want to know what's great about these!

You can easily configure Vim and emacs to have autocomplete. I find moving between files and copy / pasting stuff 500x easier in Vim than in the built in Visual Studio editor. The first thing I do with a fresh Visual Studio install is install VSVim.

These tools are not at all obsolete. In many respects, they are far superior to IDE-based tools.

Note: I am reading this thread to learn about emacs as I am utterly inexperienced with it, hence speaking of Vim above.


e: to summarize what I like about Vim in one quick bite: Every time you use a mouse you're wasting time, and Vim is optimized to never require touching your mouse.

text editor
Jan 8, 2007

Your Computer posted:

Disclaimer: This applies just as much to vim, I'm just posting it here since it's a relevant thread.

What makes these text editors better than an IDE? I guess I'm very "new-school" with how I program, but I wouldn't want to switch over to something that does not have autocomplete, method-lookups, auto-import and other niceties such as browsing project folders by the click of a mouse and copy-pasting code between files/projects. I get that they're more portable than an IDE, but I only have one workstation so that's not a very strong point to me. To me these text editors feel more like a cult in which members embrace an obsolete technology. I mean, haven't we since invented graphic displays and mice?

Pardon my ignorance, I honestly want to know what's great about these!

For a lot of people, being able to never leave the keyboard for anything increases their development speed. VI/VIM and Emacs are both, in a lot of cases, available everywhere, and can be pretty easily put onto headless servers - making code editing on remote machines tons easier than using an IDE. Also, at least for me, I love that I can drop to a command line at any time by just a few keystrokes as well.

I honestly don't know anything about Emacs besides a general idea how key combinations work, since I've used tiling window managers in the past.

Zombywuf
Mar 29, 2008

comedyblissoption posted:

M-x visual-lines-mode

M-x toggle-truncate-lines if you want lines to not wrap

Real men M-q :colbert:

Your Computer posted:

What makes these text editors better than an IDE? I guess I'm very "new-school" with how I program, but I wouldn't want to switch over to something that does not have autocomplete, method-lookups, auto-import and other niceties such as browsing project folders by the click of a mouse and copy-pasting code between files/projects. I get that they're more portable than an IDE, but I only have one workstation so that's not a very strong point to me. To me these text editors feel more like a cult in which members embrace an obsolete technology. I mean, haven't we since invented graphic displays and mice?

Well, for a start there's CEDET, which if it were finished would be amazing. It's a touch buggy at the moment but it knocks every IDE I've used into a cocked hat. As for autocomplete, what you really want is dabbrev-expand, not having it for me is like being down a limb. I don't miss intellisense and it's code obscuring key grabbing nonsense at all. For project navigation ido is about a bajillion times faster at navigating your project as files than the IDE based hunting through a giant treeview nonsense.

Also, mice are older than Emacs IIRC, they are a terrible mistake in the development of computer interaction.

So yes, there are some things that "modern" IDE's do better than these obsolete text editors, but I just don't miss those features at all. I do miss dabbrev-expand and spell checking comments (flyspell-prog-mode) and strings when not using emacs. Not having to switch tools when editing python files and sql files is also great.

It does take a long time to learn how to use emacs well though. The best way is to pair with a more experienced user if you can find one. You will also be disadvantaged if you're using a language that has terrible deficiencies that can only be overcome by tools.

Your Computer
Oct 3, 2008




Grimey Drawer

Zombywuf posted:

You will also be disadvantaged if you're using a language that has terrible deficiencies that can only be overcome by tools.

I mostly program in Java using Netbeans :downsgun:

Another question; I've never actually tried emacs, though I've dabbled in vim. Are there any good* reasons why emacs is better? As I said I mostly program in Java, though I also use Python frequently. I get from what you've said that emacs is good for Python? Also important: colorschemes. Need me some nice zenburnish colors.



*For my use

e: I'm one of those people who program in Java using an IDE on Windows. Should I even bother with stuff like vim and emacs?

Your Computer fucked around with this message at 01:00 on Oct 2, 2011

Zombywuf
Mar 29, 2008

Your Computer posted:

I mostly program in Java using Netbeans :downsgun:

Goondolances.

quote:

Another question; I've never actually tried emacs, though I've dabbled in vim. Are there any good* reasons why emacs is better?

org-mode

quote:

e: I'm one of those people who program in Java using an IDE on Windows. Should I even bother with stuff like vim and emacs?

Yes, org-mode. I tend not to use it much because I'm terribly disorganised. But it is still amazing.

Here's a video about it http://orgmode.org/talks/GoogleTech.html

Catalyst-proof
May 11, 2011

better waste some time with you
The main reason to start learning Emacs coming from other editors is that once you discover "Does Emacs do X", and you stop doing X, you can keep using Emacs to do other things. For example, I could quit my job writing software and never program again, and I will still use orgmode and check my email and chat with people in Emacs. And I don't need to learn anything new, jumping from doing X to doing Y. Emacs will probably do fine doing Y, whatever Y is, even if I stop doing X.

shrughes
Oct 11, 2008

(call/cc call/cc)
Emacs is great if all you want is to play a lovely tetris game, run a lovely IRC client, and work in a lovely IDE. MS Visual C++ is way better for developing C/C++/C# apps than Emacs is.

Good things about Emacs: it has modes for obscure programming language indentations that no other editor has. It is probably the best editor for Haskell. It is a better general purpose text editor than anything else (for small files). It has a better interface for choosing your file from a directory than anything else. You can configure the gently caress out of it. You can write programs that access the internet with it. It's pretty good for opening PDFs and PNGs. You can get rid of the scroll bar and menu bar and poo poo gets out of your way. I used to have a Hacker News emacs mode as a toy. I think others exist for the same purpose. You can use it on Windows.

Weird things about Emacs: When it tries to do I/O and gets EINTR, it reports this fact back to the user. It's better for Dvorak users than Qwerty users. Here is my dot-emacs file: http://forums.somethingawful.com/showthread.php?threadid=3440468&pagenumber=1#post396103655

comedyblissoption
Mar 15, 2006

Emacs/VIM have much better and quicker searching, editing, and navigation of text than typically popular IDEs. Even though text editing is a principle element of programming, editing and navigating text in typical IDEs seems almost like an afterthought in comparison to EMACs/VIM. Even if you ignore glaringly missing text editing features from those IDEs, just the little things for even the basic functions are done better and all add up.

Zombywuf mentioned dabbrev-expand as being critical to him. It is a function in emacs binded to M-/ by default that expands your currently typed text to a matching text across all your open buffers. You can repeatedly press it for different matches, and it tells you what buffers it is expanding from.

Split screens and windows are very easy to set up and each split screen can have its own mode.

Emacs has keyboard macros and the editor itself is extensible on the fly. All your customizations can be saved and loaded through a single file for portability.

I consider one of the greatest features in Emacs is that virtually everything is unified together in text buffers. You are not prevented from using the text editing and searching capabilities on any buffer window simply because it is a modal dialog or GUI widget.

I think Steve Yegge put it pretty well why certain GUI conventions are so ridiculous:

quote:

[Dialog Boxes: The Root of All Evil

Emacs is an incredibly powerful editor, but a few design choices in particular really stand out as being the biggest individual contributors. One of them is the fact that Emacs has no dialog boxes. This was actually a requirement in order to give Emacs its full functionality while running in a text-only terminal window. But by happy accident, it's also one of the key features that helps make Emacs so insanely powerful.

Dialog boxes suck. For starters, they always have focus issues, and often cause poorly-designed applications to lock up or fail to refresh while the dialog is open. And dialog boxes never seem to play along with any customizations to your video mode. For example, if you set up a dual-monitor display using 2 cards, the application dialogs in Windows will tend to pop up in the wrong window, making the whole experience a really annoying pain in the rear end.

Dialogs sometimes come up in unpredictable places even on single-monitor machines. And even in well-designed applications like the Microsoft Office suite, modal dialogs can still wind up buried behind a bunch of other windows on your screen, which makes the application seem like it's totally unresponsive until you find the rogue dialog and bring it to the front.

For some strange reason, dialog boxes are often non-resizable. It's the opposite for application windows: those are almost always resizable, and app designers usually take great pains to make the UI rearrange to fill the space nicely if you resize the window. But with dialogs, the default seems to be non-resizable, possibly because on most OSes, dialogs are a screwed-up hack that was added on long after the window manager was designed without dialogs in mind. (Guess how I know this.) Hell, they're even a mess in Java Swing.

And don't get me started on the buttons. We've had dialog boxes in GUIs for at least 25 years, but people still can't agree on a standard set of buttons for them, or even a standard place to put the buttons. Some dialogs put them in the title bar, some on the bottom, some on the right side. And it's rarely 100% clear what will happen if you use the Window controls in the title bar to close a dialog, bypassing its button choices. The whole experience is a giant crap sandwich, and everyone knows it intuitively, but it's just how everyone assumes things have to be.

But the problem with dialog boxes goes even deeper than the focus, sizing and positioning problems. Dialogs are never, ever full peers of the rest of the application UI. If you define any keyboard macros (not just in Emacs -- in any app, such as Excel or Word), they won't work in dialog boxes. If the dialog has a scrollable widget, you have no options for navigating other than by using the scrollbar.

To illustrate, fire up Internet Explorer and choose Internet Options from the Tools menu. Go to the Advanced tab. There they are: all your pathetic global customization options for IE. If you want to find a particular option, you have to scroll slowly, looking for it. You can't use Edit/Find because the dialog is, of course, modal. And the dialog is, of course, also non-resizable. Most dialogs are like this.

The criminal thing is that this problem is not necessarily even an inherent problem with GUIs. The designers of the GUIs are the culprits here by creating an intentionally constrained implementation of many features.

Zombywuf
Mar 29, 2008

shrughes posted:

Good things about Emacs: it has modes for obscure programming language indentations that no other editor has. It is probably the best editor for Haskell. It is a better general purpose text editor than anything else (for small files).

I assume by small you mean less than several copies of War and Peace in size?

Also worthy of mention, nxml-mode is pretty great for editing XML files.

comedyblissoption posted:

I consider one of the greatest features in Emacs is that virtually everything is unified together in text buffers. You are not prevented from using the text editing and searching capabilities on any buffer window simply because it is a modal dialog or GUI widget.

Oh yeah, being able to search your compiler output, help text, REPL sessions, etc... using exactly the same bindings as everywhere else is excellent. Incremental search (C-s) is simply the best way to search.

Another fun thing is the number of places emacs bindings turn up, Bash for example and text entry widgets on the Mac.

shrughes
Oct 11, 2008

(call/cc call/cc)

Zombywuf posted:

I assume by small you mean less than several copies of War and Peace in size?

No, by small I mean smaller than a typical log file.

Zombywuf
Mar 29, 2008

shrughes posted:

No, by small I mean smaller than a typical log file.

I wonder how typical your log files are. I don't find any problems under 10M and anything under 100M is still usable. Once you get beyond that you're pushing it though. I don't edit my logs that often though and when you get up to GB log files you should probably not be trying to read them by hand.

shrughes
Oct 11, 2008

(call/cc call/cc)

Zombywuf posted:

I don't find any problems under 10M and anything under 100M is still usable. Once you get beyond that you're pushing it though. I don't edit my logs that often though and when you get up to GB log files you should probably not be trying to read them by hand.

So much for the power of incremental search.

Catalyst-proof
May 11, 2011

better waste some time with you

shrughes posted:

Emacs is great if all you want is to play a lovely tetris game, run a lovely IRC client, and work in a lovely IDE. MS Visual C++ is way better for developing C/C++/C# apps than Emacs is.

great, thanks, we've all seen the light, what were we thinking. your job is done, you can leave

Your Computer posted:

I mostly program in Java using Netbeans :downsgun:

Another question; I've never actually tried emacs, though I've dabbled in vim. Are there any good* reasons why emacs is better? As I said I mostly program in Java, though I also use Python frequently. I get from what you've said that emacs is good for Python? Also important: colorschemes. Need me some nice zenburnish colors.

*For my use

e: I'm one of those people who program in Java using an IDE on Windows. Should I even bother with stuff like vim and emacs?

Here's some screenshots showing how I work in Emacs with Python.



Using flymake to run pep8 and pylint on code and point out errors.



Using ido to jump quickly from method to method using incremental search.



Hitting C-c to execute the current Python block in a shell, making it available for use.

There are some other things like completion, and live information on debug position, but I don't use those as much. This seems to be a reasonable guide to getting some of those other things working, but it's over a year old, and some of these things may be easier/harder to do, or be done in different ways.

EDIT: Oh yes, and Zenburn :-)

Catalyst-proof fucked around with this message at 14:55 on Oct 2, 2011

Zombywuf
Mar 29, 2008

Fren posted:



Using ido to jump quickly from method to method using incremental search.

I haven't seen this one, how's it done?

nm, seems to be from here http://nflath.com/2009/09/emacs-fixes/

Zombywuf fucked around with this message at 16:17 on Oct 2, 2011

Catalyst-proof
May 11, 2011

better waste some time with you

Zombywuf posted:

I haven't seen this one, how's it done?

nm, seems to be from here http://nflath.com/2009/09/emacs-fixes/

Here's how I'm doing it on my system. I should add that while I can't guarantee any of my code works in < Emacs 24, this should be fine in 23. https://gist.github.com/1257532

Catalyst-proof fucked around with this message at 03:11 on Oct 3, 2011

Zombywuf
Mar 29, 2008

Fren posted:

Here's how I'm doing it on my system. I should add that while I can't
guarantee any of my code works in < Emacs 24, this should be fine in
23. https://gist.github.com/1257532

I had to make a small change to the code in that blog post which was possibly Emacs 23 related. It's a drat sexy thing.

Now I wonder if I can make it follow imports...

PleasantDilemma
Dec 5, 2006

The Last Hope for Peace
emacs is pretty drat awesome. I tried to learn vim but I kept getting confused about what mode I was in. The extensibility of emacs is inspiring. You can customize it to do anything.

I'm very much a emacs newbie, so I'll have plenty of questions for this thread. My first one is about using the shell in emacs. I've been using eshell over the normal M-x shell because it remembers past commands, but eshell doesn't support aliases. Is there a way to do that in eshell or is there a better shell I can use within emacs?

Also, it seems I can only have one instance of eshell running at a time, is there a way around that? On my school accounts I can't use screen, ortherwise I'd use that for all my cool multitasking stuff.

Catalyst-proof
May 11, 2011

better waste some time with you

PlesantDilemma posted:

emacs is pretty drat awesome. I tried to learn vim but I kept getting confused about what mode I was in. The extensibility of emacs is inspiring. You can customize it to do anything.

I'm very much a emacs newbie, so I'll have plenty of questions for this thread. My first one is about using the shell in emacs. I've been using eshell over the normal M-x shell because it remembers past commands, but eshell doesn't support aliases. Is there a way to do that in eshell or is there a better shell I can use within emacs?

Also, it seems I can only have one instance of eshell running at a time, is there a way around that? On my school accounts I can't use screen, ortherwise I'd use that for all my cool multitasking stuff.

Right off the bat: the shell situation in Emacs is unfortunate, simply because there's no one solution for everybody's needs. You may want to look at what other shells are available: ansi-term and nterm. If you want to use your shell's history ansi-term might be the best choice for you, until you find something else that doesn't work. It's a vicious cycle.

It appears you can't open multiple eshells because every time you try Emacs checks to see if you already have a buffer called *eshell* and just redirects you to it. The best way around this is to use M-x rename-buffer to give one shell one name, then call eshell again.

There also appears to be this, a small library to dynamically manage that pesky renaming for you: http://www.cims.nyu.edu/~stucchio/software/elisp/multi-eshell.el.html

EDIT: I should add that a competent shell configuration does wonders to smooth over the rough patches between Emacs's terminal modes. I'm using the grml config for zsh (grml is a linux live-CD known for their kickass zsh configuration and precious little else) and it contains logic to check the $TERM variable for things it understands. In this case, you can set your $TERM variable to "dumb", and the grml config will disable some conflicting features.

Catalyst-proof fucked around with this message at 03:13 on Oct 3, 2011

tripwire
Nov 19, 2004

        ghost flow
Why do
you keep
writing
your
posts
this way?

Catalyst-proof
May 11, 2011

better waste some time with you

tripwire posted:

Why do
you keep
writing
your
posts
this way?

Up until just now, emacs-w3m was wrapping input in text areas to 80 columns, which meant that lines of text with bbcode got even shorter to accomodate the characters making up the tags. It should be fixed now.

That Turkey Story
Mar 30, 2003

Fren posted:

Up until just now, emacs-w3m was wrapping input in text areas to 80 columns, which meant that lines of text with bbcode got even shorter to accomodate the characters making up the tags. It should be fixed now.

I can't help but laugh at this.

Catalyst-proof
May 11, 2011

better waste some time with you
I'm not enough of a sperg to browse in Emacs regularly; it was just something I was trying for this thread, so I hadn't played with any of the options. I'll go back and fix it so it doesn't bother anyone else.

oRenj9
Aug 3, 2004

Who loves oRenj soda?!?
College Slice

Fren posted:

I'm not enough of a sperg to browse in Emacs regularly; it was just something I was trying for this thread, so I hadn't played with any of the options. I'll go back and fix it so it doesn't bother anyone else.

Honestly, I thought it made for a very appropriate opening thread on the subject; I'm sad to see it go.

PleasantDilemma
Dec 5, 2006

The Last Hope for Peace
So whats a good way to sync up my configuration across various computers? I've got a windows laptop that I use emacs on, a school account that I ssh into, and another class is suppose to set me up with another ssh account whenever the professor gets his act together. I'm not the most experienced guy on the command line so I was thinking of putting a config that I like on a webserver and have a little script wget it and move it to the proper place for .emacs to be. Maybe you experts know of something better?

Also, for other people new to emacs, I've watched a few of the videos by rpdillon on youtube, he has several screencasts with some nice explanations. This one about setting up multiple little windows convinced me that emacs is powerful enough to spend the time to learn instead of sitting around in nano all day.

Your Computer
Oct 3, 2008




Grimey Drawer
I just remembered another very relevant question to this thread; One thing that has hindered me in getting to learn these editors in the past has been keyboard layout. They seem, as many old/ancient computer technologies, very US-centric. I'm using a Norwegian keyboard which has pretty much none of the symbols in the same places as the American keyboards which makes some key combinations very awkward (such as brackets being shift-8/shift-9). Is there any way to make this more international-friendly?

shrughes
Oct 11, 2008

(call/cc call/cc)
Brackets are shift--/shift-= on my keyboard layout, and I deliberately switched to it away from Qwerty.

molinari
May 13, 2005

Your Computer posted:

I just remembered another very relevant question to this thread; One thing that has hindered me in getting to learn these editors in the past has been keyboard layout. They seem, as many old/ancient computer technologies, very US-centric. I'm using a Norwegian keyboard which has pretty much none of the symbols in the same places as the American keyboards which makes some key combinations very awkward (such as brackets being shift-8/shift-9). Is there any way to make this more international-friendly?

Without going through and remapping every action, not that I know of.

I switched away from Norwegian layout to "US International" layout some years ago. Whenever I write Norwegian I just use AltGr+z for æ, AltGr+l for ø, and AltGr+w for å. (This is on Windows, it's different on OSX and Linux).

Catalyst-proof
May 11, 2011

better waste some time with you

PlesantDilemma posted:

So whats a good way to sync up my configuration across various computers? I've got a windows laptop that I use emacs on, a school account that I ssh into, and another class is suppose to set me up with another ssh account whenever the professor gets his act together. I'm not the most experienced guy on the command line so I was thinking of putting a config that I like on a webserver and have a little script wget it and move it to the proper place for .emacs to be. Maybe you experts know of something better?

What most people appear to be doing is saving their configuration in source control, typically on GitHub. This allows them to pull down their configuration on each machine, update it and recommit it, and distribute those changes.

The other thing is that you can use Emacs to separate out parts of your configuration depending on the machine that you're on, based on its operating system and name.

code:
(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))

(setq custom-file (concat dotfiles-dir "custom/" system-name ".el"))
(setq per-machine-config-file (concat dotfiles-dir "config/per-machine/" system-name ".el"))

(load custom-file 'noerror)

(if (file-exists-p per-machine-config-file)
    (load per-machine-config-file))
What this does is ensure any settings saved within Emacs's customization system automatically get saved to and loaded from ~/.emacs.d/custom/<name-of-that-computer>.el, and I can manually place other runtime settings or function definitions in ~/.emacs.d/config/per-machine/<name-of-that-computer>.el.

I have something similar for per-OS configuration:

code:
(let ((func-name (intern (concat "system-specific-" (symbol-name system-type)))))
  (if (fboundp func-name)
      (funcall func-name)))
What this does is execute a function by name if it exists, and it creates the name by appending the system-type variable to the string "system-specific-". Thus, if before this form I have a function called system-specific-darwin, then this will call that function on every machine I have running OS X.

Catalyst-proof
May 11, 2011

better waste some time with you
If you're on OS X Lion, smooth-scroll is a godsend. Make scrolling with the trackpad so much better. I should also add that any Emacs Lisp code you find on the Emacswiki (as smooth-scroll is) can be installed with auto-install. It also does installs from any URL, or any GitHub Gist.

Emperor Cezar
Aug 6, 2007
This is believeable if you change "asian stripper" to "obese LARP-er" and "cocaine" to "girl scout thin mint cookies."
I'm a huge fan of Emacs. For two reasons really. First, it's alway in "edit" mode. I don't need to hit a key to get into a mode. When I was new, this was great. All I needed to know was how to open and save a file. From that I could edit fine in Emacs, everything else came in time.

Secondly, the extensibility is just amazing. I have a function to copy a line. It's bound to C-c l. When I'm on an Emacs where I don't have that setup I'm lost.

Catalyst-proof
May 11, 2011

better waste some time with you
I might be starting to sperg.

A long time back I used to use Opera, and if I recall correctly it had a feature where it could sort of divine the navigation structure of a page, and find, say, "Next" and "Previous" page links in a forum thread. Then it had them bound to some simple shortcut so navigating a thread became scroll-scroll-scroll "next page"-shortcut without much hassle. The code below is just enough to accomplish the same thing in emacs-w3m:

code:

(defun w3m-somethingawful-navigate-next ()
  (interactive)
  (goto-char (point-min))
  (search-forward "Next ›")
  (w3m-view-this-url))

(defun w3m-somethingawful-navigate-previous ()
  (interactive)
  (goto-char (point-min))
  (search-forward "‹ Prev")
  (w3m-view-this-url))

(add-hook 'w3m-mode-hook (lambda ()
                           (define-key w3m-mode-map ":" 'w3m-somethingawful-navigate-next)
                           (define-key w3m-mode-map ";" 'w3m-somethingawful-navigate-previous))

Adbot
ADBOT LOVES YOU

Zombywuf
Mar 29, 2008

Fren posted:

I might be starting to sperg.

A long time back I used to use Opera, and if I recall correctly it had a feature where it could sort of divine the navigation structure of a page, and find, say, "Next" and "Previous" page links in a forum thread. Then it had them bound to some simple shortcut so navigating a thread became scroll-scroll-scroll "next page"-shortcut without much hassle. The code below is just enough to accomplish the same thing in emacs-w3m:

I use vimium in Chrome which also does that.

Fun fact: There are defined html meta fields for this, no-one uses them :-(

  • Locked thread