Emacs tips and tricks

Forum rules
Share your brain ;)
User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Sun Oct 05, 2014 9:31 am

^ Oh, thanks for that. Way better than my dirty solution:

Code: Select all

(defun read-lines (filePath)
  "Return a list of lines of a file at filePath."
  (with-temp-buffer
    (insert-file-contents filePath)
    (split-string (buffer-string) "\n")))

(let ((acc (read-lines "~/.my-erc-account")))
  (setq erc-nick (car acc)))
I added the nickname, because username and irc nickname on my machine are different. But who cares, a very lovely solution. Thanks Joe.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Emacs tips and tricks

Unread post by machinebacon » Sun Oct 05, 2014 10:48 am

^ lol, had the same problem yesterday night and solved it exactly like you :D

Thanks DebJoe for the ercmod.
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Wed Oct 08, 2014 3:10 pm

If you use dired a lot this could be useful: http://endlessparentheses.com/auto-focu ... ffers.html

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Mon Oct 13, 2014 7:10 pm

Sometimes I like to use eshell over tramp to connect to my server. Once on the remote system, it was tricky to execute scripts in the current working directory. Here is the solution: http://emacs.stackexchange.com/a/2114/219

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Wed Oct 15, 2014 6:10 pm

This for dkeg and whoever feels like an artist: http://emacs-theme-creator.appspot.com/

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Emacs tips and tricks

Unread post by DebianJoe » Wed Oct 15, 2014 11:24 pm

...oh, that's a cool little tool.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Mon Oct 20, 2014 8:44 pm

Emacs 24.4 officially released: http://ftp.gnu.org/gnu/emacs/

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Emacs tips and tricks

Unread post by machinebacon » Tue Oct 21, 2014 7:55 am

https://github.com/pierre-lecocq/emacs4developers

"A document to help developers to use Emacs as a developer“
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Tue Oct 21, 2014 10:19 am

^ thanks.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Emacs tips and tricks

Unread post by machinebacon » Wed Oct 22, 2014 10:53 am

Code: Select all

emacs24-nox:
  Version table:
     24.4+1-1 0
          1 http://http.debian.net/debian/ experimental/main i386 Packages
So, we can

Code: Select all

sudo apt-get install -t experimental emacs24-YOUR_TOOLKIT
:)
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Wed Oct 22, 2014 2:53 pm

Question for you Emacsers out there: anyone using gnus for mail reading? I should go with wanderlust and STFU? Just want to know your opinion. :)

Mutt is lovely, but since I've been using elfeed for RSS lately, I was wondering about switching my mail reading to Emacs as well.

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Emacs tips and tricks

Unread post by DebianJoe » Wed Oct 22, 2014 3:00 pm

I have used Gnus previously, and then started using wanderlust. Take from that what you will. ^_^
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Emacs tips and tricks

Unread post by machinebacon » Wed Oct 22, 2014 4:24 pm

Think we are in the same boat here. Previously mutt, then cone. Recently I do the wanderer. Gnus I have set up on my netbook for pure TTY-ing, and I've used this: http://www.emacswiki.org/emacs/GnusGmail

Probably it makes sense if you follow newsgroups, for mail only it seems a bit too heavy. ALso, I needed to change the display options (partly light gray letters on white background for mails from google)
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Wed Oct 22, 2014 4:51 pm

Thanks guys.
I'll see if I can setup wanderlust using Joe's walkthrough. I thought gnus had to be my choice because is already there in Emacs, while wanderlust requires extra dependencies.

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Fri Oct 24, 2014 5:26 pm

Ok, to me this is crazy. And I'm not sure it will last but, as Pidsley says, this is a proof of concept.

Always looking for a reason not to leave Emacs during my daily activities, I got myself into emms: Emacs Multimedia System.
What is this? Just another way for me to listen to my mp3s, this time straight inside Emacs. Let's go.

Code: Select all

M-x package-install RET emms RET
I got this in my init file:

Code: Select all

(require 'emms-setup)
(emms-standard)
(emms-default-players)
(setq emms-source-file-default-directory "~/music/")
Adjust the path accordingly, of course.
What I do now is adding the record I want to listen to to the emms playlist:

Code: Select all

M-x emms-add-directory-tree
Almost there. Now go with:

Code: Select all

M-x emms
And your playlist comes up. Refer to this page for how to interact with the playlist. Or simply hit RET and enjoy your music.
So many other things you can do with emms. Check the manual to learn more.

This is also worth mention: https://github.com/dbrock/bongo

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Emacs tips and tricks

Unread post by machinebacon » Sat Oct 25, 2014 1:04 am

I was just wondering the other day who else uses emms :) I also added mpg123-el into the mix, and via emacspeak direct shortcuts to the BBC radio streams.
..gnutella..

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Emacs tips and tricks

Unread post by DebianJoe » Sat Oct 25, 2014 5:48 am

I tie hoomegrown playlist scripts into my keybinds (which just fork mpg123 processes), but I've not tried emms yet. Cool stuff!
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Emacs tips and tricks

Unread post by DebianJoe » Wed Oct 29, 2014 5:01 pm

Ok, slight change to this iswitchb hack due to iswitchb being made obsolete.

Just use ido mode and C^d to activate dired when opening files, or just C^x C^f C^f to make it act like ido find file wasn't active at all (fuzzy matches are cool, though). Pretty much the same thing, but with one more keystoke combo than how I was used to doing it.

Original post redirected here, as iswitchb is going the way of the dodo.

Code: Select all

(setq ido-enable-flex-matching t)
(ido-mode 1)
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Emacs tips and tricks

Unread post by GekkoP » Wed Oct 29, 2014 5:28 pm

^ I love ido-mode. :)

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Emacs tips and tricks

Unread post by DebianJoe » Fri Oct 31, 2014 11:45 am

Ohh, here's a cool one. Assuming that you like eshell and (like I am right now) getting into mixing elisp with shell commands to make the standard eshell a bit more powerful, then you can set it up to emulate Plan 9's Smart Shell, which allows you to treat the eshell prompt more like a REPL by having it return to the last incorrect command after a failed command.
2014-10-31-053033_1024x768_scrot.png
The example of it in use is on the lower right, as I've made a few failed 'fake predicate sed' lists, and it automatically returns the failed command for repair after a 'nil' return value. It makes much more sense when you see it than in explanation. The stuff highlighted on the left is what to add to the init (however you like to init) to get said functionality.

Edit: and looks like I also highlighted the [f2] binding for eshell, but that's just how I am doing it. That part isn't necessary.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

Post Reply