Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 1.62 KB

README.org

File metadata and controls

48 lines (32 loc) · 1.62 KB

Partial Horizontal Scroll in Emacs

About

This elisp enables horizontal scrolling in specified parts of buffer even in line-wrapping mode (truncate-lines is nil).

./phscroll-screenshot.gif

Usage

  1. Load phscroll.el (require ‘phscroll)
  2. Select a region you want to horizontal scroll
  3. 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)

In org-mode

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.

Known Issues

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