changeset 3753:16948869ab5b

* buffer.c (list_buffers_1): Return the desired point. (Flist_buffers): Put point there in the buffer summary.
author Jim Blandy <jimb@redhat.com>
date Wed, 16 Jun 1993 16:29:40 +0000
parents 3ce509de88ec
children 200d504045b9
files src/buffer.c
diffstat 1 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c	Wed Jun 16 15:45:33 1993 +0000
+++ b/src/buffer.c	Wed Jun 16 16:29:40 1993 +0000
@@ -1106,11 +1106,7 @@
 
   current_buffer->read_only = Qt;
   set_buffer_internal (old);
-/* Foo.  This doesn't work since temp_output_buffer_show sets point to 1
-  if (desired_point)
-    XBUFFER (Vstandard_output)->text.pointloc = desired_point;
- */
-  return Qnil;
+  return make_number (desired_point);
 }
 
 DEFUN ("list-buffers", Flist_buffers, Slist_buffers, 0, 1, "P",
@@ -1124,9 +1120,18 @@
   (files)
      Lisp_Object files;
 {
-  internal_with_output_to_temp_buffer ("*Buffer List*",
-				       list_buffers_1, files);
-  return Qnil;
+  int count = specpdl_ptr - specpdl;
+  Lisp_Object desired_point;
+
+  desired_point =
+    internal_with_output_to_temp_buffer ("*Buffer List*",
+					 list_buffers_1, files);
+
+  record_unwind_protect (save_excursion_restore, save_excursion_save ());
+  Fset_buffer (build_string ("*Buffer List*"));
+  SET_PT (XINT (desired_point));
+  
+  return unbind_to (count, Qnil);
 }
 
 DEFUN ("kill-all-local-variables", Fkill_all_local_variables, Skill_all_local_variables,