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
I can't imagine using line numbers in Emacs. I mean you have your modeline right there.

And org mode is loving amazing. I use it for everything. I actually recently published the code I use to publish my blog in org mode: http://msnyder.info/posts/2011/07/introducing-narcissus/

Also org-mode + deft = <3.

Adbot
ADBOT LOVES YOU

fishbacon
Nov 4, 2009
wonderful yet strange smell

Fren posted:

I can't imagine using line numbers in Emacs. I mean you have your modeline right there.

I frequently have to stare at Visual Studio and Notepad++ so I've gotten attached to having line numbers there all the time.

Zombywuf
Mar 29, 2008

The problem I have with org-mode is that I am not a natural note taker. I frequently try to use it but simply don't write enough stuff down. It is good at meetings though.

Anyone know any tools to pull information in to org-mode? I seem to have accounts on things all over the place, it would be cool if facebook/last.fm/google/etc... events could turn up in an org file somewhere.

Actually what I really want is a kind of web-based org-mode with multi user editing, a RESTful API for sharing parts and editing and embedding of arbitrary web content.

Also I want a pony.

Catalyst-proof
May 11, 2011

better waste some time with you
Unfortunately, there aren't really any good tools for that sort of thing. But that's the benefit of them being in plain text -- just write some glue code and you can usually find a way to translate the information you need. For example! I wanted my OS X Address book contacts synced in Org, because I use org-contacts to autofill e-mail addresses. So I fired up Clozure CL (which has an Apple Foundation Framework bridge) and wrote some code to generate the Org file I wanted. (I have the bridge code for the address book up at https://github.com/ardekantur/nsclasp, but not the code that writes the Org file. I'll put that up in a bit.)

I really want to be able to provide a babel source like so:

code:
#+SRC lisp :filename ~/poop.lisp :lines 1 16
#+END_SRC
And it will automatically import those lines of that file into an exported version of the Org file. It's a shame Org's innards are unreadable poo poo. Case in point, org-export-as-html is basically worthless if you want to extend any of Org's HTML generation capabilities.

But anyway. If you want to get started slurping things *into* Org, there are a ton of Emacs libraries that can deal with web APIs, like http://www.emacswiki.org/emacs/http-post-simple.el.

Oh oh! I'm not a natural notetaker also, but Org-capture is the poo poo. From whatever buffer you're in, org-capture (which I think is C-c c by default), choose the template for your note, write it, and it gets filed away wherever you want it to go. Then at the end of the week or whatever you have some inbox.org filled with all your org-capture notes, and you can go through and refile/deal with them.

Catalyst-proof fucked around with this message at 21:01 on Nov 8, 2011

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional

Fren posted:

The first Emacs mode I've written has been released. It's a gopher client for Emacs, and it's called gopher.el.

Holy poo poo. This is the greatest thing. When I'm jacking into the net to cruise the cyberlanes and scope out on netnews the latest ice advances to stop virtual reality system incursions now I don't need to leave emacs to access critical gopher sites run by eastern european guys named Vlad who really REALLY like techno.

My life... he is complete now.

Also linum-mode rocks, I don't care what you say. :colbert:

Edit: Have you checked out how gnus integrates with w3m? That's totally the way I'd go for HTML support in gopher.el. You got tables and even inline images should you want them. If a user wants fancy webkit-fied css'ed and javascripted experiences I'd argue they don't really "get" gopher.

orphean fucked around with this message at 20:45 on Nov 8, 2011

fishbacon
Nov 4, 2009
wonderful yet strange smell

Fren posted:

Oh oh! I'm not a natural notetaker also, but Org-capture is the poo poo. From whatever buffer you're in, [fixed]org-capture[/fixture] (which I think is [fixed]C-c c[/fixed by default), choose the template for your note, write it, and it gets filed away wherever you want it to go. Then at the end of the week or whatever you have some inbox.org filled with all your org-capture notes, and you can go through and refile/deal with them.

Uh! Never knew about that one, since I am like (probably) every other emacs user, I didn't read the manual for org-mode I just assumed I could figure out everything by using it, but it looks like I haven't scratched the surface yet. I have hardly learned to actually use the calendar (guessing this is because I just generally don't do well with calendars).
I will keep C-c c in mind in the future.

Does it annoy anyone else that no other programs for text editing has as easy isearch? Almost every time I use Chrome I press C-s and get a "save?" dialogue box :(

Catalyst-proof
May 11, 2011

better waste some time with you

orphean posted:

Holy poo poo. This is the greatest thing. When I'm jacking into the net to cruise the cyberlanes and scope out on netnews the latest ice advances to stop virtual reality system incursions now I don't need to leave emacs to access critical gopher sites run by eastern european guys named Vlad who really REALLY like techno.

My life... he is complete now.

Also linum-mode rocks, I don't care what you say. :colbert:

Edit: Have you checked out how gnus integrates with w3m? That's totally the way I'd go for HTML support in gopher.el. You got tables and even inline images should you want them. If a user wants fancy webkit-fied css'ed and javascripted experiences I'd argue they don't really "get" gopher.

I mainly did it to just write a major mode of *something*, figure out some of that machinery. I would love to use emacs-w3m, but that involves both the user installing w3m, and getting the emacs-w3m extension to work. If I can find something with lighter dependencies, perhaps.


Mr. Fish posted:

Does it annoy anyone else that no other programs for text editing has as easy isearch? Almost every time I use Chrome I press C-s and get a "save?" dialogue box :(

I love isearch, but I clearly don't know how to use it. I can never figure out what to press when, and I either end up: 1) finding exactly what I want, hitting the wrong keystroke, and ending back where I started the search, 2) searching for 'foo', then trying to search for 'bar', and ending up searching for 'foobar', 3) *just* passing the search result I wanted and having to loop through the whole file again, or 4) trying to clear the search query only to end up quitting isearch altogether.

Catalyst-proof fucked around with this message at 21:03 on Nov 8, 2011

pgroce
Oct 24, 2002

Fren posted:

Oh oh! I'm not a natural notetaker also, but Org-capture is the poo poo. From whatever buffer you're in, org-capture (which I think is C-c c by default), choose the template for your note, write it, and it gets filed away wherever you want it to go. Then at the end of the week or whatever you have some inbox.org filled with all your org-capture notes, and you can go through and refile/deal with them.

I've used remember for this as well. One thing I liked about it was being able to insert into a particular part of the org-mode outline.

I think my favorite stupid org-mode trick is using the LaTeX export and Beamer to create presentations.

fishbacon
Nov 4, 2009
wonderful yet strange smell

Fren posted:

I love isearch, but I clearly don't know how to use it. I can never figure out what to press when, and I either end up: 1) finding exactly what I want, hitting the wrong keystroke, and ending back where I started the search, 2) searching for 'foo', then trying to search for 'bar', and ending up searching for 'foobar', 3) *just* passing the search result I wanted and having to loop through the whole file again, or 4) trying to clear the search query only to end up quitting isearch altogether.

I too do the thing where I search for something, get to it, then press C-g and return to the line I was at.
If you're more comfortable with regexp (I've always been horrible at making up regexps for this) you could rebind it to search-forward-regexp.
If you overshoot you can just press C-r (isearch-backwards) it's super useful.
The mini-buffer isearch creates is weird, I can't really figure out how to navigate it and when I finally do I've forgotten what I was looking for.

edit: I just remembered! My new favourite thing! iswitchb. Every time I have to switch buffer I smile, it's so much nicer than the default buffer switcher. Org-mode even has a utility function (org-iswitchb) which uses iswitchb to switch between .org buffers only.

edit2: That is, new to me, it's probably a pretty old functionality.

fishbacon fucked around with this message at 21:52 on Nov 8, 2011

Zombywuf
Mar 29, 2008

Fren posted:

Unfortunately, there aren't really any good tools for that sort of thing. But that's the benefit of them being in plain text -- just write some glue code and you can usually find a way to translate the information you need. For example! I wanted my OS X Address book contacts synced in Org, because I use org-contacts to autofill e-mail addresses. So I fired up Clozure CL (which has an Apple Foundation Framework bridge) and wrote some code to generate the Org file I wanted. (I have the bridge code for the address book up at https://github.com/ardekantur/nsclasp, but not the code that writes the Org file. I'll put that up in a bit.)

Oh man, whenever I start to try and write this kind of thing for a personal project I always end up over generalising. As in, never actually start for want of solving all the problems ever.

quote:

I really want to be able to provide a babel source like so:

code:
#+SRC lisp :filename ~/poop.lisp :lines 1 16
#+END_SRC
This also would rule.

quote:

Oh oh! I'm not a natural notetaker also, but Org-capture is the poo poo. From whatever buffer you're in, org-capture (which I think is C-c c by default), choose the template for your note, write it, and it gets filed away wherever you want it to go. Then at the end of the week or whatever you have some inbox.org filled with all your org-capture notes, and you can go through and refile/deal with them.

Seems I have some lovely default ubuntu version of org where this doesn't work. Hmm, time to upgrade perhaps.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional

Zombywuf posted:

Seems I have some lovely default ubuntu version of org where this doesn't work. Hmm, time to upgrade perhaps.

It may seem daunting (its not!) but you could always build your emacs from source. I tend to track the bleeding edge but there's nothing stopping you from just downloading the officially released source tarball and using that.

The trick here is to use /usr/local as your installation prefix. That's reserved for you, the end user/sysadmin, to do with as they please and no packages you have or install will muck with it. Luckily, its also the default prefix when you run configure. If you trust yourself you can setup /usr/local so your user account has full access to it so you don't ever have to elevate privileges to install things in there. Ubuntu comes with a group named 'admin' that works well for this purpose. Do something like the following:
code:
sudo useradd -G admin <your username>
sudo chgrp admin /usr/local
sudo chmod 775 -R /usr/local
And that'll give you (and whoever else you put into the admin group) full access to the /usr/local tree.

For something like Emacs I hate being held prisoner to the whims of the distribution. If you want to do this and need more info let us know.

Zombywuf
Mar 29, 2008

orphean posted:

It may seem daunting (its not!) but you could always build your emacs from source. I tend to track the bleeding edge but there's nothing stopping you from just downloading the officially released source tarball and using that.

I used to run Slackware. I've pretty much converted to "Give me package management or give me death." I could upgrade ubuntu but that runs into problems with my work machine being out of sync with the servers. Anyone know any good ppa's for emacs on Lucid?

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
https://launchpad.net/~ubuntu-elisp/+archive/ppa That's probably your best bet. Will get you the newest release in Lucid.

Johnny Cache Hit
Oct 17, 2011

Zombywuf posted:

I used to run Slackware. I've pretty much converted to "Give me package management or give me death." I could upgrade ubuntu but that runs into problems with my work machine being out of sync with the servers. Anyone know any good ppa's for emacs on Lucid?

You could always use Gentoo :smugdog:

Seriously though, couldn't you just fetch the latest org-mode and load that from .emacs? I've always wondered if that's a way to get around officially packaged but incredibly old Emacs modes.

Catalyst-proof
May 11, 2011

better waste some time with you
I don't know if it's from Marmalade or Elpa, but the package I have listed seems fairly recent:

code:
  org                20111108     available  Outline-based notes management and organizer
Also, I got ipython completion in 0.11 working :smugdroid:

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
A bit offtopic but there's no real lisp thread... Fren, thanks a bunch for linking to Land of Lisp from your gopher.el page. I checked it out and ended up buying it last night.

I just finished working through his loop example (the simple genetic algorithm simulation) and my head just exploded.

Holy poo poo, that's loving incredible. Can't thank you enough.

Catalyst-proof
May 11, 2011

better waste some time with you

orphean posted:

A bit offtopic but there's no real lisp thread... Fren, thanks a bunch for linking to Land of Lisp from your gopher.el page. I checked it out and ended up buying it last night.

I just finished working through his loop example (the simple genetic algorithm simulation) and my head just exploded.

Holy poo poo, that's loving incredible. Can't thank you enough.

I'm glad you like the book, but where did I link to it? :confused:

Beef
Jul 26, 2004
Google ads were finally useful? :D

Welcome to the wonderful world of Lisp.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional

Fren posted:

I'm glad you like the book, but where did I link to it? :confused:

Sorry it was linked off Lisp for the Web Part 2 :downs:

Catalyst-proof
May 11, 2011

better waste some time with you
Ahhh, gotcha. Yeah, LoL is a fantastic book because it's just wacky enough and explains just enough to make some interesting projects. I kept trying to get into Practical Common Lisp but its 'practical' make an MP3 database out of plists is probably the second worst example in a programming book, next to Dive Into Python's fun and interesting "create an ODBC connection string" example.

Catalyst-proof
May 11, 2011

better waste some time with you
Holy crap, I just discovered what I'm doing wrong with isearch. When you search for something and it's not found, but there's a prefix of your search string that *is* found, hitting C-g doesn't remove the search string, it removes everything after that prefix. That is, if I'm looking for `removed`, and there's only `rem` in the corpus, hitting C-g will turn the search string into `rem`, not the empty string. That makes so much more sense now.

Zombywuf
Mar 29, 2008

Fren posted:

Holy crap, I just discovered what I'm doing wrong with isearch. When you search for something and it's not found, but there's a prefix of your search string that *is* found, hitting C-g doesn't remove the search string, it removes everything after that prefix. That is, if I'm looking for `removed`, and there's only `rem` in the corpus, hitting C-g will turn the search string into `rem`, not the empty string. That makes so much more sense now.

drat I wish I'd known that sooner.

Beef
Jul 26, 2004

Zombywuf posted:

drat I wish I'd known that sooner.

Seconded. Explains why I sometimes had the I-search: and I-search backward: stuck below the screen.

Moar emacs hints!

Zombywuf
Mar 29, 2008

Beef posted:

Moar emacs hints!

Y'all know about dabbrev-expand yes? M-/ will complete the current word using other words in your buffer and other buffers. I find it so much easier to use than Intellisense.

baby puzzle
Jun 3, 2011

I'll Sequence your Storm.
In gnu emacs on Windows 7, alt-space doesn't bring up the window menu. Can I fix this?

Mao Zedong Thot
Oct 16, 2008


(Not trolling) Why should I use Emacs instead of vim?

I get the feeling that I should (just talking about the editor/IDE side of things, do not care at all about org-mode or mush clients or whatever the gently caress) -- but it's just never clicked with me the two or three times I've seriously tried out Emacs. Hope me please.

FWIW I'm a regular (daily) vim user, but not a power user at all.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
It depends on what sorts of things you care about, really. One of the big differentiators is emacs is focused on being a platform while Vim is focused on being a really good text editor.

This manifests itself in all sorts of ways but here's a good example of the difference. Let's say you want to integrate debugging with your editor. With Vim you just can't do it using functionality built into the editor, and it's a design decision not a flaw. Vim has very poor integration with external tools. That's why you have all these projects like Clewn, Agide, VimGdb, etc which all provide their own weird little program that acts as an intermediary layer between vim and the debugger.

Emacs on the other hand embraces integration with external programs and tons of stuff is built off it: GUD, Slime, FlyMake, FlySpell, anything using comint, etc etc.

This is why you see the Vim dev guys doing stuff like implementing their own embedded version of grep. They want Vim to be largely self-contained.

Emacs wants you to live in it, extend it, improve it. Other people like Yegge talk about this far better than I can but the gist is that since emacs is a platform improvements added to it benefit everything and it forms this self-reinforcing improvement cycle.

Vim's a great text editor. Emacs is a great environment assembly kit.

fishbacon
Nov 4, 2009
wonderful yet strange smell

baby puzzle posted:

In gnu emacs on Windows 7, alt-space doesn't bring up the window menu. Can I fix this?

I think you could just unset M-SPC from just-one-space, let me check; nope, it'll just start telling you that it is unbound.

I bet there is a way to get it to open a menu with M-SPC but I never really use the menus much.

edit:

This mornings lecture; "Visual Studio programming for everyone [C# knowledge mandatory]"(disclaimer: not actual course name) we have spend the first 30 minutes or so looking at a man drag-and-drop programming most of an "applikation" - fun?

fishbacon fucked around with this message at 08:54 on Nov 17, 2011

baby puzzle
Jun 3, 2011

I'll Sequence your Storm.
Hmm. I think I'll have to make my own alt-space,m keybind to minimize the window.

emacs is great and all, but there are so many cases where the most basic poo poo is just plain broken. Every time I try it, I seem to hit all of these issues before being able to get anything useful done.

fishbacon
Nov 4, 2009
wonderful yet strange smell

baby puzzle posted:

Hmm. I think I'll have to make my own alt-space,m keybind to minimize the window.

C-z (suspend-frame) basically does this.

So:
(global-set-key (kbd "M-SPC") 'suspend-frame)
should do what you want, unless you want it to enter some state when M-space is pressed, that'd be a bit more work.

fishbacon fucked around with this message at 15:54 on Nov 17, 2011

baby puzzle
Jun 3, 2011

I'll Sequence your Storm.
I'm feeling a bit retarded. How do I get emacs to know about all of the files in our projects? They consist of our own special jam-based build system, which also generates visual studio .sln files. Edit: Seems like I'd have to cobble something together and use some existing management system. This sounds very difficult.

Edit again: I know undo is supposed to be different, but I can't get it to undo more than the last thing that I did. It just keeps undoing/redoing the last command. I can't get back to a state earlier than that. Edit again: I have no idea what was happening but it is working now.

baby puzzle fucked around with this message at 05:08 on Nov 18, 2011

BusError
Jan 4, 2005

stupid babies need the most attention
Just chiming in with a couple great Emacs links:

Planet Emacsen is a blog aggregator that shows Emacs-related posts from a number of different places online. I've learned more useful tips and tricks from this RSS feed than from any other single Emacs source.

Emacs Rocks hasn't been around super long, but it's a series of screencasts on Emacs and I'm enjoying it so far. It's always nice to watch someone else use Emacs, because you'll probably see them do something you've never heard of that's immediately useful for you.

VimGolf in Emacs. -- VimGolf is a fun site where Vim users receive an editing challenge and then try to come up with the most efficient way to solve it. This guy is taking some of those challenges and making screencasts where he solves them in Emacs.

Catalyst-proof
May 11, 2011

better waste some time with you
Hey thread. Does anyone know if there's a reasonably good Jira Emacs mode lying about? I hate having to lose context 10 or 12 times a day to go to that horrid website.

Zombywuf
Mar 29, 2008

Fren posted:

Hey thread. Does anyone know if there's a reasonably good Jira Emacs mode lying about? I hate having to lose context 10 or 12 times a day to go to that horrid website.

The only one I've found (jira.el) is pretty poor as it uses the xmlrpc interface which is very limited. So tempting to write a better one but :effort:.

baby puzzle
Jun 3, 2011

I'll Sequence your Storm.
I'm trying to use eshell, and:

code:
d:/dev-m2/main $ git pull --rebase
ssh: avagit: no address associated with name
fatal: The remote end hung up unexpectedly
This just works from a regular command prompt. Usually this is because ssh isn't happy with some environment variables. Why would the environment here be any different here? How can I even begin to solve this problem?

I'm completely fine with the fact that shell ansi colors just don't work, even though everything I've read indicates that they should.

baby puzzle fucked around with this message at 17:28 on Dec 1, 2011

Zombywuf
Mar 29, 2008

Anyone know how to get the current revision and other version control info from a file to create a org-capture template. The idea is to be able to insert a note about the file I currently have open, so something like this:
code:
(defun generate-file-template ()
  (let ((file-name (buffer-file-name))
	(line-number (line-number-at-pos)))
    (concat "* " file-name ":" (int-to-string line-number) " %T")))
will insert a note like:

quote:

** /home/zombywuf/code/dotfiles/src/.emacs:32 <2012-01-02 Mon 15:24>
What I want is to be able to check if the file is under version control and get info about the repository and revision but the functions under dvc don't seem to have much in the way of introspection. Anyone know how to get information out of it?

Catalyst-proof
May 11, 2011

better waste some time with you
So far I've found vc-git-working-revision and vc-git-state, both of which take a filename as an argument. If you want the SHA1 hash, I'm sure vc-git.el has something that you can use.

Zombywuf
Mar 29, 2008

Fren posted:

So far I've found vc-git-working-revision and vc-git-state, both of which take a filename as an argument. If you want the SHA1 hash, I'm sure vc-git.el has something that you can use.

The problem is I want it to work for git, hg and bzr. Ideally without duplicating a bunch of code that seems like it must exist within dvc somewhere.

Catalyst-proof
May 11, 2011

better waste some time with you
Ahh, I stupidly assumed you only used git :downs: Sorry I can't help.

Adbot
ADBOT LOVES YOU

Catalyst-proof
May 11, 2011

better waste some time with you
This is a really stupid request. Does anyone know of a more thorough font-lock mode for Common Lisp? I feel like more stuff, like numbers, symbols, functions known to be provided by the implementation, etc. should be highlighted.

  • Locked thread