mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Buffers


Chronological Thread 
  • From: Karl Hegbloom <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] Buffers
  • Date: Fri, 30 Dec 2005 04:31:32 -0800

On Wed, 2005-12-14 at 14:10 +0100, Javier Arantegui wrote:
> I know what a buffer solution or a buffer tank are, but I''m not sure if I
> know exactly what a buffer is in TeXmacs/Emacs. Is it correct to say that
> buffers are documents in *macs-ese?

Once upon a time, a "buffer" was a thick, padded, leather garment made
from buffalo hide. It was worn in battle to protect the wearer from
being buffeted to death by hackers...

Later, on into computer jargon, it came to mean a region of memory used
to hold data that is being streamed to an input/output device, where the
rate at which the data is arriving is faster than the rate at which the
device can accept the data. The data queues up in the buffer, and
streams out to the device at the slower rate until the buffer empties.

In Emacs parlance, a buffer is simply a chunk of RAM that the disk file
is loaded into when you visit it for editing. The buffer is actually
larger than the file, and a gap is maintained at the cursor position,
leaving some room for the insertion of new characters. Without the
buffer gap, every time you typed a character the editor program would
have to move every character following the cursor up a byte in memory.
The result would be a very slow editor.

The Emacs manual explains the terminology fairly well. Try 'info emacs'
to view it, or google for an online copy.

> One confusing thing about TeXmacs interface is --when you are going to open
> a
> new file-- you can use File -> Load... (shortcut F2) or the icon bar, click
> on the 'Load a file' button -> Load buffer... (F2). What am I loading? A
> document? A buffer? A file? I think that this mixed semantics is a little
> bit
> confusing for the new users used to office suites.

You are loading the contents of a file into a buffer. In my mind, the
document is a larger, outer abstraction that encompasses "file",
"buffer", "window", and "display". The file is loaded into the buffer,
and the contents of that buffer are displayed in a window. When you
print the document, it is displayed on the printer.

> Do you think that it's important to mantain the 'buffer' concept? Maybe it
> could be substituted by 'document' or 'file'.

Perhaps, though the distinction becomes more important when it comes to
extending the editor with Scheme programs. Teach a man to farm and
he'll grow as much food as he needs.

--
Karl Hegbloom <address@hidden>




Archive powered by MHonArc 2.6.19.

Top of page