comparison src/buffer.c @ 9262:582534b6e763

(Fget_buffer_create, Frename_buffer, Fbuffer_disable_undo, Fbuffer_enable_undo, Fcurrent_buffer, Fbury_buffer, Fmake_overlay, init_buffer_once): Use new accessor macros instead of calling XSET directly.
author Karl Heuer <kwzh@gnu.org>
date Tue, 04 Oct 1994 11:54:19 +0000
parents c7bfa0da167b
children a1a7fc21ded9
comparison
equal deleted inserted replaced
9261:e5ba7993d378 9262:582534b6e763
262 262
263 reset_buffer (b); 263 reset_buffer (b);
264 reset_buffer_local_variables (b); 264 reset_buffer_local_variables (b);
265 265
266 /* Put this in the alist of all live buffers. */ 266 /* Put this in the alist of all live buffers. */
267 XSET (buf, Lisp_Buffer, b); 267 XSETBUFFER (buf, b);
268 Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); 268 Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
269 269
270 b->mark = Fmake_marker (); 270 b->mark = Fmake_marker ();
271 b->markers = Qnil; 271 b->markers = Qnil;
272 b->name = name; 272 b->name = name;
609 609
610 /* Catch redisplay's attention. Unless we do this, the mode lines for 610 /* Catch redisplay's attention. Unless we do this, the mode lines for
611 any windows displaying current_buffer will stay unchanged. */ 611 any windows displaying current_buffer will stay unchanged. */
612 update_mode_lines++; 612 update_mode_lines++;
613 613
614 XSET (buf, Lisp_Buffer, current_buffer); 614 XSETBUFFER (buf, current_buffer);
615 Fsetcar (Frassq (buf, Vbuffer_alist), name); 615 Fsetcar (Frassq (buf, Vbuffer_alist), name);
616 if (NILP (current_buffer->filename) 616 if (NILP (current_buffer->filename)
617 && !NILP (current_buffer->auto_save_file_name)) 617 && !NILP (current_buffer->auto_save_file_name))
618 call0 (intern ("rename-auto-save-file")); 618 call0 (intern ("rename-auto-save-file"));
619 /* refetch since that last call may have done GC */ 619 /* refetch since that last call may have done GC */
661 register Lisp_Object buffer; 661 register Lisp_Object buffer;
662 { 662 {
663 Lisp_Object real_buffer; 663 Lisp_Object real_buffer;
664 664
665 if (NILP (buffer)) 665 if (NILP (buffer))
666 XSET (real_buffer, Lisp_Buffer, current_buffer); 666 XSETBUFFER (real_buffer, current_buffer);
667 else 667 else
668 { 668 {
669 real_buffer = Fget_buffer (buffer); 669 real_buffer = Fget_buffer (buffer);
670 if (NILP (real_buffer)) 670 if (NILP (real_buffer))
671 nsberror (buffer); 671 nsberror (buffer);
684 register Lisp_Object buffer; 684 register Lisp_Object buffer;
685 { 685 {
686 Lisp_Object real_buffer; 686 Lisp_Object real_buffer;
687 687
688 if (NILP (buffer)) 688 if (NILP (buffer))
689 XSET (real_buffer, Lisp_Buffer, current_buffer); 689 XSETBUFFER (real_buffer, current_buffer);
690 else 690 else
691 { 691 {
692 real_buffer = Fget_buffer (buffer); 692 real_buffer = Fget_buffer (buffer);
693 if (NILP (real_buffer)) 693 if (NILP (real_buffer))
694 nsberror (buffer); 694 nsberror (buffer);
932 DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0, 932 DEFUN ("current-buffer", Fcurrent_buffer, Scurrent_buffer, 0, 0, 0,
933 "Return the current buffer as a Lisp object.") 933 "Return the current buffer as a Lisp object.")
934 () 934 ()
935 { 935 {
936 register Lisp_Object buf; 936 register Lisp_Object buf;
937 XSET (buf, Lisp_Buffer, current_buffer); 937 XSETBUFFER (buf, current_buffer);
938 return buf; 938 return buf;
939 } 939 }
940 940
941 /* Set the current buffer to b */ 941 /* Set the current buffer to b */
942 942
1029 register Lisp_Object buf; 1029 register Lisp_Object buf;
1030 { 1030 {
1031 /* Figure out what buffer we're going to bury. */ 1031 /* Figure out what buffer we're going to bury. */
1032 if (NILP (buf)) 1032 if (NILP (buf))
1033 { 1033 {
1034 XSET (buf, Lisp_Buffer, current_buffer); 1034 XSETBUFFER (buf, current_buffer);
1035 1035
1036 /* If we're burying the current buffer, unshow it. */ 1036 /* If we're burying the current buffer, unshow it. */
1037 Fswitch_to_buffer (Fother_buffer (buf, Qnil), Qnil); 1037 Fswitch_to_buffer (Fother_buffer (buf, Qnil), Qnil);
1038 } 1038 }
1039 else 1039 else
1780 { 1780 {
1781 Lisp_Object overlay; 1781 Lisp_Object overlay;
1782 struct buffer *b; 1782 struct buffer *b;
1783 1783
1784 if (NILP (buffer)) 1784 if (NILP (buffer))
1785 XSET (buffer, Lisp_Buffer, current_buffer); 1785 XSETBUFFER (buffer, current_buffer);
1786 else 1786 else
1787 CHECK_BUFFER (buffer, 2); 1787 CHECK_BUFFER (buffer, 2);
1788 if (MARKERP (beg) 1788 if (MARKERP (beg)
1789 && ! EQ (Fmarker_buffer (beg), buffer)) 1789 && ! EQ (Fmarker_buffer (beg), buffer))
1790 error ("Marker points into wrong buffer"); 1790 error ("Marker points into wrong buffer");
1839 1839
1840 CHECK_OVERLAY (overlay, 0); 1840 CHECK_OVERLAY (overlay, 0);
1841 if (NILP (buffer)) 1841 if (NILP (buffer))
1842 buffer = Fmarker_buffer (OVERLAY_START (overlay)); 1842 buffer = Fmarker_buffer (OVERLAY_START (overlay));
1843 if (NILP (buffer)) 1843 if (NILP (buffer))
1844 XSET (buffer, Lisp_Buffer, current_buffer); 1844 XSETBUFFER (buffer, current_buffer);
1845 CHECK_BUFFER (buffer, 3); 1845 CHECK_BUFFER (buffer, 3);
1846 1846
1847 if (MARKERP (beg) 1847 if (MARKERP (beg)
1848 && ! EQ (Fmarker_buffer (beg), buffer)) 1848 && ! EQ (Fmarker_buffer (beg), buffer))
1849 error ("Marker points into wrong buffer"); 1849 error ("Marker points into wrong buffer");
2443 are initialized reasonably, so mark_buffer won't choke. */ 2443 are initialized reasonably, so mark_buffer won't choke. */
2444 reset_buffer (&buffer_defaults); 2444 reset_buffer (&buffer_defaults);
2445 reset_buffer_local_variables (&buffer_defaults); 2445 reset_buffer_local_variables (&buffer_defaults);
2446 reset_buffer (&buffer_local_symbols); 2446 reset_buffer (&buffer_local_symbols);
2447 reset_buffer_local_variables (&buffer_local_symbols); 2447 reset_buffer_local_variables (&buffer_local_symbols);
2448 XSET (Vbuffer_defaults, Lisp_Buffer, &buffer_defaults); 2448 XSETBUFFER (Vbuffer_defaults, &buffer_defaults);
2449 XSET (Vbuffer_local_symbols, Lisp_Buffer, &buffer_local_symbols); 2449 XSETBUFFER (Vbuffer_local_symbols, &buffer_local_symbols);
2450 2450
2451 /* Set up the default values of various buffer slots. */ 2451 /* Set up the default values of various buffer slots. */
2452 /* Must do these before making the first buffer! */ 2452 /* Must do these before making the first buffer! */
2453 2453
2454 /* real setup is done in loaddefs.el */ 2454 /* real setup is done in loaddefs.el */