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

pgroce posted:

Other people I know run a separate copy of Emacs just for Gnus so gnus-agent doesn't block their system.

Yeah, and that's literally worse than Hitler. I can't even fathom the mindset you'd have to be in where you'd think running a separate copy of Emacs would be okay.

Ah well. One day we'll have a version of Emacs and Gnus that understands threading, and it'll be like in 2050.

Adbot
ADBOT LOVES YOU

Beef
Jul 26, 2004
Dynamically scoped variables + threads = oh balls.

They will have to completely switch over to lexically scoped vars.

Or just write emacs in CL already.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
You can sort of half rear end this with gnus-daemon-* and friends if you haven't checked it out.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Beef posted:

Dynamically scoped variables + threads = oh balls.

They will have to completely switch over to lexically scoped vars.
The people who are actually working on implementing threads don't think so. See e.g. the patchset Tom Tromey posted to emacs-devel just yesterday.

Beef posted:

Or just write emacs in CL already.
If dynamic binding is the problem, then I'm not clear on how it would help to switch from one Lisp that provides both dynamic and lexical binding to another Lisp that provides both dynamic and lexical binding ...

Beef
Jul 26, 2004
It's switching from one standardised Lisp that is lexically scoped, but offers *special* variables if you really want them; to a surviving Lisp dialect from back in the day when everyone rolled his own, that happens to just have added lexically scoped variables as a special case.

That said, CL is just as hosed when someone starts to roll dynamically scoped variables. And much of the environment is in *earmuffed-vars*.

Catalyst-proof
May 11, 2011

better waste some time with you
Has anybody used Memacs? I've been pulling most of my planning/logistics/life organization stuff out of Emacs but if this does what it says on the tin that would almost be enough for me to put it all right back.

BusError
Jan 4, 2005

stupid babies need the most attention
I did a bit of googling on this and came up empty, so maybe someone here can help me out. When I run make-frame, the new frame that pops up always has smaller fonts than the original. The color scheme sticks, but for some reason I can't make font settings stay. Any ideas?

Police Academy III
Nov 4, 2011

BusError posted:

I did a bit of googling on this and came up empty, so maybe someone here can help me out. When I run make-frame, the new frame that pops up always has smaller fonts than the original. The color scheme sticks, but for some reason I can't make font settings stay. Any ideas?

did you see this? http://superuser.com/questions/210555/emacs-font-settings-not-working-in-new-frame

BusError
Jan 4, 2005

stupid babies need the most attention

That did it! Thanks :D Out of curiosity, what was your search term? I think I must be using the wrong vocabulary to describe my problem.

Police Academy III
Nov 4, 2011
I can't remember exactly what I used to find it, but 'emacs new frame font' gives it as the top result.

BusError
Jan 4, 2005

stupid babies need the most attention
OK, here's another font-related question that's hopefully a little less remedial...

I'm trying to write a function that does something based on the current window width. The problem is, Emacs is confused about its actual window width. Here's a picture to clarify:



It seems to work correctly when I remove my custom font setting, so I think it must be not updating how big it thinks a column is after switching to a new font.

Here's the relevant part of my visual config:
code:
(setq default-frame-alist
      '(
        (font . "-apple-Ubuntu_Mono-medium-normal-normal-*-17-*-*-*-p-0-iso10646-1")
        (width . 130)
        (height . 45)))
(obviously the frame was resized from my defaults in the picture, but this is where my font gets set so it seems relevant)

And here's a function I used to determine the computed current width:
code:
(defun get-window-size ()
  "Temporary utility function to help debug window resizing problems"
  (interactive)
  (message "The width is %d." (window-body-width)))
According to the docs, the window-body-width function should return just the editing area, so any discrepancy between column number and total frame size should be eliminated...

Anyone have any ideas about how to get the numbers to match up?

BusError
Jan 4, 2005

stupid babies need the most attention

BusError posted:

Column size business

I actually found the answer to this, so I figured I'd share it here in case anyone has a related problem.

It turns out that Emacs has trouble accurately calculating column width if your default font is not set to one of the officially supported sizes. In my case, I had Ubuntu Mono set at 17pt, which I guess was getting scaled up from 14pt. Emacs was figuring out columns based on 14pt.

