Jeffrey Benjamin Brown
Jeffrey Benjamin Brown

Reputation: 3709

Emacs "strongly read-only" text: No highlight, no cursor access

I would like to make a column on the left side of the buffer "strongly read-only". The cursor should not be able to go there. A multi-line highlight should skip the column. Text search should skip the column. Etc.

Is it possible?

Each row of the column carries information about the corresponding line of the original buffer. I considered making the column into a separate vertical buffer, but then I would have to worry about keeping them in vertical sync.

I imagine including the column of predecessor counts in the text buffer, as ordinary text. If I did that, I would have to rewrite a lot of commands (cursor movement, highlight, text search, ...) to ignore the column.

I found how to make a region "weakly read-only", such that it can be copied and searched, just not edited.

Upvotes: 2

Views: 134

Answers (2)

Stefan
Stefan

Reputation: 28531

Sounds like you just want to use the margin. Look it up in the Emacs Lisp manual (info "(elisp)Display Margins"). Or check C-h o set-window-margins RET and the documentation of the display text-property.

Upvotes: 1

Jeffrey Benjamin Brown
Jeffrey Benjamin Brown

Reputation: 3709

What if one buffer was just a view of two others?

Upvotes: 0

Related Questions