diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/cus-start.el | 16 | ||||
-rw-r--r-- | lisp/faces.el | 8 | ||||
-rw-r--r-- | lisp/menu-bar.el | 19 |
3 files changed, 41 insertions, 2 deletions
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 744fe7f69ee..0fe41d7c3ea 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -584,6 +584,22 @@ since it could result in memory overflow and make Emacs crash." (const :tag "Grow only" :value grow-only)) "25.1") (display-raw-bytes-as-hex display boolean "26.1") + (display-line-numbers display + (choice + (const :tag "Off (nil)" :value nil) + (const :tag "Absolute line numbers" + :value t) + (const :tag "Relative line numbers" + :value relative)) + "26.1") + (display-line-width display + (choice + (const :tag "Dynamically computed" + :value nil) + (integer :menu-tag "Fixed number of columns" + :value 2 + :format "%v")) + "26.1") ;; xfaces.c (scalable-fonts-allowed display boolean "22.1") ;; xfns.c diff --git a/lisp/faces.el b/lisp/faces.el index 9a8a1344caf..ac2d210a32f 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2465,6 +2465,14 @@ If you set `term-file-prefix' to nil, this function does nothing." :version "21.1" :group 'basic-faces) +;; Definition stolen from linum.el. +(defface line-number + '((t :inherit (shadow default))) + "Face for displaying line numbers. +This face is used when `display-line-numbers' is non-nil." + :version "26.1" + :group 'basic-faces) + (defface escape-glyph '((((background dark)) :foreground "cyan") ;; See the comment in minibuffer-prompt for diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 9c7bcffbaab..06f8c7872b7 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1101,17 +1101,32 @@ The selected font will be the default on both the existing and future frames." :button (:radio . (eq tool-bar-mode nil)))) menu))) +(defun toggle-display-line-numbers () + (interactive) + (if display-line-numbers + (setq display-line-numbers nil) + (setq display-line-numbers t)) + (force-mode-line-update)) + (defvar menu-bar-showhide-menu (let ((menu (make-sparse-keymap "Show/Hide"))) + (bindings--define-key menu [display-line-numbers] + `(menu-item "Line Numbers for all lines" + ,(lambda () + (interactive) + (toggle-display-line-numbers)) + :help "Show the line number alongside each line" + :button (:toggle . display-line-numbers))) + (bindings--define-key menu [column-number-mode] (menu-bar-make-mm-toggle column-number-mode - "Column Numbers" + "Column Numbers in Mode Line" "Show the current column number in the mode line")) (bindings--define-key menu [line-number-mode] (menu-bar-make-mm-toggle line-number-mode - "Line Numbers" + "Line Numbers in Mode Line" "Show the current line number in the mode line")) (bindings--define-key menu [size-indication-mode] |