Re:Why Emacs has buffers
by singaporecode on Tuesday June 07, 2022 @09:23PM
(#31662167)
Although I’d argue that it isn’t necessary for all those functions to be part of the buffer object themselves - they could receive the relevant details vi dynamic extent and not burden the user with an API that requires passing in an Editor State object (which is the key benefit of Emacs - I just don’t see how this is related to the naming of buffers).
(the ‘keep in sync’ part is the reason the additional fields are part of the buffer. Also, the actual implementation may use a gap buffer, rope, or whatever for the string, but that is an implementation detail)
In other words: the Emacs buffer, together with those functions, implements the backend of a text editor. Front-ends could be programming languages calling those functions or UIs that call those functions in response to user key presses, and may show buffer contents on the screen. The standard emacs UI is a mix of the two: a lisp that can call those functions and a binding of key presses to functions (either built-in ones or ones defined in that lisp) to call.