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
fishbacon
Nov 4, 2009
wonderful yet strange smell
A thread about emacs!

Can we talk about favourite modes and how they make us feel inside?

I have been using org-mode for about a year now and I am very impressed with the power of it; I only really use it for notes and todo lists. Most of the time my group mates (university project group) hate that I write notes from meetings in org-mode because they find that it is hard to read, I found a solution: Publishing to html and having a stylesheet which makes everything all pretty.

Currently my biggest problem with emacs is that color-theme-mode can't customize the area below numbers in linum-mode, at least not in any place I have been able to locate, it creates a weird gap between numbers when you have multiple "lines" on one line (that is the arrow thing in the fringe).

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.

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 :(

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

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

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

fishbacon
Nov 4, 2009
wonderful yet strange smell

DrMelon posted:

I just started using Emacs today, and I'm currently going through the little tutorial.

I can't stop. Send help.

No help needed, you're one of us now. One of us!

Tip: Menus are not for you any more (put this in your .emacs file):
code:
(tool-bar-mode -1)
(scroll-bar-mode -1)
(menu-bar-mode -1)
less scary tip:
i-search is great for navigating a file, C-s has become second nature to me whenever I need to find something in a file.

fishbacon fucked around with this message at 16:17 on Jan 8, 2012

fishbacon
Nov 4, 2009
wonderful yet strange smell

Fren posted:

In other news, flyspell sucks and speck-mode rules. If you do any serious writing in Emacs you owe it to yourself to try out speck-mode.

Looked it up, sounds pretty solid. Been switching dictionary in flyspell a lot lately because of a report in english and a lot of danish writing.

Ace jump also looks pretty cool, I love that he shows the truly expandable nature of emacs in that 2 minute video.

fishbacon
Nov 4, 2009
wonderful yet strange smell
Hey thread, don't die!

Emacs 24.1 is out!

http://www.gnu.org/software/emacs/NEWS.24.1

fishbacon
Nov 4, 2009
wonderful yet strange smell

Am I missing something or is there a reason to "require" stuff every time you need something from it? I thought the initialization slowed for every require.

I have a heavily commented .emacs file so I might have some benefit from just switching to using org-babel.

fishbacon
Nov 4, 2009
wonderful yet strange smell
I just discovered how powerful YAsnippets can be, I was having to do a lot of repetitive work for Uni (we have a bunch of small hand-ins this semester) and I decided to look into templates, turns out YAsnippets just does cool stuff with fields and elisp code.

I spend like 2 hours today figuring out how to do something, and I ended up actually learning a few things about elisp. I love when a simple challenge ends up brightening my whole day.


Sharing of my *Scratch* hiding technique:
Lisp code:
;; bury *scratch* buffer instead of killing it
(defadvice kill-buffer (around kill-buffer-around-advice activate)
  (let ((buffer-to-kill (ad-get-arg 0)))
    (if (equal buffer-to-kill "*scratch*")
        (bury-buffer)
      ad-do-it)))
It simply moves scratch to the back of the queue whenever I try to kill it, because it is such a great buffer to keep around.

I also fiddled with kbd today, turns out it will return exactly what "C-ø" means so that I don't have to have anything ugly in my emacs file.

fishbacon
Nov 4, 2009
wonderful yet strange smell

Xik posted:

Awesome, thank you both, that did it!

I really should learn (emacs) lisp at some point, it's just so drat foreign compared to what I already know.

Learning the basics has done a lot of good for me, it makes it far easier to figure out what a thing is doing, especially these days when I use Company which has almost no documentation.

I recently had to do a small project in C++ for Uni, it turns out that clang is much cooler than I thought and flycheck uses it to make C++ almost fun to write. In fact I am amazed at how good flycheck is.

Through looking for documentation for Company I found this emacs config:
http://steckerhalter.co.vu/steckemacs.html

It contains a bunch of nice packages, like quelpa which manages emacs packages from a bunch of different sources, it is nicely formatted, and well explained.

fishbacon
Nov 4, 2009
wonderful yet strange smell

Avenging Dentist posted:

Is there a way to have it not save open buffers? I tend to close emacs in order to clear out my buffers (I know there are other ways to do that, but MAH WORKFLOW).

Calling desktop-clear when you have re-opened emacs could work. You can also manually delete the list in the .desktop file.

From a cursory look at desktop.el it calls frameset-restore, if you record your frameset in a customize variable or in your init file you can use that for future sessions.

fishbacon
Nov 4, 2009
wonderful yet strange smell
You could try:

Lisp code:
(if (boundp 'scroll-bar-mode) (scroll-bar-mode -1))
edit: that will actually probably not work come to think of it.

fishbacon
Nov 4, 2009
wonderful yet strange smell
Emacs on Windows will start supporting running daemon in version 25.1, I am pretty excited about this:
http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS#n766

I would prefer not to use Windows but when I have to it is nice to have the same sort of workflow I do on Linux.

midnightclimax posted:

Does anyone know how I can change the way "bold" looks within org? I googled this a while ago, and all I got was a statement saying that emacs function is disabled in org. But still, there must be a definition that tells org how to display "bold"? Basically I want it to look like a highlight, maybe someone knows a solution.

I just tried:

Lisp code:
(require 'org)
(add-to-list 'org-emphasis-alist '("*" highlight))
in my init and it worked. So try that.

Adbot
ADBOT LOVES YOU

fishbacon
Nov 4, 2009
wonderful yet strange smell

wooger posted:

I use the server mode for Emacs on windows in 24.x at present, via some init.el code, what difference does this make to me?

I guess it just means there's no window required and I can't accidentally start the client before the server is started, which I occasionally manage by clicking the wrong shortcut.

That is exactly what it means, personally I find it frustrating that I can close my server by accident.

  • Locked thread