all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* display line and column numbers together with ruler and whitespace highlighting
@ 2021-01-30 21:15 michael-franzese
  2021-01-31  0:24 ` michael-franzese
  0 siblings, 1 reply; 2+ messages in thread
From: michael-franzese @ 2021-01-30 21:15 UTC (permalink / raw)
  To: Help Gnu Emacs

I have a problem on the correct way to display line and column numbers
together with a ruler and whitespace highlighting, with the ability to
cycle through the different options.


(defvar dfv-highlight-spaces-state nil)

(defun cycle-highlight-spaces ()
  "Cycle though character highlighting (tabs and trailing spaces)."
  (interactive)

  (pcase dfv-highlight-spaces-state
    (2 (display-line-numbers-mode 0)
       (setq line-number-mode nil)
       (setq column-number-mode nil)
       (ruler-mode 1)
       (whitespace-mode 0)
       (message "%s" "Enable: Ruler only")
       (setq dfv-highlight-spaces-state 3))

    (3 (ruler-mode 0)
       (setq line-number-mode nil)
       (setq column-number-mode nil)
       (display-line-numbers-mode 0)
       (whitespace-mode 0)
       (message "%s" "Disable: Show spaces & cursor position")
       (setq dfv-highlight-spaces-state 1))

    (_ (ruler-mode 1)
       (setq line-number-mode t)
       (setq column-number-mode t)
       (display-line-numbers-mode 1)
       (whitespace-mode 1)
       (message "%s" "Enable: Show spaces & cursor position")
       (setq dfv-highlight-spaces-state 2)) ))







^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-31  0:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-30 21:15 display line and column numbers together with ruler and whitespace highlighting michael-franzese
2021-01-31  0:24 ` michael-franzese

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.