0

Ibuffer is great, I use it with filter groups which work great. I call Ibuffer using by a keypress, the problem is that the cursor is always on the first buffer in the first category. What I need is that it is on the buffername which it was called from. I mean if I'm in notes.org and call ibuffer the cursor should be on notes.org.

Any variables that can help me out there? I couldn't find any. I assume elisp is needed to solve it but I have no ability to code.

  • The first buffer in *Ibuffer* should be the buffer from which you invoked ibuffer. Is this not the case for you? – Tianxiang Xiong Mar 28 '17 at 19:39
  • Yeah, by default point should be on the first buffer in the list which should be the one you started from. Have you configured ibuffer-filter-groups or something similar? I wonder if that's changed the behaviour... – stevoooo Mar 28 '17 at 20:40
  • Yes, I configured setq ibuffer-saved-filter-groups. – Jens Lange Mar 29 '17 at 0:24
2

By default ibuffer will sort by recency and start at the first line, which would be the buffer you just came from. Customizing ibuffer -- for example, changing the default sort order -- may result in different behavior.

You can define an ibuffer hook to always jump to the most recent buffer with something like this:

(defun ibuffer-jump-to-last-buffer ()
  (ibuffer-jump-to-buffer (buffer-name (cadr (buffer-list)))))

(add-hook 'ibuffer-hook #'ibuffer-jump-to-last-buffer)

You might also be interested in customizing ibuffer-always-show-last-buffer, which ensures that the most recent buffer is displayed in the ibuffer list even if some other filter would have excluded it.

  • Your elisp function works like hell, it's now a permanent part of my configuration.org. Thank you so much. I'll have a look at that variable too, never had such a problem though - yet. – Jens Lange Mar 29 '17 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.