I set the default font to 18pt, which IS a provided size, and now everything is peachy.

Soricidus
Oct 21, 2010
freedom-hating statist shill

BusError posted:

It turns out that Emacs has trouble accurately calculating column width if your default font is not set to one of the officially supported sizes. In my case, I had Ubuntu Mono set at 17pt, which I guess was getting scaled up from 14pt. Emacs was figuring out columns based on 14pt.

I set the default font to 18pt, which IS a provided size, and now everything is peachy.
How strange. Did you report it as a bug? Because Emacs isn't supposed to have any concept of "officially supported sizes". It's supposed to handle scalable fonts correctly at any size you like. (Provided they're monospaced, which I assume something called "Ubuntu Mono" is!)

(FWIW I can't imagine what the problem is. I tried to duplicate your result, but I get correct width calculations regardless of the font or size I choose. I'm not running Ubuntu, though, so I don't know if there might be something weird with that one specific font?)

BusError
Jan 4, 2005

stupid babies need the most attention

Soricidus posted:

How strange. Did you report it as a bug? Because Emacs isn't supposed to have any concept of "officially supported sizes". It's supposed to handle scalable fonts correctly at any size you like. (Provided they're monospaced, which I assume something called "Ubuntu Mono" is!)

(FWIW I can't imagine what the problem is. I tried to duplicate your result, but I get correct width calculations regardless of the font or size I choose. I'm not running Ubuntu, though, so I don't know if there might be something weird with that one specific font?)

Huh, that's really weird. I just tried switching my font and trying both an included size and a scaled one, and they both worked as expected. I'm on a Mac, and the Ubuntu font doesn't ship with it, so now I think maybe I just installed it incorrectly or something like that, because the font that worked fine was an included one. At any rate, I'm happy it's working now :)

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
Here's a cool thing that's just been released. It's called skewer-mode and it uses simple-httpd and js2-mode to run a webserver from inside emacs and let's you execute and work with javascript from inside emacs with the browser doing the javascript execution.

Results show up in the minibuffer, errors show up as emacs windows, you want a javascript repl in emacs? You may have one my son, etc etc.

It's kind of like swank-js but quick and easy to setup and play with.

h_double
Jul 27, 2001

orphean posted:

Here's a cool thing that's just been released. It's called skewer-mode and it uses simple-httpd and js2-mode to run a webserver from inside emacs and let's you execute and work with javascript from inside emacs with the browser doing the javascript execution.

That looks pretty awesome, but I'm not quite sure how to install it.

The MELPA package repository says "To add the repository put this before the call to package-initialize in your init.el file:

code:
(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/") t)
EDIT: I figured it out. This is the relevant chunk of my .emacs:

code:
(require 'package)
(add-to-list 'package-archives
	     '("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(unless package-archive-contents
  (package-refresh-contents))
I also had to manually run M-x package-refresh-contents for some reason to get it to update the package list, but now all the melpa stuff shows up when I run package-install.

h_double fucked around with this message at 05:08 on Nov 7, 2012

Catalyst-proof
May 11, 2011

better waste some time with you
Is there a terminal mode that's not terrible? It seems like each one has it's own unique glaring flaw that makes it unusable for real work.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

WHOIS John Galt posted:

Is there a terminal mode that's not terrible?

Nope.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
ansi-term isn't horrible and it's VT-100 state machine is robust enough to run vim or something.

But yeah, not really.

Notorious b.s.d.
Jan 25, 2003

by Reene

WHOIS John Galt posted:

So I've slunk back to Gnus for most of my email needs, because it's regex-based splitting is loving amazing. I've also torn out offlineimap+dovecot because I'm sick of having to deal with the complexity. Is there a way to keep Gnus up-to-date without locking up all of Emacs with a configuration like this?

I have tried everything on heaven and earth. Gnus and VM are both completely useless with a remote mailbox.

It's just a matter of which local mailbox sync solution makes you least miserable.

Catalyst-proof
May 11, 2011

better waste some time with you

Notorious b.s.d. posted:

I have tried everything on heaven and earth. Gnus and VM are both completely useless with a remote mailbox.

It's just a matter of which local mailbox sync solution makes you least miserable.

I'm so sick of rickety solutions that require installing heinous amounts of dependencies and downloading gigs of mail data on each computer I need the solution on. So I've reverted back to Gmail's web interface for the time being. It's like trying to pilot an aircraft with the controls from Doom but it's the least worst solution right now. I'm waiting on the multithreading discussion to mature a little bit before I dive in again, because it's simply untenable in Emacs right now.

Notorious b.s.d.
Jan 25, 2003

by Reene

WHOIS John Galt posted:

I'm so sick of rickety solutions that require installing heinous amounts of dependencies and downloading gigs of mail data on each computer I need the solution on. So I've reverted back to Gmail's web interface for the time being. It's like trying to pilot an aircraft with the controls from Doom but it's the least worst solution right now. I'm waiting on the multithreading discussion to mature a little bit before I dive in again, because it's simply untenable in Emacs right now.

The problem isn't really threading. All of the imap clients for emacs are unbearably horrifyingly slow. Even if you had perfect threading and gnus supported it, it would still take 20 minutes to get an e-mail.

The biggest problem is this: emacs makes a kickass mail client. It's a pleasure to browse, edit, read, write e-mail in emacs. If the frontend weren't great, then we wouldn't have a reason to care that the IMAP backends were bad :(

Zombywuf
Mar 29, 2008

Notorious b.s.d. posted:

The problem isn't really threading. All of the imap clients for emacs are unbearably horrifyingly slow. Even if you had perfect threading and gnus supported it, it would still take 20 minutes to get an e-mail.

The biggest problem is this: emacs makes a kickass mail client. It's a pleasure to browse, edit, read, write e-mail in emacs. If the frontend weren't great, then we wouldn't have a reason to care that the IMAP backends were bad :(

The real problem is that IMAP itself is terrible.

Catalyst-proof
May 11, 2011

better waste some time with you

Notorious b.s.d. posted:

The problem isn't really threading. All of the imap clients for emacs are unbearably horrifyingly slow. Even if you had perfect threading and gnus supported it, it would still take 20 minutes to get an e-mail.

The biggest problem is this: emacs makes a kickass mail client. It's a pleasure to browse, edit, read, write e-mail in emacs. If the frontend weren't great, then we wouldn't have a reason to care that the IMAP backends were bad :(

Especially so because Emacs is the only mail client I know of that provides me the ability to separate newsgroup e-mails into separate folders upon incoming. It's like two lines of elisp. Why can no other mail client on the planet do that?

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal

WHOIS John Galt posted:

Especially so because Emacs is the only mail client I know of that provides me the ability to separate newsgroup e-mails into separate folders upon incoming. It's like two lines of elisp. Why can no other mail client on the planet do that?

Emacs has blinded you with its glory or something, that's trivial to do in gmail. Gear -> Settings -> Filters.

Catalyst-proof
May 11, 2011

better waste some time with you

SavageMessiah posted:

Emacs has blinded you with its glory or something, that's trivial to do in gmail. Gear -> Settings -> Filters.

I'm sorry. I meant automatically.

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal
What do you mean? How can you generically tell if any given email is from a newsgroup? That would be a nice feature.

Catalyst-proof
May 11, 2011

better waste some time with you
Competent newsgroups provide a header. List-ID: <vagrant-up.google.com> or the like. This is the split rule I used to use to have Gnus automatically sort them into folders.

Lisp code:
 ("List-Id" ".*<\\(.+\\)\\.google\\.com>.*" "list/\\1")

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you
Having an echo chamber about how sexy Emacs is itt is great and all, but how am I supposed to learn how to implement all of these features that you guys are circlejerking over? Shouldn't that be the purpose of this thread?

I installed Emacs a long time ago and I see you guys talking about how you've all customized it by binding buttons to functions, tricking it out so it's cooler than VS, et cetera... but I don't see anything about how to do that stuff for myself. I just see a bunch of guys circlejerking itt.

But then again maybe I'm just illiterate.

Catalyst-proof
May 11, 2011

better waste some time with you
Read the first two posts in the thread if you need help getting started, ask a question if you have a question. We can't tell you how to "implement all of these features", you have to know what it is you want, and we'll help you make it happen.

EDIT: What languages do you use? What languages do you want to use in Emacs? What features in other IDEs would you like to expose in Emacs?

Seriously it's the bloody OP

WHOIS John Galt posted:

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.

Catalyst-proof fucked around with this message at 22:32 on Jan 9, 2013

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional

WHOIS John Galt posted:

Competent newsgroups provide a header. List-ID: <vagrant-up.google.com> or the like. This is the split rule I used to use to have Gnus automatically sort them into folders.

Lisp code:
 ("List-Id" ".*<\\(.+\\)\\.google\\.com>.*" "list/\\1")

Opera mail and thunderbird pay attention to that these days. :q:

don't use opera or thunderbird for email

BusError
Jan 4, 2005

stupid babies need the most attention

Love Stole the Day posted:

but how am I supposed to learn how to implement all of these features that you guys are circlejerking over?

What features do you want to know more about?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
So, I have sort of two things:

1. Did emacs packaging ever improve? Marmalade was cool for a while, but nothing I want is on there, and the stuff on there is just broken. Like, I haven't gotten guess-style/guess-offset to actually work for my C files, since it doesn't install any autoloads.

2. I always feel like I'm not getting enough power out of emacs. Like, I just feel like I'm slow at editing. I guess it's the same issue that Love Stole the Day has: I can get by with emacs, and it's pretty OK, but I don't love it. I don't feel at home with it, and I don't feel powerful with it. The various features I thought I would love (like align-regexp) tend to fail in actual real-world tasks I have, so I just do everything manually.

Catalyst-proof
May 11, 2011

better waste some time with you

Suspicious Dish posted:

So, I have sort of two things:

1. Did emacs packaging ever improve? Marmalade was cool for a while, but nothing I want is on there, and the stuff on there is just broken. Like, I haven't gotten guess-style/guess-offset to actually work for my C files, since it doesn't install any autoloads.

2. I always feel like I'm not getting enough power out of emacs. Like, I just feel like I'm slow at editing. I guess it's the same issue that Love Stole the Day has: I can get by with emacs, and it's pretty OK, but I don't love it. I don't feel at home with it, and I don't feel powerful with it. The various features I thought I would love (like align-regexp) tend to fail in actual real-world tasks I have, so I just do everything manually.

So there's a bunch of answers I want to give here. Let's deal with the most specific things first.

Why do you think that guess-style's being broken is the result of it being on Marmalade? Marmalade is simply a generic package repository. If you're having trouble with autoloads, check to make sure (in ~/.emacs.d/elpa/guess-style-<version>/) that autoloads were generated. If so, check to make sure your initialization code both requires 'package and that (package-initialize) is called. This will still not actually start guess-style when you open a file in C mode: you must tell Emacs to do so because there's no reason to believe that it should. Most packages are built this way, requiring mode-hooks. (add-hook 'c-mode-common-hook 'guess-style-guess-all).

There are two other notable package repositories worth looking at. MELPA builds packages continuously from source. There's also—separate from Emacs' packages system—auto-install, which is an extension of the Emacs Wiki. auto-install allows you to install packages from Emacs Wiki, or from a specified URL, or from GitHub gists. That greatly expands the amount of available Emacs Lisp as your disposal, especially smaller one-off functions and customizations.

If you feel like you're not getting enough power out of Emacs:

  • Are you using ido to make your life easier?
  • Are you using imenu to navigate your documents quickly?
  • Are you using smex to get to your most used commands faster?
  • Are you using M-x rgrep to quickly navigate your codebase and M-x compile to quickly navigate your compilation warnings and issues?
  • Are you using flymake to automatically build your code, or run linters and syntax checkers?
  • Do you know how to use the kill ring?
  • Do you know how to use the universal argument of set-mark-command (typically C-SPC) to jump back to your previous place in your file?
  • Do you know how to record, execute, and repeat macros?

Catalyst-proof fucked around with this message at 05:49 on Jan 10, 2013

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

WHOIS John Galt posted:

So there's a bunch of answers I want to give here. Let's deal with the most specific things first.

Thanks for the incredibly detailed response! Have this giant wall of text you won't read as a reply.

First things first, if you're curious, I have a heavily customized emacs setup over here.

WHOIS John Galt posted:

Why do you think that guess-style's being broken is the result of it being on Marmalade?

So, my fault: guess-style wasn't available on Marmalade, so I used something called guess-offset. Looking at the wiki page for it now, it seems it was built in 2003 and now there's a replacement, dtrt-indent, which is also available on Marmalade, with minimal setup. I'll try that now and see how it goes. Note that guess-offset had some fancy code to add the appropriate hooks when you loaded it. As far as I could tell, the code just never got run, and it wasn't interactive, so I had to M-: (guess-offset-c-basic-offset) or whatever.

WHOIS John Galt posted:

There are two other notable package repositories worth looking at. MELPA builds packages continuously from source. There's also—separate from Emacs' packages system—auto-install, which is an extension of the Emacs Wiki. auto-install allows you to install packages from Emacs Wiki, or from a specified URL, or from GitHub gists. That greatly expands the amount of available Emacs Lisp as your disposal, especially smaller one-off functions and customizations.

Nifty. 1) Do they integrate with package.el? 2) I'm very uncomfortable with installing directly from the Emacs Wiki if it still allows anonymous users to overwrite any file.

WHOIS John Galt posted:

If you feel like you're not getting enough power out of Emacs:

  • Are you using ido to make your life easier?

I tried it for a bit, and didn't really understand it. Interactively doing things is all I do on a computer all day long. Is it just a set of utility helpers for emacs? How can it "make my life easier"?

WHOIS John Galt posted:

  • Are you using imenu to navigate your documents quickly?

No, but it looks neat, and I may eventually try it out. Is it like a semantics mode that jumps to functions and stuff, or is that feature displayed in the screenshot only for Lisp?

WHOIS John Galt posted:

  • Are you using smex to get to your most used commands faster?

Nope, but I don't use that many M-x commands. I use align-regexp, rgrep, query-replace, and that's about it. Oh, besides global-auto-complete-mode when it decides that it's going to freeze my emacs session for 10 seconds with nothing I can do because blocking IO in the UI thread is p. cool design.

WHOIS John Galt posted:

  • Are you using M-x rgrep to quickly navigate your codebase and M-x compile to quickly navigate your compilation warnings and issues?

I love and use rgrep for everything, but it seriously needs to be less buggy. (Try navigating search lines using C-n/C-p and then trying to go to the next result with "n". Doesn't work.) I haven't actually looked for this at all, but I'm a bit annoyed that it replaces previous searches by default rather than giving me a new buffer, and that searching for symbols while in a .cpp file doesn't default to including headers at all. Being smarter about this would really help. Sublime Text and other editors have fuzzy searching for symbols in a project tree built in -- it would be really neat if emacs had the same.

Since the projects I work on use custom build scripts that require accurate ANSI terminal emulation for various reasons, and because there's no good way to have ANSI terminal emulation in emacs, I don't use M-x compile.

WHOIS John Galt posted:

  • Are you using flymake to automatically build your code, or run linters and syntax checkers?

I didn't know flymake could build things, but I used to it to run pylint, and it's annoying because something in my setup got borked and it popped up a dialog for every Python file, except running epylint in a terminal works fine, and I have no idea how to debug it, so I disabled it. Also, looking at it now, it seems that I had to write some code to stop flymake from creating _flymake_flymake files.

I tried to make it run nodelint to help check JavaScript, but it failed for non-emacs reasons. I'd like something like Clang's static analysis tools, but without deep integration like XCode has, I'm iffy to know if it can actually work in realtime.

WHOIS John Galt posted:

  • Do you know how to use the kill ring?

Maybe? I know you can hit C-y and then cycle through the ring with M-y, but if I'm repeatedly copy/pasting stuff, it constantly becomes filled with junk. To give an example, I was pasting some #endif /* MY_DEFINE_THING */ in places over old #endif lines, so my process was C-k C-y M-y, and then when I went to paste the next one, the thing I wasn't to paste wasn't freshly available (it lost a place in line with every old thing I killed), so I had to select the new line, and then hit M-w to copy it. So, my full sequence was C-k C-y M-y C-a C-k C-_ for every repetition. Not fun. Especially if I make a mistake and fat-finger in between the C-y and M-y, which means that I have to undo the C-y, hope I didn't gently caress up the kill ring, and then re-paste so I can M-y again.

I've always felt stressed when I have to deal with clipboard operations, if I have some sensitive data on the clipboard, I have to be careful not to overwrite it by accident, which is easy to do when you have PRIMARY selections in Linux.

WHOIS John Galt posted:

  • Do you know how to use the universal argument of set-mark-command (typically C-SPC) to jump back to your previous place in your file?

If by this you mean C-x C-SPC, yeah, I know about it, but it doesn't help me, because it goes back to the last place I set the mark. So, I have to think before I navigate: "am I going to be coming back here any time soon?", and I'm not one to calculate and think before I go.

Outside of that, I constantly feel I don't "get" the mark/point. Like, given this buffer:

code:
one
two
three
four
five
six
Navigate to three, hit C-SPC, navigate to five, hit C-g to deselect and reset the mark/point, and then hit C-x C-x, and poof, it's back. It seems that C-g doesn't actually reset the mark/point, just hide the highlighting, so when I do an operation that uses the mark/point, it throws me somewhere random, which is where I last hit C-SPC.

WHOIS John Galt posted:

  • Do you know how to record, execute, and repeat macros?

Yes, but it requires me to be calculated up and front about what I really want to do, and it breaks my flow, since one error will kill the entire macro definition process (like a typo in find-forward), and I need to undo a bunch of times to get to a state I can start re-defining a macro again.

Suspicious Dish fucked around with this message at 08:21 on Jan 10, 2013

Catalyst-proof
May 11, 2011

better waste some time with you
Hey, I'm going to try to answer these questions tomorrow. Right now I've gotta pass out but these are all really valid criticisms and I want to see how I have my system configured and how I deal with these situations.

Catalyst-proof
May 11, 2011

better waste some time with you

Suspicious Dish posted:

Nifty. 1) Do they integrate with package.el? 2) I'm very uncomfortable with installing directly from the Emacs Wiki if it still allows anonymous users to overwrite any file.

1) I don't know what you mean by 'integrate'. MELPA is a package repository just like ELPA and Marmalade. You add them to your package-archives list.
2) Yes, Emacs Wiki still allows anonymous users to overwrite any file, but the file is displayed in Emacs before you install it, giving you a chance to see what you're installing. And, like I said, it doesn't just work with Emacs Wiki. It works with any URL, any local file, any local directory.

Suspicious Dish posted:

I tried it for a bit, and didn't really understand it. Interactively doing things is all I do on a computer all day long. Is it just a set of utility helpers for emacs? How can it "make my life easier"?

ido's description is "interactively do things with buffers and files". Its job is to make the finding and opening of files and the management of open buffers easier. So all of its commands are going to be used in find-file or ido-switch-buffer, and are going to involve diving in and finding all the available results for some query, and provide you an incremental search prompt to narrow down your choices quickly. Look at the wiki page I linked to, to see what it provides. It's also a kind of foundation framework for adding its responsive behavior to other things. For example, here's a small function that allows its behavior to be used for quickly looking up entries in a TAGS file.

Lisp code:
  (defun my-ido-find-tag ()
    "Find a tag using ido"
    (interactive)
    (tags-completion-table)
    (let (tag-names)
      (mapatoms (lambda (x)
                  (push (prin1-to-string x t) tag-names))
                tags-completion-table)
      (find-tag (ido-completing-read "Tag: " tag-names))))

Suspicious Dish posted:

No, but it looks neat, and I may eventually try it out. Is it like a semantics mode that jumps to functions and stuff, or is that feature displayed in the screenshot only for Lisp?

I don't know what you mean by 'a semantics mode'. Like most Emacs libraries, imenu is a base that can be expanded on. If an imenu mode doesn't exist for your language of choice, it's super simple to write a function to get it to understand the semantics of your language, so that it can be useful for that particular mode.

Suspicious Dish posted:

Nope, but I don't use that many M-x commands. I use align-regexp, rgrep, query-replace, and that's about it. Oh, besides global-auto-complete-mode when it decides that it's going to freeze my emacs session for 10 seconds with nothing I can do because blocking IO in the UI thread is p. cool design.

You use more than you think, since every single keypress in Emacs executes a command. My apropos search for global-auto-complete turned up nothing, so I have no idea about that, or why it would cause your Emacs session to freeze. Emacs' single thread is an artifact of being like a fifty year old piece of software, and eventually things will change, but that's one of the tradeoffs that you typically decide to make when using it. If your work can't be done as a side-effect of making that trade-off, you should look into another editor.

Suspicious Dish posted:

I love and use rgrep for everything, but it seriously needs to be less buggy. (Try navigating search lines using C-n/C-p and then trying to go to the next result with "n". Doesn't work.) I haven't actually looked for this at all, but I'm a bit annoyed that it replaces previous searches by default rather than giving me a new buffer, and that searching for symbols while in a .cpp file doesn't default to including headers at all. Being smarter about this would really help. Sublime Text and other editors have fuzzy searching for symbols in a project tree built in -- it would be really neat if emacs had the same.

C-n/C-p doesn't make sense in a *grep* buffer. There are several options you have. You can use M-n/M-p to move between matches, and {/} to move between matches by file. Once you find the result you want, just hit RET. There's also C-c C-f, which toggles next-error-follow-minor-mode, which allows you to use C-n/C-p to continually update the match point.

If you want rgrep to append new results to the same buffer, look at rgrep-append. If you want rgrep to create a new buffer for new results, look at grep-a-lot. Emacs has no project modes by default; at least, none that I'm aware of. Emacs Wiki suggests find-file-in-project. I use project-mode. Its description is:

quote:


Project mode allows users to do fuzzy and regex searches on file names and text within a defined set of directories and files that make up the project. Multiple projects can be loaded at the same time and the user can switch back and forth between them.

Suspicious Dish posted:

I didn't know flymake could build things, but I used to it to run pylint, and it's annoying because something in my setup got borked and it popped up a dialog for every Python file, except running epylint in a terminal works fine, and I have no idea how to debug it, so I disabled it. Also, looking at it now, it seems that I had to write some code to stop flymake from creating _flymake_flymake files.

Disabling flymake dialogs is one of the first things that should be part of every user's setup. If I recall correctly unsetting flymake-gui-warnings-enabled should do the trick.

Suspicious Dish posted:

Maybe? I know you can hit C-y and then cycle through the ring with M-y, but if I'm repeatedly copy/pasting stuff, it constantly becomes filled with junk. To give an example, I was pasting some #endif /* MY_DEFINE_THING */ in places over old #endif lines, so my process was C-k C-y M-y, and then when I went to paste the next one, the thing I wasn't to paste wasn't freshly available (it lost a place in line with every old thing I killed), so I had to select the new line, and then hit M-w to copy it. So, my full sequence was C-k C-y M-y C-a C-k C-_ for every repetition. Not fun. Especially if I make a mistake and fat-finger in between the C-y and M-y, which means that I have to undo the C-y, hope I didn't gently caress up the kill ring, and then re-paste so I can M-y again.

I've always felt stressed when I have to deal with clipboard operations, if I have some sensitive data on the clipboard, I have to be careful not to overwrite it by accident, which is easy to do when you have PRIMARY selections in Linux.

I've heard good things about browse-kill-ring for exactly this sort of problem. There's also various ways to bind a key command that will kill text without adding it to the kill ring.

Suspicious Dish posted:

If by this you mean C-x C-SPC, yeah, I know about it, but it doesn't help me, because it goes back to the last place I set the mark. So, I have to think before I navigate: "am I going to be coming back here any time soon?", and I'm not one to calculate and think before I go.

Not C-x C-SPC. The universal argument is C-u. In transient-mark-mode, most navigational commands will set the mark for you, so the whole problem of planning ahead goes away. I can M-<, or use imenu to navigate to a different method, and then C-u C-SPC will bring me back to wherever I was before I navigated away.

Suspicious Dish posted:

Outside of that, I constantly feel I don't "get" the mark/point. Like, given this buffer:

code:
one
two
three
four
five
six
Navigate to three, hit C-SPC, navigate to five, hit C-g to deselect and reset the mark/point, and then hit C-x C-x, and poof, it's back. It seems that C-g doesn't actually reset the mark/point, just hide the highlighting, so when I do an operation that uses the mark/point, it throws me somewhere random, which is where I last hit C-SPC.

My general thought is that you're not comfortable with a lot of Emacs idioms because Emacs seems to do strange things without your understanding of exactly what is happening. I'd dive a bit more into the info docs, as well as using C-h m to look at your available commands in given modes, and M-x customize-group for the modes you use to find out how to tweak settings to make it more comfortable for your workflow. For example, C-g doesn't 'deselect' or 'reset the mark/point', and I'm not sure why you think that they would. C-g aborts execution of Lisp code. That's why it works if you want to cancel a prompt in the mini-buffer. But after you've navigated to five, no Lisp code is running.

EDIT: To be more specific about the mark, the documentation for exchange-point-and-mark states: "Put the mark where point is now, and point where the mark is now. This command works even when the mark is not active, and it reactivates the mark." So while C-g does technically deactivate the mark, C-x C-x doesn't care.

Catalyst-proof fucked around with this message at 18:51 on Jan 10, 2013

BusError
Jan 4, 2005

stupid babies need the most attention

Suspicious Dish posted:

2. I always feel like I'm not getting enough power out of emacs. Like, I just feel like I'm slow at editing. I guess it's the same issue that Love Stole the Day has: I can get by with emacs, and it's pretty OK, but I don't love it. I don't feel at home with it, and I don't feel powerful with it. The various features I thought I would love (like align-regexp) tend to fail in actual real-world tasks I have, so I just do everything manually.

For me, it was never one feature or even a group of features that I learned and said "ahhh THAT'S why those fanatics won't shut up about this thing." It's really been a path of gradual improvement more akin to practicing an instrument than anything else. When I was playing a lot of piano, I had good lessons and bad lessons, but I never had a lesson that made me go "oh ok so now I know the technique that makes me a great pianist." It was just a steady grind made up of intentional, thoughtful practice, and one day a few years later I looked up and realized hey, I was actually sounding pretty decent.

Emacs is like that for me. I've been using it close to 7 years, and for the first 4 I felt like it wasn't really giving me anything beyond Notepad with better color customization. But I always try to reserve one tiny fraction of my attention while I'm working that can think back over what I've just done and look for a better way to approach it. I do this for Emacs, Unix, and programming/writing in general. My comfort level today is a result of several years of extremely tiny, incremental improvements that by themselves are not a convincing case for the editor.

I dunno, that is probably not at all what you are looking for, and I hope you don't take it as dismissive. I just wanted to share my own experience with Emacs, in case there is any value in a more general answer like that.

(although if I absolutely HAD to pick one Emacs feature that could almost sell it for me on its own, it would be Org Mode. If you aren't familiar with it, check out the talks on the official site to get an overview.)

BusError
Jan 4, 2005

stupid babies need the most attention

Not to derail the broader discussion, but ooh! Is that kind of like Command-T for vim (which I think was based on a TextMate feature)? I've been watching Gary Bernhardt's screencasts and experiencing extreme file opening envy.

Adbot
ADBOT LOVES YOU

Catalyst-proof
May 11, 2011

better waste some time with you

BusError posted:

Not to derail the broader discussion, but ooh! Is that kind of like Command-T for vim (which I think was based on a TextMate feature)? I've been watching Gary Bernhardt's screencasts and experiencing extreme file opening envy.

Not exactly. It's more ctags based, but more importantly allows you to say "this is the filesystem boundary that makes up my project files." For TextMate-like features, take a look at http://www.emacswiki.org/TextMate. I'm not a fan of icicles but some people swear by it.

EDIT: Haha does anyone actually use this?

  • Locked thread