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
Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Notorious b.s.d. posted:

Use emacs 'desktop' instead. It will save all of your frames / windows + all open buffers. You can easily set it to save periodically in the background.

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).

Adbot
ADBOT LOVES YOU

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

horse mans posted:

Is there some kind of function or advice which is run when something is drag-and-dropped onto Emacs' application icon on OS X? I want its behavior for files to be the same as usual, but for directories I want it to open a new frame and present a Sublime-like directory tree and load in directory-specific symbol and file search.

Does this help? https://www.gnu.org/software/emacs/manual/html_node/emacs/Mac-_002f-GNUstep-Events.html

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Does anyone have any tips for getting TRAMP to autocomplete with plink.exe? I've looked through the docs, but they are supremely unhelpful.

It'd be killer if it could autocomplete paths on the target machines (e.g. by opening an SSH connection once I typed the hostname and hit tab), but I'd be happy with just autocompleting the hostnames.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Notorious b.s.d. posted:

Tramp autocompletes paths just fine for me.

I'm using the regular openssh client on linux.

Yeah, it's probably mainly because I'm using this to remote from Windows, via plink.exe, to my Linux VM. The docs just don't say much about the plink case.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

tak posted:

probably C:\Windows\system32\drivers\etc\hosts

Unfortunately, for plink it's not that simple, since plink's session names (which emacs uses for the host name part of the TRAMP path) aren't necessarily related to the server's host name; they're just arbitrary names you type into putty. They're also stored in the Windows registry, but I think you can make them be stored in a file instead.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

brae posted:

I have a Windows 8 VM and was able to write some elisp that grabs hostnames from the registry where Putty stores them (after Google told me where that was).

Here's a gist. I wasn't able to get tramp configured to hook in the completion there, but you could try this function out in emacs to see what it returns for you and maybe try hooking it into tramp's completion.

Sorry for taking so long to reply, but this is definitely a good start. I haven't gotten it working yet either, but this at least points me in the right direction. If I figure it out, maybe I can host it on MELPA or something...

EDIT: Ok, this is really weird. It looks like emacs already has support for autocompletion for plinkx via tramp-parse-putty, but it's not working for some reason...

EDITx2: So far, I've narrowed the issue down to (find-file-name-handler "/" 'file-name-all-completions) returning nil on Windows, but tramp-completion-file-name-handler on Linux.

Avenging Dentist fucked around with this message at 00:10 on Feb 13, 2015

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Ok, I finally figured it out: emacs on Windows takes a "/" and converts it to a Windows-style path (e.g. "C:/"), which TRAMP tries to detect with a regexp in file-name-handler-alist, but the regexp is wrong. Replacing it like so gives me autocompletion of host names:

code:
(setf (car (rassoc 'tramp-completion-file-name-handler
                   file-name-handler-alist))
      "\\`.:/[^/]*\\'")
Next up, figuring out how to expand paths from the server without having to explicitly connect to it first. (e: If anyone knows how to do that, or if it's even possible, let me know.)

Avenging Dentist fucked around with this message at 05:30 on Feb 13, 2015

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Mr. Fish posted:

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

Wait. How do you close your server by accident? I've literally never had this issue (on Windows anyway). I guess we must have different configs.

Here's what I do: http://www.emacswiki.org/emacs/EmacsClient#toc16 (plus server-start in my .emacs, of course). Apparently I run the following command when double-clicking a text file in the Explorer to open it in emacs:

code:
"C:\Program Files (x86)\emacs\bin\emacsclientw.exe" -n --alternate-editor="C:\Program Files (x86)\emacs\bin\runemacs.exe" "%1"

Avenging Dentist fucked around with this message at 21:26 on Mar 2, 2015

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

bigperm posted:

First, I am on windows 7 and emacs uses %appdata% for the .emacs file and... home directory. This is driving me crazy because I think there is a disconnect between what windows considers 'user space' and what emacs wants is totally different and I can't seem to wrap my head around what I need to do.

Set your HOME env var: https://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-HOME.html

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Post your .emacs and we can take a look. If I had to guess, you hosed up the syntax somewhere and your .emacs isn't being executed.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Try http://melpa.org/packages/ instead of https. See this bug.

There are surely better ways than not using HTTPS, but since you probably don't want to debug SSL issues right now, using HTTP should be simpler.

e: Updated link to a more-relevant bug report.

Avenging Dentist fucked around with this message at 02:17 on Sep 22, 2016

Adbot
ADBOT LOVES YOU

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
After reading the bug report some more, it seems like this might be resolved in emacs 25 on Windows, so if you're on 24, you could try upgrading if you want to use the HTTPS link for MELPA.

I don't use darkroom-mode, so I can't help you much there.

  • Locked thread