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: daniela-spit
Subject: Re: Removing line and column number settings from some buffers
Date: Thu, 3 Dec 2020 00:21:40 +0100

What could be wrong when setting the filename with

  (setq mode-line-buffer-identification "%b")

> Sent: Wednesday, December 02, 2020 at 10:18 PM
> From: "Emanuel Berg via Users list for the GNU Emacs text editor" 
> <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> 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]