Going to the Beginning and End of Special Buffers

Way back in 2013 Magnar Sveen published a nice bit of Elisp for moving to the beginning and end of a dired buffer. By beginning and end, he meant the logical beginning and end: the first and last line of file or directory listings. I immediately stole that and modified it to do the same thing for ibuffer buffers.

Now Fuco has published a set of macros that implements the same thing for a wide variety of other special buffers. The macros are actually nicer because the first time you press Meta+< or Meta+>, you will move to the logical beginning or end of the buffer. If you press it again, you will move to the physical beginning or end so you get the best of both worlds.

Fuco gives several examples of using the macros for various types of buffers so even if you don’t know much Elisp, you can easily implement the behavior for most buffer types that you’re apt to care about.

Oddly, looking at my original post on ripping off Sveen’s code for ibuffer buffers from 2014, I see that Fuco made a comment pointing to these macros. Now he’s posted about them and given examples for anyone who’s interested to use. If you use dired, ibuffer, occur, vc-dir, agenda, or other special buffers a lot, you may be interested in his solution. Be sure to give his post a read.

UPDATE [2017-05-07 Sun 20:33]: Fixed the links.

This entry was posted in General and tagged . Bookmark the permalink.
  • Fuco

    After all the years I finally decided it would be a good idea to start a blog :D I had a comment over this code for 3 years I think so it was one of the first things I processed.

    Cheers and thanks for the highlight! :)

    • jcs

      I'm really glad you're blogging now. I always learn something new from you. I wish you had an RSS feed but I don't know if that's possible with your setup.

      • Fuco

        RSS is on my todo-list. I use org-publish and it seems there is an ox-rss so I just need to plug it together somehow.

        For now you can follow me on twitter :P

      • Fuco
        • jcs

          Ah, excellent!

  • Fuco

    (also it seems you goofed the links a bit, all of them point to my article)

    • jcs

      Thanks for the heads up. They're fixed now. I have no idea how that happened.

  • Damien Cassou

    You might want to use my beginend package (https://github.com/DamienCassou/beginend) for Emacs.