I need to define a function that toggles between value of
display-line-numbers but can't figure out what's the correct lisp syntax to do so.
Here's what I want to do:
- Check if value of
t(absolute line numbers), change it to
- Else (it will be set to relative) change it to absolute (
Here's what I tried which is full of errors. Not having a very good hand at lisp
(defun cc/toggle-line-numbering () "Toggle line numbering between absolute and relative." (interactive) (if (= (describe-variable display-line-numbers) "relative") (setq display-line-numbers t) (setq display-line-numbers 'relative)))