Skip to content

Boruch-Baum/emacs-xhair

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

xhair.el

  • Highlights the current line and column

This package simultaneously applies vline-mode and hl-line-mode, with tweaks, to present POINT in highlighted cross-hairs, reporting the value of POINT as a message in the echo area. This will remain in effect until toggled manually (function xhair-mode by default), or until the next keypress (function xhair by default), or for a set interval (function xhair-flash by default).

Dependencies:

  • vline - for vline-mode

Installation:

  1. Evaluate or load or install this file.

  2. Optionally, define a global keybinding or defalias for any of the commands you intend to use: xhair, xhair-mode, and/or xhair-flash.

         (global-set-key (kbd "foo") 'xhair))
         (defalias 'xhair 'foo)

Operation:

M-x xhair-mode - Apply until manually toggled

M-x xhair - Apply until next keypress

M-x xhair-flash - Apply for a set interval

Refer to the function docstrings for further details.

Configuration:

M-x customize-group xhair

You can customize face xhair-face, variable xhair-flash-interval and variable xhair-eldoc-idle-delay.

Compatibility:

  • Tested on Debian Emacs 27 nox.

  • Operates nicely with yascroll-bar-mode. It temporarily suspends that mode locally in order not to make the buffer display jump around.

  • Operates nicely with eldoc-mode. It delays eldoc messages to give the user time to read the value of POINT from the echo area.

Feedback:

  • It's best to contact me by opening an 'issue' on the package's github repository or, distant second-best, by direct e-mail.

  • Code contributions are welcome and github starring is appreciated.

Antecedent:

This package is based upon `crosshairs.el' by Drew Adams, available at:

 https://www.emacswiki.org/emacs/download/crosshairs.el

Its main differences from Drew's package is that it:

  • Is MELPA-friendly
  • Reduces dependencies
  • Reduces features (notably: crosshairs-toggle-when-idle)
  • Simplifies code-base
  • Applies a single unique face, by default
  • Suspends yascroll-bar-mode, to not interfere with vline-mode
  • Reports POINT for all navigation for duration of mode
  • Delays eldoc-mode messages, to not interfere with reporting POINT
  • Suppresses output to Messages buffer
  • Changes documentation
  • Eschews all use of macro `define-minor-mode'

Colophon:

Some other Emacs software that I've published

About

Highlight the current line and column

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published