News for hackers. Stuff that matters.
Re:Why Emacs has buffers by Someone on Tuesday June 07, 2022 @02:45PM (#31658484)
I think a better way to describe Emacs buffers is: Emacs has a structure called buffer that logically contains a string and various fields useful for use in a text editor (e.g. to mark positions in the string) and many, many functions working on such a struct that keep the additional fields in sync with the string content (e.g. moving marked positions when characters are inserted) and are geared towards using that structure in a text editor.

(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.

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).