diff src/buffer.c @ 5214:0b4d355771bd

Import buffer-display-count, buffer-display-time; thank you, Jeff Sparkes. man/ChangeLog addition: 2010-05-17 Jeff Sparkes <jsparkes@gmail.com> * lispref/windows.texi (Buffers and Windows): Document buffer-display-count and buffer-display-time with descriptions from GNU emacs lispref. * lispref/locals.texi (Standard Buffer-Local Variables): Add buffer-display-count and buffer-display-time. src/ChangeLog addition: 2010-05-17 Jeff Sparkes <jsparkes@gmail.com> * buffer.c (complex_vars_of_buffer): Add buffer local variables buffer-display-count and buffer-display-time. (common_init_complex_vars_of_buffer): Initialize them here. * bufslots.h: Add slots for buffer-display-count and buffer-display-time. * window.c (Fset_window_buffer): Update buffer-display-count and buffer-display-time whenever a buffer is displayed.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 28 May 2010 13:48:22 +0100
parents 71ee43b8a74d
children d804e621add0
line wrap: on
line diff
--- a/src/buffer.c	Mon May 24 10:43:29 2010 +0200
+++ b/src/buffer.c	Fri May 28 13:48:22 2010 +0100
@@ -2307,6 +2307,8 @@
 #ifdef MULE
     buffer_local_flags.category_table	= resettable;
 #endif
+    buffer_local_flags.display_time     = always_local_no_default;
+    buffer_local_flags.display_count    = make_int (0);
 
     buffer_local_flags.modeline_format		  = make_int (1<<0);
     buffer_local_flags.abbrev_mode		  = make_int (1<<1);
@@ -2800,6 +2802,18 @@
 set when a file is visited.  Automatically local in all buffers.
 */ );
 
+  DEFVAR_BUFFER_LOCAL ("buffer-display-count", display_count /*
+A number incremented each time this buffer is displayed in a window.
+The function `set-window-buffer' updates it.
+*/ );
+
+  DEFVAR_BUFFER_LOCAL ("buffer-display-time", display_time /*
+Time stamp updated each time this buffer is displayed in a window.
+The function `set-window-buffer' updates this variable
+to the value obtained by calling `current-time'.
+If the buffer has never been shown in a window, the value is nil.
+*/);
+
   DEFVAR_BUFFER_LOCAL_MAGIC ("buffer-invisibility-spec", invisibility_spec /*
 Invisibility spec of this buffer.
 The default is t, which means that text is invisible