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.
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.
What if one buffer was just a view of two others?
Related
I'm a longterm user of Notepad++ and new user of VSCode, where I think the column mode workflow is rather poor. I'm seeking help to reproduce the NPP workflow so far as is possible.
In NPP it goes like this:
hold down AltGR (right hand Alt key)
select column with mouse
copy to clipboard
choose destination top left anchor
paste
Pasting overwrites whatever was there before with the clipped column, which is clear and obvious.
The column always pastes exactly as selected. Whitespace is auto-created before the column if it's pasted into a blank area.
In VSCode I have to
select top or bottom corner of intended column
hold down left hand Alt plus shift
select column with mouse
copy to clipboard
use same technique to choose destination column
paste
I use a mouse in my left hand. The key combination requires a really awkward reach across the keyboard. Attempting to use AltGR as a keybinding shows it to be 'Alt' the same as the key on the left. But it doesn't work as Alt for binding column mode so I can't use the right hand pair.
Unless the destination column is accurately chosen pasting will overwrite with the clipped contents including introduced linebreaks but not respecting the column indentation. For instance clipping a 3 line column and pasting into a 2 line selection produces the most extraordinary mess. Counting lines manually is fine with just two or three but rapidly becomes absurd.
Pasting into a blank area isn't possible.
Pasting into whitespace is governed by indentation rules. I've turned them off, so pasting a column puts the first line in the right place and the rest at the margin. That isn't ever likely to be what's actually wanted.
To my mind the workflow is backwards: in my head it goes 'I want column mode, now I'll choose the column' not 'I'll choose some anchor and then invoke column mode'. Maybe that's just me.
So I'm finding it all very unnatural. Can anyone suggest which if any parts of this can be changed for the better please.
You can use middle-click-drag to do what you want, although it's pretty awful.
Is the behavior of Expand/Collapse Selection customizable? I want quotes to not be selected with an expansion. Also want to use other delimiters like periods, etc.
If a file isn't saved yet Expanding doesn't stop at quotes, but instead selects the entire line. Is this how Expansion is supposed to work with unsaved files?
I doubt the "Expand Select" command is customizable. Shift-Alt-RightArrow It is what it is.
However there is a nice extension that may act the way you want. Look at Expand Region. It will progressively expand or contract the region selected. If within a quoted portion, the first expansion will not select the quotes. It expands by region though, i.e., like scope. So it will not necessarily expand only to the end of the current line if that is what you are looking for.
On wider tables in org mode, it is hard to see the current line.
In emacs org mode table, is there a way to display different background for the current row, or alternate background for even/odd rows?
(I am not concerned with export, although if the even/odd alternate background would export that would be great as well)
Thanks
Not that I know of, but (when editing) you can use M-x hl-line-mode to clearly see the current row highlighted.
The package stripe-buffer provides stripe-table-mode which provides odd/even row highlighting for org tables. (It also gives you stripe-listify-buffer which provides similar row highlighting for any list-style buffer like dired, ibuffer, etc.)
Is there a quick and easy way to word wrap like "Apply Word Wrap" function of KDE's Kate?
Enter to wrapping mode = M-x auto-fill-mode
Wrap text = select text -> M-q
While the mishadoff's answer is great for default word wrapping, I once had to re-implement it because I wasn't content with the way Emacs did it, so I tried to scratch the bits of it together and here it is: http://pastebin.com/75q65hRf in case you need it.
With that bit of code you can configure what characters to wrap on, what characters terminate words, and also set exception rules for when the characters that would've otherwise break the line won't do it. It may also pad the created column on the right and on the left (I was using this function to format and display documentation text).
I have a table in org-mode with emails in one column. I want to collect all the emails as a comma-separated list, but I don't know an easy way to do it. It seems like something fairly simple, but I can't find a solution anywhere on the web.
What would be the simplest way to do it?
Dipping my toes slightly into org mode, a very simple formula of #1.. will do the trick of making a list from the values in the current column from rows 1 onwards, as it simply joins the values by commas by default. e.g.:
#+TBLFM: #5$2=#1..
(followed by C-cC-c to evaluate), would create a list in row 5, column 2, of all the values in column 2.
It does wrap the list in square brackets, but that's obviously no problem for a manual approach.
One manual approach would be to use rectangle editing commands to extract the content of that column (which should be nicely aligned by org-mode), and then just search and replace to convert to CSV format:
C-SPC at first corner
C-xrk at opposite corner
C-/ to undo the kill (there's no default copy-rectangle command)
Then in the buffer where you want the list of addresses:
C-xry to yank the rectangle
C-xC-x to exchange point and mark, marking the region
C-M-% to regex search and replace within the region, like so:
C-M-%SPC*C-qC-jRET,RET!
Does M-x org-table-export do what you want?