5

In Emacs the point belongs to a window: this allows a buffer to be displayed in two different windows at the same time.

The mark belongs however to the buffer.

Conceptually the mark and a point determines a region. Since the mark belongs to the buffer and not the window, it is not possible to have two independent regions.

What are the benefits of associating the mark with a buffer?

Is there any discussions of this design decision (an old mailing list perhaps)?

Drew
  • 75,699
  • 9
  • 109
  • 225
soegaard
  • 151
  • 5
  • 3
    You can have a [secondary selection](https://www.emacswiki.org/emacs/SecondarySelection). But yes, having regions beeing window specific would come handy some times. – theldoria Jul 24 '18 at 10:10
  • 1
    There are very few window-local variables in C (available to the user). It is possible to implement this if Eli / John / RMS are interested. The window-local variables would be defined in `window.h`, above where it has the comment: "*No Lisp data may follow below this point without changing mark_object in alloc.c.*" [Otherwise, they would occasionally get garbage collected.] I've set up a few window-local variables during the implementation of my own *proposed* new features (drawing crosshairs and multiple fake cursors on only the selected window), which are still a work in process. – lawlist Jul 24 '18 at 17:43
  • 1
    The Elisp manual, node [Window Point](https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Point.html) might be pertinent here. – Drew Jul 24 '18 at 18:21
  • 1
    Thanks for the comments. @Drew Thanks for the link. It shows that a buffer do have a point - it is set from the window point when the window gets focus. – soegaard Jul 27 '18 at 10:36

0 Answers0