This elisp enables horizontal scrolling in specified parts of buffer even in line-wrapping mode (truncate-lines is nil).
- Load phscroll.el (require ‘phscroll)
- Select a region you want to horizontal scroll
- M-x phscroll-region
Other commands:
- M-x phscroll-delete-all : Delete all scrolling area in the current buffer
- M-x phscroll-delete-at : Delete a scrolling area at point
- M-x phscroll-update-at : Update (redraw) a scrolling area at point
The following keys are available in scrolling area:
- C-x < (M-x phscroll-scroll-left)
- C-x > (M-x phscroll-scroll-right)
- C-l (M-x phscroll-recenter-top-bottom)
- C-S-l (M-x phscroll-recenter-left-right)
The following elisp enables horizontal scrolling in table parts of org-mode documents. By setting org-startup-truncated to nil, other parts will be displayed in wrapping.
(setq org-startup-truncated nil)
(with-eval-after-load "org"
(require 'org-phscroll))
Tips:
- To turn off the effect of phscroll, use M-x org-phscroll-mode.
- To scroll the current position of the screen to the left edge, press C-S-l twice.
- Incorrect display when viewing the same area from multiple windows with different widths
- Incorrect display when used with various text properties and overlays.
- Performance degradation
phscroll forcibly realizes partial horizontal scrolling, which is not possible originally. It’s interesting that it’s still somewhat usable, but ideally Emacs should have a text property that controls line wrapping.