help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing line and column number settings from some buffers


From: Emanuel Berg
Subject: Re: Removing line and column number settings from some buffers
Date: Wed, 02 Dec 2020 22:18:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

daniela-spit wrote:

> Am trying to set my diary but do not want to have the typical
> line and column numbers (had set thew with setq in init file).
>
> Would like to put them to nil but only to some specific
> buffer only.
>
> Have started with a function but not so much aware of what
> I have got to do.
>
> (defun column-line-number ()
>
>   (make-local-variable 'line-number-mode)
>   (make-local-variable 'column-number-mode)
>
>   (setq line-number-mode nil)
>   (setq column-number-mode nil))

The below Elisp is how I do it, this makes it available
interactively everywhere (with M-x lines RET) but also for
default setups for specific modes, see the hook below for
an example.

(defun toggle-local-var (var)
  (set-variable var (not (symbol-value var)) t) )

(defun toggle-line-mode ()
  (interactive)
  (toggle-local-var 'line-number-mode) )
(defalias 'lines #'toggle-line-mode)

(defun conf-space-mode-hook-f ()
  (lines) )
(add-hook 'conf-space-mode-hook #'conf-space-mode-hook-f)

See this file:

  https://dataswamp.org/~incal/emacs-init/mode-line.el

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]