Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Runtime of a buffer in emacs

Tags:

emacs

emacs24

Is there a way to find out how long a buffer has been active in Emacs?

M-x list-buffers lists them, but there is no way of deducing how long the buffer has existed for.

like image 544
PascalVKooten Avatar asked Nov 18 '13 13:11

PascalVKooten


People also ask

How many buffer open in Emacs at a time?

At any time, one and only one buffer is selected. It is also called the current buffer. Often we say that a command operates on "the buffer" as if there were only one; but really this means that the command operates on the selected buffer (most commands do).

Can you only have one buffer open in Emacs at a time?

You can have several buffers open at once, but can edit only one at a time. Several buffers can be visible at the same time when you're splitting your window.

What does buffer mean in EMAC?

Buffers in Emacs editing are objects that have distinct names and hold text that can be edited. Buffers appear to Lisp programs as a special data type. You can think of the contents of a buffer as a string that you can extend; insertions and deletions may occur in any part of the buffer.

Can I have more than one buffer in Emacs?

Much better to use the multiple buffer feature of emacs. If you are editing the first file and want to start editing the second file, simply use the hot key C-x C-f or the menu selection File->Open File to start the second file. The second file is loaded into its own buffer.


2 Answers

Yep. But only because I wrote something for ya to do just that. Ok, I wrote it for myself, but have been using it for the past 3-4 years and can't live without it now.

https://github.com/hardaker/elisp-buffer-timer/

like image 109
Wes Hardaker Avatar answered Sep 23 '22 15:09

Wes Hardaker


There is much more convenient mode for listing buffers called ibuffer. One of its built-in mark commands assigned to the . (period) key is 'Mark buffers older than ibuffer-old-time', which is a customizable variable defaulting to 72 hours. The ibuffer mode is included in the standard emacs-24 distribution.

Here is my .emacs snippet:

(when (require 'ibuffer nil 'noerror)
  (define-key global-map "\C-x\C-b" 'ibuffer))
like image 34
Rajish Avatar answered Sep 24 '22 15:09

Rajish