Ejemplo n.º 1
0
		public Buffer (Shelisp.Object name)
		{
			/* An ordinary buffer uses its own struct buffer_text.  */
			text = new BufferText();

			pt = BufferText.BEG;
			begv = BufferText.BEG;
			zv = BufferText.BEG;
			pt_byte = BufferText.BEG;
			begv_byte = BufferText.BEG;
			zv_byte = BufferText.BEG;

#if notyet
			newline_cache = 0;
			width_run_cache = 0;
#endif
			width_table = L.Qnil;
			prevent_redisplay_optimizations_p = true;

			/* An ordinary buffer normally doesn't need markers
			   to handle BEGV and ZV.  */
			pt_marker = L.Qnil;
			begv_marker = L.Qnil;
			zv_marker = L.Qnil;

			undo_list = (L.SREF (name, 0) != ' ') ? L.Qnil : L.Qt;

			Reset ();
			ResetLocalVariables (permanent_too: true);

			mark = new Marker ();

			this.name = name;
		}
Ejemplo n.º 2
0
		public Buffer (Shelisp.Object name, Shelisp.Object buffer)
		{
			this.base_buffer = (((Buffer)buffer).base_buffer != null
					    ? ((Buffer)buffer).base_buffer
					    : ((Buffer)buffer));

			/* Use the base buffer's text object.  */
			text = base_buffer.text;

			pt = base_buffer.pt;
			begv = base_buffer.begv;
			zv = base_buffer.zv;
			pt_byte = base_buffer.pt_byte;
			begv_byte = base_buffer.begv_byte;
			zv_byte = base_buffer.zv_byte;

#if notyet
			newline_cache = 0;
			width_run_cache = 0;
#endif
			width_table = L.Qnil;

			Reset ();
			ResetLocalVariables (permanent_too: true);

			mark = new Marker ();
			this.name = name;

			/* The multibyte status belongs to the base buffer.  */
			enable_multibyte_characters = base_buffer.enable_multibyte_characters;

			/* Make sure the base buffer has markers for its narrowing.  */
			if (L.NILP (base_buffer.pt_marker)) {
#if notyet
				eassert (NILP (BVAR (base_buffer, begv_marker)));
				eassert (NILP (BVAR (base_buffer, zv_marker)));
#endif

				base_buffer.pt_marker = new Marker ();
				Marker.SetBoth (base_buffer.pt_marker, buffer,
						base_buffer.pt,
						base_buffer.pt_byte);

				base_buffer.begv_marker = new Marker ();
				Marker.SetBoth (base_buffer.begv_marker, buffer,
						base_buffer.begv,
						base_buffer.begv_byte);

				base_buffer.zv_marker = new Marker ();
				Marker.SetBoth (base_buffer.zv_marker, buffer,
						base_buffer.zv,
						base_buffer.zv_byte);
				((Marker)base_buffer.zv_marker).Type = Marker.InsertionType.MarkerAdvancesOnTextInsertion;
			}
		}