all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Removing line and column number settings from some buffers
@ 2020-12-02 15:34 daniela-spit
  2020-12-02 21:18 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 45+ messages in thread
From: daniela-spit @ 2020-12-02 15:34 UTC (permalink / raw)
  To: Help Gnu Emacs

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))

Thank you
Daniela








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

* Re: Removing line and column number settings from some buffers
  2020-12-02 15:34 Removing line and column number settings from some buffers daniela-spit
@ 2020-12-02 21:18 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2020-12-02 23:21   ` daniela-spit
  0 siblings, 1 reply; 45+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-12-02 21:18 UTC (permalink / raw)
  To: help-gnu-emacs

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




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

* Re: Removing line and column number settings from some buffers
  2020-12-02 21:18 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2020-12-02 23:21   ` daniela-spit
  2020-12-02 23:28     ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 45+ messages in thread
From: daniela-spit @ 2020-12-02 23:21 UTC (permalink / raw)
  To: moasenwood; +Cc: help-gnu-emacs


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
>
>
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-02 23:21   ` daniela-spit
@ 2020-12-02 23:28     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2020-12-02 23:32       ` daniela-spit
  0 siblings, 1 reply; 45+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-12-02 23:28 UTC (permalink / raw)
  To: help-gnu-emacs

daniela-spit wrote:

> What could be wrong when setting the filename with
>
>   (setq mode-line-buffer-identification "%b")

I don't know, what do you trying to do?

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




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

* Re: Removing line and column number settings from some buffers
  2020-12-02 23:28     ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2020-12-02 23:32       ` daniela-spit
  2020-12-02 23:56         ` Emanuel Berg via Users list for the GNU Emacs text editor
  2020-12-02 23:57         ` daniela-spit
  0 siblings, 2 replies; 45+ messages in thread
From: daniela-spit @ 2020-12-02 23:32 UTC (permalink / raw)
  To: moasenwood; +Cc: help-gnu-emacs

> Sent: Thursday, December 03, 2020 at 12:28 AM
> 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:
>
> > What could be wrong when setting the filename with
> >
> >   (setq mode-line-buffer-identification "%b")
>
> I don't know, what do you trying to do?

Trying to print buffer name but with less padding with spaces, than the
with at least 12 columns as usual.

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



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

* Re: Removing line and column number settings from some buffers
  2020-12-02 23:32       ` daniela-spit
@ 2020-12-02 23:56         ` Emanuel Berg via Users list for the GNU Emacs text editor
  2020-12-02 23:57         ` daniela-spit
  1 sibling, 0 replies; 45+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-12-02 23:56 UTC (permalink / raw)
  To: help-gnu-emacs

daniela-spit wrote:

> Trying to print buffer name but with less padding with spaces,
> than the with at least 12 columns as usual.

And it doesn't work? Try to reduce it, maybe some offset must be
there...

Again, take a look at

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

for what I've done with the mode line. It doesn't look pretty
but it has worked for me. No idea what the canonical way to do
it is, sorry.

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




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

* Re: Removing line and column number settings from some buffers
  2020-12-02 23:32       ` daniela-spit
  2020-12-02 23:56         ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2020-12-02 23:57         ` daniela-spit
  2020-12-03  0:04           ` Emanuel Berg via Users list for the GNU Emacs text editor
  2020-12-03 22:14           ` Michael Heerdegen
  1 sibling, 2 replies; 45+ messages in thread
From: daniela-spit @ 2020-12-02 23:57 UTC (permalink / raw)
  To: daniela-spit; +Cc: help-gnu-emacs, moasenwood

Have found mode-line-format

 (setq mode-line-format " %b")

But still not able to introduce (display-time) using the format
(setq display-time-format "%H:%M %a %b %d %Y W%W")



> Sent: Thursday, December 03, 2020 at 12:32 AM
> From: daniela-spit@gmx.it
> To: moasenwood@zoho.eu
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> > Sent: Thursday, December 03, 2020 at 12:28 AM
> > 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:
> >
> > > What could be wrong when setting the filename with
> > >
> > >   (setq mode-line-buffer-identification "%b")
> >
> > I don't know, what do you trying to do?
>
> Trying to print buffer name but with less padding with spaces, than the
> with at least 12 columns as usual.
>
> > --
> > underground experts united
> > http://user.it.uu.se/~embe8573
> > https://dataswamp.org/~incal
> >
> >
> >
>
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-02 23:57         ` daniela-spit
@ 2020-12-03  0:04           ` Emanuel Berg via Users list for the GNU Emacs text editor
  2020-12-03 22:14           ` Michael Heerdegen
  1 sibling, 0 replies; 45+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-12-03  0:04 UTC (permalink / raw)
  To: help-gnu-emacs

daniela-spit wrote:

> Have found mode-line-format
>
>  (setq mode-line-format " %b")
>
> But still not able to introduce (display-time) using the
> format (setq display-time-format "%H:%M %a %b %d %Y W%W")

But then you have no reference to that in `mode-line-format',
you need, e.g.,

  (format-time-string " %H:%M")

Please read the docstring of `mode-line-format', then look at
this file as an example:

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

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




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

* Re: Removing line and column number settings from some buffers
  2020-12-02 23:57         ` daniela-spit
  2020-12-03  0:04           ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2020-12-03 22:14           ` Michael Heerdegen
  2020-12-03 22:19             ` daniela-spit
  1 sibling, 1 reply; 45+ messages in thread
From: Michael Heerdegen @ 2020-12-03 22:14 UTC (permalink / raw)
  To: help-gnu-emacs

daniela-spit@gmx.it writes:

> But still not able to introduce (display-time) using the format
> (setq display-time-format "%H:%M %a %b %d %Y W%W")

Seems you must restart `display-time-mode' if it's already on; only
after restarting the new value is respected.

Was that your problem?

Michael.




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

* Re: Removing line and column number settings from some buffers
  2020-12-03 22:14           ` Michael Heerdegen
@ 2020-12-03 22:19             ` daniela-spit
  2020-12-03 22:22               ` Jean Louis
  2020-12-03 23:24               ` Michael Heerdegen
  0 siblings, 2 replies; 45+ messages in thread
From: daniela-spit @ 2020-12-03 22:19 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

Got it, thank you.

Am also trying to see what is what.  When I removed some of the options,
the mode line still remained the same.

(setq mode-line-format
   (list
      "%e"
      'mode-line-front-space  'mode-line-mule-info
      'mode-line-client       'mode-line-modified
      'mode-line-remote       'mode-line-frame-identification
      'mode-line-buffer-identification
      " "
      'mode-line-position     '(vc-mode vc-mode)
      " "
      'mode-line-modes        'mode-line-misc-info
      'mode-line-end-spaces) )



> Sent: Thursday, December 03, 2020 at 11:14 PM
> From: "Michael Heerdegen" <michael_heerdegen@web.de>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> daniela-spit@gmx.it writes:
>
> > But still not able to introduce (display-time) using the format
> > (setq display-time-format "%H:%M %a %b %d %Y W%W")
>
> Seems you must restart `display-time-mode' if it's already on; only
> after restarting the new value is respected.
>
> Was that your problem?
>
> Michael.
>
>
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-03 22:19             ` daniela-spit
@ 2020-12-03 22:22               ` Jean Louis
  2020-12-03 22:33                 ` daniela-spit
  2020-12-03 23:24               ` Michael Heerdegen
  1 sibling, 1 reply; 45+ messages in thread
From: Jean Louis @ 2020-12-03 22:22 UTC (permalink / raw)
  To: daniela-spit; +Cc: Michael Heerdegen, help-gnu-emacs

* daniela-spit@gmx.it <daniela-spit@gmx.it> [2020-12-04 01:20]:
> Got it, thank you.
> 
> Am also trying to see what is what.  When I removed some of the options,
> the mode line still remained the same.

Try: (force-mode-line-update) after setting it.






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

* Re: Removing line and column number settings from some buffers
  2020-12-03 22:22               ` Jean Louis
@ 2020-12-03 22:33                 ` daniela-spit
  2020-12-03 22:52                   ` Jean Louis
  0 siblings, 1 reply; 45+ messages in thread
From: daniela-spit @ 2020-12-03 22:33 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs

Do you see anything wrong with this?  This Mode Line is quite difficult!

(setq mode-line-format
   (list
      "%e"
      " "
      " "
      'mode-line-modes       'mode-line-misc-info
      'mode-line-end-spaces) )

(force-mode-line-update)

> Sent: Thursday, December 03, 2020 at 11:22 PM
> From: "Jean Louis" <bugs@gnu.support>
> To: daniela-spit@gmx.it
> Cc: "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> * daniela-spit@gmx.it <daniela-spit@gmx.it> [2020-12-04 01:20]:
> > Got it, thank you.
> >
> > Am also trying to see what is what.  When I removed some of the options,
> > the mode line still remained the same.
>
> Try: (force-mode-line-update) after setting it.
>
>
>
>
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-03 22:33                 ` daniela-spit
@ 2020-12-03 22:52                   ` Jean Louis
  2020-12-03 23:09                     ` daniela-spit
  0 siblings, 1 reply; 45+ messages in thread
From: Jean Louis @ 2020-12-03 22:52 UTC (permalink / raw)
  To: daniela-spit; +Cc: help-gnu-emacs

* daniela-spit@gmx.it <daniela-spit@gmx.it> [2020-12-04 01:33]:
> Do you see anything wrong with this?  This Mode Line is quite difficult!
> 
> (setq mode-line-format
>    (list
>       "%e"
>       " "
>       " "
>       'mode-line-modes       'mode-line-misc-info
>       'mode-line-end-spaces) )
> 
> (force-mode-line-update)

Works well here.  Mode line changed immediately. I do not know what
you wish to customize.



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

* Re: Removing line and column number settings from some buffers
  2020-12-03 22:52                   ` Jean Louis
@ 2020-12-03 23:09                     ` daniela-spit
  2020-12-04  0:38                       ` Christopher Dimech
  0 siblings, 1 reply; 45+ messages in thread
From: daniela-spit @ 2020-12-03 23:09 UTC (permalink / raw)
  To: Jean Louis; +Cc: help-gnu-emacs

Currently I am not customising anything.  Just playing with this out of interest.
Will have to dig this out of why it is not changing.

> Sent: Thursday, December 03, 2020 at 11:52 PM
> From: "Jean Louis" <bugs@gnu.support>
> To: daniela-spit@gmx.it
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> * daniela-spit@gmx.it <daniela-spit@gmx.it> [2020-12-04 01:33]:
> > Do you see anything wrong with this?  This Mode Line is quite difficult!
> >
> > (setq mode-line-format
> >    (list
> >       "%e"
> >       " "
> >       " "
> >       'mode-line-modes       'mode-line-misc-info
> >       'mode-line-end-spaces) )
> >
> > (force-mode-line-update)
>
> Works well here.  Mode line changed immediately. I do not know what
> you wish to customize.
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-03 22:19             ` daniela-spit
  2020-12-03 22:22               ` Jean Louis
@ 2020-12-03 23:24               ` Michael Heerdegen
  2020-12-03 23:36                 ` daniela-spit
  1 sibling, 1 reply; 45+ messages in thread
From: Michael Heerdegen @ 2020-12-03 23:24 UTC (permalink / raw)
  To: help-gnu-emacs

daniela-spit@gmx.it writes:

> Got it, thank you.
>
> Am also trying to see what is what.  When I removed some of the options,
> the mode line still remained the same.

Some elements only display something under certain circumstances.

Another thing is that mode-line-format "Automatically becomes
buffer-local when set."  If you want to see an effect nearly everywhere,
you must change the default value of the symbol.  Some modes don't use
the default mode-line display but implement an own one so these would
not be affected (when changing the default).

Or modify the variables that represent parts of the mode-line and have
their own variable.  This is often the better alternative for global
mode-line config, in my experience.

Regards,

Michael.




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

* Re: Removing line and column number settings from some buffers
  2020-12-03 23:24               ` Michael Heerdegen
@ 2020-12-03 23:36                 ` daniela-spit
  0 siblings, 0 replies; 45+ messages in thread
From: daniela-spit @ 2020-12-03 23:36 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs


> Sent: Friday, December 04, 2020 at 12:24 AM
> From: "Michael Heerdegen" <michael_heerdegen@web.de>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> daniela-spit@gmx.it writes:
>
> > Got it, thank you.
> >
> > Am also trying to see what is what.  When I removed some of the options,
> > the mode line still remained the same.
>
> Some elements only display something under certain circumstances.
>
> Another thing is that mode-line-format "Automatically becomes
> buffer-local when set."  If you want to see an effect nearly everywhere,
> you must change the default value of the symbol.  Some modes don't use
> the default mode-line display but implement an own one so these would
> not be affected (when changing the default).
>
> Or modify the variables that represent parts of the mode-line and have
> their own variable.  This is often the better alternative for global
> mode-line config, in my experience.

Yes, modifying variables representing parts of mode-line helped
me get somewhere.

> Regards,
>
> Michael.
>
>
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-03 23:09                     ` daniela-spit
@ 2020-12-04  0:38                       ` Christopher Dimech
  2020-12-04  1:16                         ` Michael Heerdegen
  0 siblings, 1 reply; 45+ messages in thread
From: Christopher Dimech @ 2020-12-04  0:38 UTC (permalink / raw)
  To: daniela-spit; +Cc: help-gnu-emacs, Jean Louis

> Sent: Friday, December 04, 2020 at 12:09 AM
> From: daniela-spit@gmx.it
> To: "Jean Louis" <bugs@gnu.support>
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> Currently I am not customising anything.  Just playing with this out of interest.
> Will have to dig this out of why it is not changing.
>
> > Sent: Thursday, December 03, 2020 at 11:52 PM
> > From: "Jean Louis" <bugs@gnu.support>
> > To: daniela-spit@gmx.it
> > Cc: help-gnu-emacs@gnu.org
> > Subject: Re: Removing line and column number settings from some buffers
> >
> > * daniela-spit@gmx.it <daniela-spit@gmx.it> [2020-12-04 01:33]:
> > > Do you see anything wrong with this?  This Mode Line is quite difficult!
> > >
> > > (setq mode-line-format
> > >    (list
> > >       "%e"
> > >       " "
> > >       " "
> > >       'mode-line-modes       'mode-line-misc-info
> > >       'mode-line-end-spaces) )
> > >
> > > (force-mode-line-update)

Have put the code in my init, and the mode line is also not being
updated.  Even after firing new Emacs Sessions.

> > Works well here.  Mode line changed immediately. I do not know what
> > you wish to customize.
> >
>
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  0:38                       ` Christopher Dimech
@ 2020-12-04  1:16                         ` Michael Heerdegen
  2020-12-04  1:33                           ` Christopher Dimech
  0 siblings, 1 reply; 45+ messages in thread
From: Michael Heerdegen @ 2020-12-04  1:16 UTC (permalink / raw)
  To: help-gnu-emacs

Christopher Dimech <dimech@gmx.com> writes:

> > > > (setq mode-line-format
> > > >    (list
> > > >       "%e"
> > > >       " "
> > > >       " "
> > > >       'mode-line-modes       'mode-line-misc-info
> > > >       'mode-line-end-spaces) )
> > > >
> > > > (force-mode-line-update)
>
> Have put the code in my init, and the mode line is also not being
> updated.  Even after firing new Emacs Sessions.

This does only modify the mode-line of the buffer that is current when
that code is loaded, so this is expected.

Michael.




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

* Re: Removing line and column number settings from some buffers
  2020-12-04  1:16                         ` Michael Heerdegen
@ 2020-12-04  1:33                           ` Christopher Dimech
  2020-12-04  2:10                             ` daniela-spit
  0 siblings, 1 reply; 45+ messages in thread
From: Christopher Dimech @ 2020-12-04  1:33 UTC (permalink / raw)
  To: Michael Heerdegen, daniela-spit; +Cc: help-gnu-emacs




> Sent: Friday, December 04, 2020 at 2:16 AM
> From: "Michael Heerdegen" <michael_heerdegen@web.de>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> Christopher Dimech <dimech@gmx.com> writes:
>
> > > > > (setq mode-line-format
> > > > >    (list
> > > > >       "%e"
> > > > >       " "
> > > > >       " "
> > > > >       'mode-line-modes       'mode-line-misc-info
> > > > >       'mode-line-end-spaces) )
> > > > >
> > > > > (force-mode-line-update)
> >
> > Have put the code in my init, and the mode line is also not being
> > updated.  Even after firing new Emacs Sessions.
>
> This does only modify the mode-line of the buffer that is current when
> that code is loaded, so this is expected.

I see.  Have put it in a file and hit "M-x eval-region".  And then the change
happens.




> Michael.
>
>
>

---------------------
Christopher Dimech
General Administrator - Naiad Informatics - GNU Project (Geocomputation)
- Geophysical Simulation
- Geological Subsurface Mapping
- Disaster Preparedness and Mitigation
- Natural Resource Exploration and Production
- Free Software Advocacy



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  1:33                           ` Christopher Dimech
@ 2020-12-04  2:10                             ` daniela-spit
  2020-12-04  2:42                               ` Christopher Dimech
                                                 ` (3 more replies)
  0 siblings, 4 replies; 45+ messages in thread
From: daniela-spit @ 2020-12-04  2:10 UTC (permalink / raw)
  To: Christopher Dimech; +Cc: Michael Heerdegen, help-gnu-emacs



> Sent: Friday, December 04, 2020 at 2:33 AM
> From: "Christopher Dimech" <dimech@gmx.com>
> To: "Michael Heerdegen" <michael_heerdegen@web.de>, daniela-spit@gmx.it
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
>
>
>
> > Sent: Friday, December 04, 2020 at 2:16 AM
> > From: "Michael Heerdegen" <michael_heerdegen@web.de>
> > To: help-gnu-emacs@gnu.org
> > Subject: Re: Removing line and column number settings from some buffers
> >
> > Christopher Dimech <dimech@gmx.com> writes:
> >
> > > > > > (setq mode-line-format
> > > > > >    (list
> > > > > >       "%e"
> > > > > >       " "
> > > > > >       " "
> > > > > >       'mode-line-modes       'mode-line-misc-info
> > > > > >       'mode-line-end-spaces) )
> > > > > >
> > > > > > (force-mode-line-update)
> > >
> > > Have put the code in my init, and the mode line is also not being
> > > updated.  Even after firing new Emacs Sessions.
> >
> > This does only modify the mode-line of the buffer that is current when
> > that code is loaded, so this is expected.
>
> I see.  Have put it in a file and hit "M-x eval-region".  And then the change
> happens.

At least I say things changing.

What I want to do is to change the Mode Line, but then revert back to how it
was in that buffer, by continue pressing same keybinding.  Can I store the
old setup and then put it back again.

>
> > Michael.
> >
> >
> >
>
> ---------------------
> Christopher Dimech
> General Administrator - Naiad Informatics - GNU Project (Geocomputation)
> - Geophysical Simulation
> - Geological Subsurface Mapping
> - Disaster Preparedness and Mitigation
> - Natural Resource Exploration and Production
> - Free Software Advocacy
>
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  2:10                             ` daniela-spit
@ 2020-12-04  2:42                               ` Christopher Dimech
  2020-12-04  6:10                                 ` Jean Louis
  2020-12-04  2:46                               ` Michael Heerdegen
                                                 ` (2 subsequent siblings)
  3 siblings, 1 reply; 45+ messages in thread
From: Christopher Dimech @ 2020-12-04  2:42 UTC (permalink / raw)
  To: daniela-spit; +Cc: Michael Heerdegen, help-gnu-emacs




> Sent: Friday, December 04, 2020 at 3:10 AM
> From: daniela-spit@gmx.it
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
>
>
> > Sent: Friday, December 04, 2020 at 2:33 AM
> > From: "Christopher Dimech" <dimech@gmx.com>
> > To: "Michael Heerdegen" <michael_heerdegen@web.de>, daniela-spit@gmx.it
> > Cc: help-gnu-emacs@gnu.org
> > Subject: Re: Removing line and column number settings from some buffers
> >
> >
> >
> >
> > > Sent: Friday, December 04, 2020 at 2:16 AM
> > > From: "Michael Heerdegen" <michael_heerdegen@web.de>
> > > To: help-gnu-emacs@gnu.org
> > > Subject: Re: Removing line and column number settings from some buffers
> > >
> > > Christopher Dimech <dimech@gmx.com> writes:
> > >
> > > > > > > (setq mode-line-format
> > > > > > >    (list
> > > > > > >       "%e"
> > > > > > >       " "
> > > > > > >       " "
> > > > > > >       'mode-line-modes       'mode-line-misc-info
> > > > > > >       'mode-line-end-spaces) )
> > > > > > >
> > > > > > > (force-mode-line-update)
> > > >
> > > > Have put the code in my init, and the mode line is also not being
> > > > updated.  Even after firing new Emacs Sessions.
> > >
> > > This does only modify the mode-line of the buffer that is current when
> > > that code is loaded, so this is expected.
> >
> > I see.  Have put it in a file and hit "M-x eval-region".  And then the change
> > happens.
>
> At least I say things changing.
>
> What I want to do is to change the Mode Line, but then revert back to how it
> was in that buffer, by continue pressing same keybinding.  Can I store the
> old setup and then put it back again.

Have got some code to cycle commands.  Shall try to dig that out.  But I don't
know much about changing the mode line.


> > > Michael.
> > >
> > >
> > >
> >
> > ---------------------
> > Christopher Dimech
> > General Administrator - Naiad Informatics - GNU Project (Geocomputation)
> > - Geophysical Simulation
> > - Geological Subsurface Mapping
> > - Disaster Preparedness and Mitigation
> > - Natural Resource Exploration and Production
> > - Free Software Advocacy
> >
> >
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  2:10                             ` daniela-spit
  2020-12-04  2:42                               ` Christopher Dimech
@ 2020-12-04  2:46                               ` Michael Heerdegen
  2020-12-04  3:12                                 ` Christopher Dimech
  2020-12-04  4:16                               ` daniela-spit
  2020-12-04  6:07                               ` Jean Louis
  3 siblings, 1 reply; 45+ messages in thread
From: Michael Heerdegen @ 2020-12-04  2:46 UTC (permalink / raw)
  To: help-gnu-emacs

daniela-spit@gmx.it writes:

> What I want to do is to change the Mode Line, but then revert back to how it
> was in that buffer, by continue pressing same keybinding.  Can I store the
> old setup and then put it back again.

Yes.  Just store the old value in a (buffer local) variable.

Regards,

Michael.




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

* Re: Removing line and column number settings from some buffers
  2020-12-04  2:46                               ` Michael Heerdegen
@ 2020-12-04  3:12                                 ` Christopher Dimech
  0 siblings, 0 replies; 45+ messages in thread
From: Christopher Dimech @ 2020-12-04  3:12 UTC (permalink / raw)
  To: Michael Heerdegen, daniela-spit; +Cc: help-gnu-emacs


> Sent: Friday, December 04, 2020 at 3:46 AM
> From: "Michael Heerdegen" <michael_heerdegen@web.de>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> daniela-spit@gmx.it writes:
>
> > What I want to do is to change the Mode Line, but then revert back to how it
> > was in that buffer, by continue pressing same keybinding.  Can I store the
> > old setup and then put it back again.
>
> Yes.  Just store the old value in a (buffer local) variable.

Been reading hard on buffer local.

Perhaps she can do like so

;; Store current value of mode-line-format
(setq-local original-mode-line-format mode-line-format)

;; Put original mode-line-format
(setq mode-line-format original-mode-line-format)

Hope I have not got the commands wrong for her case.  If I do, my apologies.

> Regards,
>
> Michael.
>
>
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  2:10                             ` daniela-spit
  2020-12-04  2:42                               ` Christopher Dimech
  2020-12-04  2:46                               ` Michael Heerdegen
@ 2020-12-04  4:16                               ` daniela-spit
  2020-12-04  4:36                                 ` daniela-spit
  2020-12-04  7:40                                 ` Jean Louis
  2020-12-04  6:07                               ` Jean Louis
  3 siblings, 2 replies; 45+ messages in thread
From: daniela-spit @ 2020-12-04  4:16 UTC (permalink / raw)
  To: Christopher Dimech; +Cc: Michael Heerdegen, help-gnu-emacs

Can somebody help me make a key binding that cycles
through a function (appt-mode-line n) where 'n' can
be 1, 2 or 3.

Thank you
Daniela

> Sent: Friday, December 04, 2020 at 3:10 AM
> From: daniela-spit@gmx.it
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
>
>
> > Sent: Friday, December 04, 2020 at 2:33 AM
> > From: "Christopher Dimech" <dimech@gmx.com>
> > To: "Michael Heerdegen" <michael_heerdegen@web.de>, daniela-spit@gmx.it
> > Cc: help-gnu-emacs@gnu.org
> > Subject: Re: Removing line and column number settings from some buffers
> >
> >
> >
> >
> > > Sent: Friday, December 04, 2020 at 2:16 AM
> > > From: "Michael Heerdegen" <michael_heerdegen@web.de>
> > > To: help-gnu-emacs@gnu.org
> > > Subject: Re: Removing line and column number settings from some buffers
> > >
> > > Christopher Dimech <dimech@gmx.com> writes:
> > >
> > > > > > > (setq mode-line-format
> > > > > > >    (list
> > > > > > >       "%e"
> > > > > > >       " "
> > > > > > >       " "
> > > > > > >       'mode-line-modes       'mode-line-misc-info
> > > > > > >       'mode-line-end-spaces) )
> > > > > > >
> > > > > > > (force-mode-line-update)
> > > >
> > > > Have put the code in my init, and the mode line is also not being
> > > > updated.  Even after firing new Emacs Sessions.
> > >
> > > This does only modify the mode-line of the buffer that is current when
> > > that code is loaded, so this is expected.
> >
> > I see.  Have put it in a file and hit "M-x eval-region".  And then the change
> > happens.
>
> At least I say things changing.
>
> What I want to do is to change the Mode Line, but then revert back to how it
> was in that buffer, by continue pressing same keybinding.  Can I store the
> old setup and then put it back again.
>
> >
> > > Michael.
> > >
> > >
> > >
> >
> > ---------------------
> > Christopher Dimech
> > General Administrator - Naiad Informatics - GNU Project (Geocomputation)
> > - Geophysical Simulation
> > - Geological Subsurface Mapping
> > - Disaster Preparedness and Mitigation
> > - Natural Resource Exploration and Production
> > - Free Software Advocacy
> >
> >
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  4:16                               ` daniela-spit
@ 2020-12-04  4:36                                 ` daniela-spit
  2020-12-04  5:58                                   ` daniela-spit
  2020-12-05 21:35                                   ` Michael Heerdegen
  2020-12-04  7:40                                 ` Jean Louis
  1 sibling, 2 replies; 45+ messages in thread
From: daniela-spit @ 2020-12-04  4:36 UTC (permalink / raw)
  To: Christopher Dimech; +Cc: Michael Heerdegen, help-gnu-emacs

One problem is how to store  (get 'time-frmt-cycle 'state) in a variable.


> Sent: Friday, December 04, 2020 at 5:16 AM
> From: daniela-spit@gmx.it
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> Can somebody help me make a key binding that cycles
> through a function (appt-mode-line n) where 'n' can
> be 1, 2 or 3.
>
> Thank you
> Daniela
>
> > Sent: Friday, December 04, 2020 at 3:10 AM
> > From: daniela-spit@gmx.it
> > To: "Christopher Dimech" <dimech@gmx.com>
> > Cc: "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> > Subject: Re: Removing line and column number settings from some buffers
> >
> >
> >
> > > Sent: Friday, December 04, 2020 at 2:33 AM
> > > From: "Christopher Dimech" <dimech@gmx.com>
> > > To: "Michael Heerdegen" <michael_heerdegen@web.de>, daniela-spit@gmx.it
> > > Cc: help-gnu-emacs@gnu.org
> > > Subject: Re: Removing line and column number settings from some buffers
> > >
> > >
> > >
> > >
> > > > Sent: Friday, December 04, 2020 at 2:16 AM
> > > > From: "Michael Heerdegen" <michael_heerdegen@web.de>
> > > > To: help-gnu-emacs@gnu.org
> > > > Subject: Re: Removing line and column number settings from some buffers
> > > >
> > > > Christopher Dimech <dimech@gmx.com> writes:
> > > >
> > > > > > > > (setq mode-line-format
> > > > > > > >    (list
> > > > > > > >       "%e"
> > > > > > > >       " "
> > > > > > > >       " "
> > > > > > > >       'mode-line-modes       'mode-line-misc-info
> > > > > > > >       'mode-line-end-spaces) )
> > > > > > > >
> > > > > > > > (force-mode-line-update)
> > > > >
> > > > > Have put the code in my init, and the mode line is also not being
> > > > > updated.  Even after firing new Emacs Sessions.
> > > >
> > > > This does only modify the mode-line of the buffer that is current when
> > > > that code is loaded, so this is expected.
> > >
> > > I see.  Have put it in a file and hit "M-x eval-region".  And then the change
> > > happens.
> >
> > At least I say things changing.
> >
> > What I want to do is to change the Mode Line, but then revert back to how it
> > was in that buffer, by continue pressing same keybinding.  Can I store the
> > old setup and then put it back again.
> >
> > >
> > > > Michael.
> > > >
> > > >
> > > >
> > >
> > > ---------------------
> > > Christopher Dimech
> > > General Administrator - Naiad Informatics - GNU Project (Geocomputation)
> > > - Geophysical Simulation
> > > - Geological Subsurface Mapping
> > > - Disaster Preparedness and Mitigation
> > > - Natural Resource Exploration and Production
> > > - Free Software Advocacy
> > >
> > >
> >
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  4:36                                 ` daniela-spit
@ 2020-12-04  5:58                                   ` daniela-spit
  2020-12-04  7:19                                     ` Jean Louis
  2020-12-05 21:35                                   ` Michael Heerdegen
  1 sibling, 1 reply; 45+ messages in thread
From: daniela-spit @ 2020-12-04  5:58 UTC (permalink / raw)
  To: Christopher Dimech; +Cc: Michael Heerdegen, help-gnu-emacs

There is something wrong in resetting the mode line, after trying to save the
original value.  Michael has said that code only works if evaluated in a buffer.

Would there be some other call to use?

(defun toggle-mode-line (n)
   "Changes Mode Line Information."

   (make-local-variable 'mode-line-position)
   (make-local-variable 'line-number-mode)
   (make-local-variable 'column-number-mode)
   (make-local-variable 'mode-line-modes)
   (make-local-variable 'mode-line-format)
   (make-local-variable 'original-mode-line-format)
   (make-local-variable 'mode-line-format)

   (cond
      ((= n 1)
       ;; Store current value of mode-line-format
         (setq original-mode-line-format mode-line-format)

         (setq mode-line-position nil)
         (setq line-number-mode nil)
         (setq column-number-mode nil)
         (setq mode-line-modes nil)

         ;; Set format and discard System Load Averages indicator
         (setq display-time-format "W%W %H:%M")
         (make-local-variable 'display-time-default-load-average)
         (setq display-time-default-load-average nil)

         (display-time))

      ((= n 2)
         (setq display-time-format "W%W %H:%M %a %b %d %Y")
         (display-time))

      ((= n 3)
         ;; Put original mode-line-format
         (setq mode-line-position t)
         (setq line-number-mode t)
         (setq column-number-mode t)
         (setq mode-line-modes t)

         (setq mode-line-format original-mode-line-format)
         (force-mode-line-update)) ))

(make-local-variable 'toggle-mode-line)



> Sent: Friday, December 04, 2020 at 5:36 AM
> From: daniela-spit@gmx.it
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> One problem is how to store  (get 'time-frmt-cycle 'state) in a variable.
>
>
> > Sent: Friday, December 04, 2020 at 5:16 AM
> > From: daniela-spit@gmx.it
> > To: "Christopher Dimech" <dimech@gmx.com>
> > Cc: "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> > Subject: Re: Removing line and column number settings from some buffers
> >
> > Can somebody help me make a key binding that cycles
> > through a function (appt-mode-line n) where 'n' can
> > be 1, 2 or 3.
> >
> > Thank you
> > Daniela
> >
> > > Sent: Friday, December 04, 2020 at 3:10 AM
> > > From: daniela-spit@gmx.it
> > > To: "Christopher Dimech" <dimech@gmx.com>
> > > Cc: "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> > > Subject: Re: Removing line and column number settings from some buffers
> > >
> > >
> > >
> > > > Sent: Friday, December 04, 2020 at 2:33 AM
> > > > From: "Christopher Dimech" <dimech@gmx.com>
> > > > To: "Michael Heerdegen" <michael_heerdegen@web.de>, daniela-spit@gmx.it
> > > > Cc: help-gnu-emacs@gnu.org
> > > > Subject: Re: Removing line and column number settings from some buffers
> > > >
> > > >
> > > >
> > > >
> > > > > Sent: Friday, December 04, 2020 at 2:16 AM
> > > > > From: "Michael Heerdegen" <michael_heerdegen@web.de>
> > > > > To: help-gnu-emacs@gnu.org
> > > > > Subject: Re: Removing line and column number settings from some buffers
> > > > >
> > > > > Christopher Dimech <dimech@gmx.com> writes:
> > > > >
> > > > > > > > > (setq mode-line-format
> > > > > > > > >    (list
> > > > > > > > >       "%e"
> > > > > > > > >       " "
> > > > > > > > >       " "
> > > > > > > > >       'mode-line-modes       'mode-line-misc-info
> > > > > > > > >       'mode-line-end-spaces) )
> > > > > > > > >
> > > > > > > > > (force-mode-line-update)
> > > > > >
> > > > > > Have put the code in my init, and the mode line is also not being
> > > > > > updated.  Even after firing new Emacs Sessions.
> > > > >
> > > > > This does only modify the mode-line of the buffer that is current when
> > > > > that code is loaded, so this is expected.
> > > >
> > > > I see.  Have put it in a file and hit "M-x eval-region".  And then the change
> > > > happens.
> > >
> > > At least I say things changing.
> > >
> > > What I want to do is to change the Mode Line, but then revert back to how it
> > > was in that buffer, by continue pressing same keybinding.  Can I store the
> > > old setup and then put it back again.
> > >
> > > >
> > > > > Michael.
> > > > >
> > > > >
> > > > >
> > > >
> > > > ---------------------
> > > > Christopher Dimech
> > > > General Administrator - Naiad Informatics - GNU Project (Geocomputation)
> > > > - Geophysical Simulation
> > > > - Geological Subsurface Mapping
> > > > - Disaster Preparedness and Mitigation
> > > > - Natural Resource Exploration and Production
> > > > - Free Software Advocacy
> > > >
> > > >
> > >
> >
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  2:10                             ` daniela-spit
                                                 ` (2 preceding siblings ...)
  2020-12-04  4:16                               ` daniela-spit
@ 2020-12-04  6:07                               ` Jean Louis
  3 siblings, 0 replies; 45+ messages in thread
From: Jean Louis @ 2020-12-04  6:07 UTC (permalink / raw)
  To: daniela-spit; +Cc: Michael Heerdegen, Christopher Dimech, help-gnu-emacs

* daniela-spit@gmx.it <daniela-spit@gmx.it> [2020-12-04 05:10]:
> What I want to do is to change the Mode Line, but then revert back to how it
> was in that buffer, by continue pressing same keybinding.  Can I store the
> old setup and then put it back again.

As each setting is variable one can store it in other variable or into
file, and get it back later.

(defun string-to-file-force (string file)
  "Prints string into file, matters not if file exists. Returns FILE as file name."
    (with-temp-file file
      (insert string))
    file)

(defun file-to-string (file)
  "File to string function"
  (with-temp-buffer
    (insert-file-contents file)
    (buffer-string)))

(defun data-to-file (data file)
  "PRIN1 Emacs Lisp DATA to FILE"
    (string-to-file-force (prin1-to-string data) file))

(defun data-from-file (file)
  "Reads and returns Emacs Lisp data from FILE"
  (car
   (read-from-string
    (file-to-string file))))

With those I am storing data into files and reading from files. It can
be just any complex Emacs Lisp data structure like hashes, it can be
lists, variables, just anything.

(setq my-hash (data-from-file "~/tmp/hash"))

(data-to-file mode-line-format "~/.emacs.d/modeline-saved.el")

saves `mode-line-format' into: "~/.emacs.d/modeline-saved.el" with
data looking like this:

("%e" mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification "   " mode-line-position (vc-mode vc-mode) "  " mode-line-modes mode-line-misc-info mode-line-end-spaces)

and

(setq mode-line-format (data-from-file "~/.emacs.d/modeline-saved.el"))

loads the data from file back into `mode-line-format'

Jean



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  2:42                               ` Christopher Dimech
@ 2020-12-04  6:10                                 ` Jean Louis
  2020-12-04  6:31                                   ` Christopher Dimech
                                                     ` (2 more replies)
  0 siblings, 3 replies; 45+ messages in thread
From: Jean Louis @ 2020-12-04  6:10 UTC (permalink / raw)
  To: Christopher Dimech; +Cc: Michael Heerdegen, daniela-spit, help-gnu-emacs

> > What I want to do is to change the Mode Line, but then revert back to how it
> > was in that buffer, by continue pressing same keybinding.  Can I store the
> > old setup and then put it back again.
> 
> Have got some code to cycle commands.  Shall try to dig that out.  But I don't
> know much about changing the mode line.

For session based storage, you may use the Emacs built-in library
`ring' as it has cycling features, you store anything in ring variable
and you can take it back and cycle through it.




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

* Re: Removing line and column number settings from some buffers
  2020-12-04  6:10                                 ` Jean Louis
@ 2020-12-04  6:31                                   ` Christopher Dimech
  2020-12-04  8:40                                   ` Eli Zaretskii
  2020-12-05  5:13                                   ` Christopher Dimech
  2 siblings, 0 replies; 45+ messages in thread
From: Christopher Dimech @ 2020-12-04  6:31 UTC (permalink / raw)
  To: Jean Louis; +Cc: Michael Heerdegen, help-gnu-emacs

> Sent: Friday, December 04, 2020 at 7:10 AM
> From: "Jean Louis" <bugs@gnu.support>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: daniela-spit@gmx.it, "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> > > What I want to do is to change the Mode Line, but then revert back to how it
> > > was in that buffer, by continue pressing same keybinding.  Can I store the
> > > old setup and then put it back again.
> >
> > Have got some code to cycle commands.  Shall try to dig that out.  But I don't
> > know much about changing the mode line.
>
> For session based storage, you may use the Emacs built-in library
> `ring' as it has cycling features, you store anything in ring variable
> and you can take it back and cycle through it.

I had been updating the function state to loop.  Never got into the ring
variable.




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

* Re: Removing line and column number settings from some buffers
  2020-12-04  5:58                                   ` daniela-spit
@ 2020-12-04  7:19                                     ` Jean Louis
  2020-12-05  4:42                                       ` daniela-spit
  0 siblings, 1 reply; 45+ messages in thread
From: Jean Louis @ 2020-12-04  7:19 UTC (permalink / raw)
  To: daniela-spit; +Cc: Michael Heerdegen, Christopher Dimech, help-gnu-emacs

(make-local-variable 'anything-here) will work, but toggle-mode-line
is function and not variable

* daniela-spit@gmx.it <daniela-spit@gmx.it> [2020-12-04 08:58]:
> There is something wrong in resetting the mode line, after trying to save the
> original value.  Michael has said that code only works if evaluated in a buffer.
> 
> Would there be some other call to use?
> 
> (defun toggle-mode-line (n)
>    "Changes Mode Line Information."
> 
>    (make-local-variable 'mode-line-position)
>    (make-local-variable 'line-number-mode)
>    (make-local-variable 'column-number-mode)
>    (make-local-variable 'mode-line-modes)
>    (make-local-variable 'mode-line-format)
>    (make-local-variable 'original-mode-line-format)
>    (make-local-variable 'mode-line-format)
> 
>    (cond
>       ((= n 1)
>        ;; Store current value of mode-line-format
>          (setq original-mode-line-format mode-line-format)
> 
>          (setq mode-line-position nil)
>          (setq line-number-mode nil)
>          (setq column-number-mode nil)
>          (setq mode-line-modes nil)
> 
>          ;; Set format and discard System Load Averages indicator
>          (setq display-time-format "W%W %H:%M")
>          (make-local-variable 'display-time-default-load-average)
>          (setq display-time-default-load-average nil)
> 
>          (display-time))
> 
>       ((= n 2)
>          (setq display-time-format "W%W %H:%M %a %b %d %Y")
>          (display-time))
> 
>       ((= n 3)
>          ;; Put original mode-line-format
>          (setq mode-line-position t)
>          (setq line-number-mode t)
>          (setq column-number-mode t)
>          (setq mode-line-modes t)
> 
>          (setq mode-line-format original-mode-line-format)
>          (force-mode-line-update)) ))
> 
> (make-local-variable 'toggle-mode-line)



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  4:16                               ` daniela-spit
  2020-12-04  4:36                                 ` daniela-spit
@ 2020-12-04  7:40                                 ` Jean Louis
  1 sibling, 0 replies; 45+ messages in thread
From: Jean Louis @ 2020-12-04  7:40 UTC (permalink / raw)
  To: daniela-spit; +Cc: Michael Heerdegen, Christopher Dimech, help-gnu-emacs

* daniela-spit@gmx.it <daniela-spit@gmx.it> [2020-12-04 07:17]:
> Can somebody help me make a key binding that cycles
> through a function (appt-mode-line n) where 'n' can
> be 1, 2 or 3.

Step one:

(defvar my-mode-lines nil "To store mode lines here")

Step two, push various configurations there. Each time you modify
something, push it.

(push mode-line-format my-mode-lines)

You could then store the list my-mode-lines into file or into
buffer for later reuse. That could be easier than writing all
codes.

(defun my-next-mode-line (n)
  (setq mode-line-format (elt my-mode-lines n))
  (force-mode-line-update t))

Access with:

(my-next-mode-line 0)

It works on my side.



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  6:10                                 ` Jean Louis
  2020-12-04  6:31                                   ` Christopher Dimech
@ 2020-12-04  8:40                                   ` Eli Zaretskii
  2020-12-05  5:13                                   ` Christopher Dimech
  2 siblings, 0 replies; 45+ messages in thread
From: Eli Zaretskii @ 2020-12-04  8:40 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Fri, 4 Dec 2020 09:10:32 +0300
> From: Jean Louis <bugs@gnu.support>
> Cc: Michael Heerdegen <michael_heerdegen@web.de>, daniela-spit@gmx.it,
>  help-gnu-emacs@gnu.org
> 
> For session based storage, you may use the Emacs built-in library
> `ring' as it has cycling features, you store anything in ring variable
> and you can take it back and cycle through it.

My suggestion is to use desktop.el for preserving state between
sessions.  It has a customizable option to add variables to save and
restore.



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  7:19                                     ` Jean Louis
@ 2020-12-05  4:42                                       ` daniela-spit
  2020-12-05 21:32                                         ` Michael Heerdegen
  0 siblings, 1 reply; 45+ messages in thread
From: daniela-spit @ 2020-12-05  4:42 UTC (permalink / raw)
  To: Jean Louis; +Cc: Michael Heerdegen, help-gnu-emacs

Have tried using your suggestion.  The file is being created
with the correct information.  However, when the code gets to
option 3, the Mode Line is not being reverted to its original
state.

Daniela


(defun change-mode-line (n)
   "Toggles Mode Line Information."

   (make-local-variable 'mode-line-position)
   (make-local-variable 'line-number-mode)
   (make-local-variable 'column-number-mode)
   (make-local-variable 'mode-line-modes)
   (make-local-variable 'mode-line-format)
   (make-local-variable 'original-mode-line-format)
   (make-local-variable 'mode-line-format)

   (cond
      ((= n 1)
       ;; Store current value of mode-line-format
         (setq original-mode-line-format mode-line-format)
         (data-to-file
            mode-line-format "~/.emacs.d/mode-line-frmt.el")

         (setq mode-line-position nil)
         (setq line-number-mode nil)
         (setq column-number-mode nil)
         (setq mode-line-modes nil)

         ;; Set format and discard System Load Averages indicator
         (setq display-time-format "W%W %H:%M")
         (make-local-variable 'display-time-default-load-average)
         (setq display-time-default-load-average nil)

         (display-time))

      ((= n 2)
         (setq display-time-format "W%W %H:%M %a %b %d %Y")
         (display-time))

      ((= n 3)
         ;; Put original mode-line-format
         (message "Doing 3")
         ;(setq mode-line-position t)
         ;(setq line-number-mode t)
         ;(setq column-number-mode t)
         ;(setq mode-line-modes t)

         ;(make-local-variable 'display-time-default-load-average)
         ;(setq display-time-default-load-average t)
         ;(display-time)

         (setq mode-line-format
            (data-from-file "~/.emacs.d/mode-line-frmt.el"))

      )))

(defun time-frmt-cycle ()
   (interactive)

   (unless (get 'time-frmt-cycle 'state)
      (put 'time-frmt-cycle 'state 1))

   (setq n (get 'time-frmt-cycle 'state))

   (when (= n 1)
      (change-mode-line 1)
      (put 'time-frmt-cycle 'state 2))
   (when (= n 2)
      (change-mode-line 2)
      (put 'time-frmt-cycle 'state 3))
   (when (= n 3)
      (message "3")
      (change-mode-line 3)
      (put 'time-frmt-cycle 'state 1)) )

(global-set-key (kbd "H-i H-i") #'time-frmt-cycle)

> Sent: Friday, December 04, 2020 at 8:19 AM
> From: "Jean Louis" <bugs@gnu.support>
> To: daniela-spit@gmx.it
> Cc: "Christopher Dimech" <dimech@gmx.com>, "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> (make-local-variable 'anything-here) will work, but toggle-mode-line
> is function and not variable
>
> * daniela-spit@gmx.it <daniela-spit@gmx.it> [2020-12-04 08:58]:
> > There is something wrong in resetting the mode line, after trying to save the
> > original value.  Michael has said that code only works if evaluated in a buffer.
> >
> > Would there be some other call to use?
> >
> > (defun toggle-mode-line (n)
> >    "Changes Mode Line Information."
> >
> >    (make-local-variable 'mode-line-position)
> >    (make-local-variable 'line-number-mode)
> >    (make-local-variable 'column-number-mode)
> >    (make-local-variable 'mode-line-modes)
> >    (make-local-variable 'mode-line-format)
> >    (make-local-variable 'original-mode-line-format)
> >    (make-local-variable 'mode-line-format)
> >
> >    (cond
> >       ((= n 1)
> >        ;; Store current value of mode-line-format
> >          (setq original-mode-line-format mode-line-format)
> >
> >          (setq mode-line-position nil)
> >          (setq line-number-mode nil)
> >          (setq column-number-mode nil)
> >          (setq mode-line-modes nil)
> >
> >          ;; Set format and discard System Load Averages indicator
> >          (setq display-time-format "W%W %H:%M")
> >          (make-local-variable 'display-time-default-load-average)
> >          (setq display-time-default-load-average nil)
> >
> >          (display-time))
> >
> >       ((= n 2)
> >          (setq display-time-format "W%W %H:%M %a %b %d %Y")
> >          (display-time))
> >
> >       ((= n 3)
> >          ;; Put original mode-line-format
> >          (setq mode-line-position t)
> >          (setq line-number-mode t)
> >          (setq column-number-mode t)
> >          (setq mode-line-modes t)
> >
> >          (setq mode-line-format original-mode-line-format)
> >          (force-mode-line-update)) ))
> >
> > (make-local-variable 'toggle-mode-line)
>



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

* Re: Removing line and column number settings from some buffers
  2020-12-04  6:10                                 ` Jean Louis
  2020-12-04  6:31                                   ` Christopher Dimech
  2020-12-04  8:40                                   ` Eli Zaretskii
@ 2020-12-05  5:13                                   ` Christopher Dimech
  2020-12-05 15:41                                     ` Drew Adams
  2 siblings, 1 reply; 45+ messages in thread
From: Christopher Dimech @ 2020-12-05  5:13 UTC (permalink / raw)
  To: Jean Louis; +Cc: Michael Heerdegen, help-gnu-emacs

> Sent: Friday, December 04, 2020 at 7:10 AM
> From: "Jean Louis" <bugs@gnu.support>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: daniela-spit@gmx.it, "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> > > What I want to do is to change the Mode Line, but then revert back to how it
> > > was in that buffer, by continue pressing same keybinding.  Can I store the
> > > old setup and then put it back again.
> >
> > Have got some code to cycle commands.  Shall try to dig that out.  But I don't
> > know much about changing the mode line.
>
> For session based storage, you may use the Emacs built-in library
> `ring' as it has cycling features, you store anything in ring variable
> and you can take it back and cycle through it.

No experience with ring.  How is it used and what do you do?  Suppose I want a keybinding
to cycle auto-fill with three things.

1. Auto-Fill Comments
2. Auto-Fill Entire Buffer
3. Disable Auto-Fill




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

* RE: Removing line and column number settings from some buffers
  2020-12-05  5:13                                   ` Christopher Dimech
@ 2020-12-05 15:41                                     ` Drew Adams
  2020-12-05 17:58                                       ` Jean Louis
  0 siblings, 1 reply; 45+ messages in thread
From: Drew Adams @ 2020-12-05 15:41 UTC (permalink / raw)
  To: Christopher Dimech, Jean Louis; +Cc: Michael Heerdegen, help-gnu-emacs

> No experience with ring.  How is it used and what do you do?  Suppose I
> want a keybinding to cycle auto-fill with three things.
> 
> 1. Auto-Fill Comments
> 2. Auto-Fill Entire Buffer
> 3. Disable Auto-Fill


https://lists.gnu.org/archive/html/help-gnu-emacs/2020-11/msg00392.html

And you do have experience with Emacs rings, even if you're not aware of it: 

`C-h v search-ring'
`C-h v regexp-search-ring'



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

* Re: Removing line and column number settings from some buffers
  2020-12-05 15:41                                     ` Drew Adams
@ 2020-12-05 17:58                                       ` Jean Louis
  2020-12-05 18:16                                         ` Drew Adams
  0 siblings, 1 reply; 45+ messages in thread
From: Jean Louis @ 2020-12-05 17:58 UTC (permalink / raw)
  To: Drew Adams; +Cc: Michael Heerdegen, Christopher Dimech, help-gnu-emacs

* Drew Adams <drew.adams@oracle.com> [2020-12-05 18:42]:
> > No experience with ring.  How is it used and what do you do?  Suppose I
> > want a keybinding to cycle auto-fill with three things.
> > 
> > 1. Auto-Fill Comments
> > 2. Auto-Fill Entire Buffer
> > 3. Disable Auto-Fill
> 
> 
> https://lists.gnu.org/archive/html/help-gnu-emacs/2020-11/msg00392.html
> 
> And you do have experience with Emacs rings, even if you're not aware of it: 
> 
> `C-h v search-ring'
> `C-h v regexp-search-ring'

Please help with `toto' in this example.

On the other hand, if you want to be able to go either
forward or backward then you might want to use a ring
(as defined in standard library ring.el):

(defvar ring (ring-convert-sequence-to-ring '(nil t always)))
(defvar current nil)

(defun next ()
  (interactive)
  (setq current  (ring-next toto current))
  (message "NOW: %s" current))

(defun previous ()
  (interactive)
  (setq current  (ring-previous toto current))
  (message "NOW: %s" current))



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

* RE: Removing line and column number settings from some buffers
  2020-12-05 17:58                                       ` Jean Louis
@ 2020-12-05 18:16                                         ` Drew Adams
  2020-12-05 18:57                                           ` Jean Louis
  0 siblings, 1 reply; 45+ messages in thread
From: Drew Adams @ 2020-12-05 18:16 UTC (permalink / raw)
  To: Jean Louis; +Cc: Michael Heerdegen, Christopher Dimech, help-gnu-emacs

> Please help with `toto' in this example.
> 
> On the other hand, if you want to be able to go either
> forward or backward then you might want to use a ring
> (as defined in standard library ring.el):
> 
> (defvar ring (ring-convert-sequence-to-ring '(nil t always)))
          ^^^^
> (defvar current nil)
> 
> (defun next ()
>   (interactive)
>   (setq current  (ring-next toto current))
                              ^^^^
>   (message "NOW: %s" current))
> 
> (defun previous ()
>   (interactive)
>   (setq current  (ring-previous toto current))
                                  ^^^^
>   (message "NOW: %s" current))

Sorry, typo.  Variable `toto' should be variable `ring'.
(Or vice versa - there should be only one ring variable.)



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

* Re: Removing line and column number settings from some buffers
  2020-12-05 18:16                                         ` Drew Adams
@ 2020-12-05 18:57                                           ` Jean Louis
  0 siblings, 0 replies; 45+ messages in thread
From: Jean Louis @ 2020-12-05 18:57 UTC (permalink / raw)
  To: Drew Adams; +Cc: Michael Heerdegen, Christopher Dimech, help-gnu-emacs

(defvar ring (ring-convert-sequence-to-ring '(nil t always)))

(defvar current nil)

(defun next ()
  (interactive)
  (setq current  (ring-next ring current))
   (message "NOW: %s" current))
 
 (defun previous ()
   (interactive)
   (setq current  (ring-previous ring current))
   (message "NOW: %s" current))

> Sorry, typo.  Variable `toto' should be variable `ring'.
> (Or vice versa - there should be only one ring variable.)

(previous)
(next)

Thank you. That built-in feature is great and I can use it for history
in Hyperscope dynamic knowledge repository.




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

* Re: Removing line and column number settings from some buffers
  2020-12-05  4:42                                       ` daniela-spit
@ 2020-12-05 21:32                                         ` Michael Heerdegen
  0 siblings, 0 replies; 45+ messages in thread
From: Michael Heerdegen @ 2020-12-05 21:32 UTC (permalink / raw)
  To: help-gnu-emacs

daniela-spit@gmx.it writes:

> Have tried using your suggestion.  The file is being created
> with the correct information.  However, when the code gets to
> option 3, the Mode Line is not being reverted to its original
> state.

You nowhere change the contents of `mode-line-format'.  You only change
the contents of variables referenced by `mode-line-format'.  So what you
restore is the current unchanged value of `mode-line-format'.  Please
have a look at the values of the variables.

Michael.




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

* Re: Removing line and column number settings from some buffers
  2020-12-04  4:36                                 ` daniela-spit
  2020-12-04  5:58                                   ` daniela-spit
@ 2020-12-05 21:35                                   ` Michael Heerdegen
  2020-12-05 22:54                                     ` daniela-spit
  1 sibling, 1 reply; 45+ messages in thread
From: Michael Heerdegen @ 2020-12-05 21:35 UTC (permalink / raw)
  To: daniela-spit; +Cc: Christopher Dimech, help-gnu-emacs

daniela-spit@gmx.it writes:

> One problem is how to store (get 'time-frmt-cycle 'state) in a
> variable.

If you save the state already in the state property of `time-frmt-cycle'
you don't need a variable for storing.  What specifically is your
question?

Michael.



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

* Re: Removing line and column number settings from some buffers
  2020-12-05 21:35                                   ` Michael Heerdegen
@ 2020-12-05 22:54                                     ` daniela-spit
  2020-12-05 22:57                                       ` Drew Adams
  0 siblings, 1 reply; 45+ messages in thread
From: daniela-spit @ 2020-12-05 22:54 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

Look at this code.  Correct, you don't need a variable for storing,
but what is happening with n in the following code.

The byte compiler complains about the variable n

(defun auto-fill-cycle ()
   "Cycles Auto Fill.  Automatically breaks lines that get beyond
variable fill-column."
   (interactive)

   ;; ----- body of let -----
;;   (unless (get 'auto-fill-cycle 'state)
;;      (put 'auto-fill-cycle 'state 1))

   (setq-local n (get 'auto-fill-cycle 'state))

;;   (when (= n 1)
   (when (or (not n) (= n 1))
      (message "Auto Fill Comments Only")
      (set (make-local-variable 'comment-auto-fill-only-comments) t)
      (auto-fill-mode 1)
      (put 'auto-fill-cycle 'state 2))
   (when (= n 2)
      (message "Auto Fill Whole Buffer")
      (set (make-local-variable 'comment-auto-fill-only-comments) nil)
      (put 'auto-fill-cycle 'state 3))
   (when (= n 3)
      (message "Disable Auto Fill")
      (auto-fill-mode 0)
      (put 'auto-fill-cycle 'state 1)) )

(global-set-key (kbd "H-a") #'auto-fill-cycle)




> Sent: Saturday, December 05, 2020 at 10:35 PM
> From: "Michael Heerdegen" <michael_heerdegen@web.de>
> To: daniela-spit@gmx.it
> Cc: "Christopher Dimech" <dimech@gmx.com>, help-gnu-emacs@gnu.org
> Subject: Re: Removing line and column number settings from some buffers
>
> daniela-spit@gmx.it writes:
>
> > One problem is how to store (get 'time-frmt-cycle 'state) in a
> > variable.
>
> If you save the state already in the state property of `time-frmt-cycle'
> you don't need a variable for storing.  What specifically is your
> question?
>
> Michael.
>



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

* RE: Removing line and column number settings from some buffers
  2020-12-05 22:54                                     ` daniela-spit
@ 2020-12-05 22:57                                       ` Drew Adams
  2020-12-05 23:05                                         ` daniela-spit
  0 siblings, 1 reply; 45+ messages in thread
From: Drew Adams @ 2020-12-05 22:57 UTC (permalink / raw)
  To: daniela-spit, Michael Heerdegen; +Cc: help-gnu-emacs

> Look at this code.  Correct, you don't need a variable for storing,
> but what is happening with n in the following code.
> 
> The byte compiler complains about the variable n
> 
> (defun auto-fill-cycle ()
>    (interactive)
>    (setq-local n (get 'auto-fill-cycle 'state))...)

`n' is a free variable.  Add a `defvar' for it, if you
don't want Emacs to tell you about that.



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

* Re: RE: Removing line and column number settings from some buffers
  2020-12-05 22:57                                       ` Drew Adams
@ 2020-12-05 23:05                                         ` daniela-spit
  2020-12-05 23:37                                           ` Drew Adams
  0 siblings, 1 reply; 45+ messages in thread
From: daniela-spit @ 2020-12-05 23:05 UTC (permalink / raw)
  To: Drew Adams; +Cc: Michael Heerdegen, help-gnu-emacs



> Sent: Saturday, December 05, 2020 at 11:57 PM
> From: "Drew Adams" <drew.adams@oracle.com>
> To: daniela-spit@gmx.it, "Michael Heerdegen" <michael_heerdegen@web.de>
> Cc: help-gnu-emacs@gnu.org
> Subject: RE: Removing line and column number settings from some buffers
>
> > Look at this code.  Correct, you don't need a variable for storing,
> > but what is happening with n in the following code.
> >
> > The byte compiler complains about the variable n
> >
> > (defun auto-fill-cycle ()
> >    (interactive)
> >    (setq-local n (get 'auto-fill-cycle 'state))...)
>
> `n' is a free variable.  Add a `defvar' for it, if you
> don't want Emacs to tell you about that.

Would that be a valid approach or is it just to stop emacs complaining?

Was considering to use

(let (n)
...



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

* RE: RE: Removing line and column number settings from some buffers
  2020-12-05 23:05                                         ` daniela-spit
@ 2020-12-05 23:37                                           ` Drew Adams
  2020-12-05 23:53                                             ` daniela-spit
  0 siblings, 1 reply; 45+ messages in thread
From: Drew Adams @ 2020-12-05 23:37 UTC (permalink / raw)
  To: daniela-spit; +Cc: Michael Heerdegen, help-gnu-emacs

> > > Look at this code.  Correct, you don't need a variable for storing,
> > > but what is happening with n in the following code.
> > >
> > > The byte compiler complains about the variable n
> > >
> > > (defun auto-fill-cycle ()
> > >    (interactive)
> > >    (setq-local n (get 'auto-fill-cycle 'state))...)
> >
> > `n' is a free variable.  Add a `defvar' for it, if you
> > don't want Emacs to tell you about that.
> 
> Would that be a valid approach or is it just to stop emacs complaining?

Valid.  The variable is free in your function.

> Was considering to use (let (n) ...

Where are you going to put your `let'?

You want the value to persist beyond an invocation of
your function, right?



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

* Re: RE: RE: Removing line and column number settings from some buffers
  2020-12-05 23:37                                           ` Drew Adams
@ 2020-12-05 23:53                                             ` daniela-spit
  0 siblings, 0 replies; 45+ messages in thread
From: daniela-spit @ 2020-12-05 23:53 UTC (permalink / raw)
  To: Drew Adams; +Cc: Michael Heerdegen, help-gnu-emacs



> Sent: Sunday, December 06, 2020 at 12:37 AM
> From: "Drew Adams" <drew.adams@oracle.com>
> To: daniela-spit@gmx.it
> Cc: "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> Subject: RE: RE: Removing line and column number settings from some buffers
>
> > > > Look at this code.  Correct, you don't need a variable for storing,
> > > > but what is happening with n in the following code.
> > > >
> > > > The byte compiler complains about the variable n
> > > >
> > > > (defun auto-fill-cycle ()
> > > >    (interactive)
> > > >    (setq-local n (get 'auto-fill-cycle 'state))...)
> > >
> > > `n' is a free variable.  Add a `defvar' for it, if you
> > > don't want Emacs to tell you about that.
> >
> > Would that be a valid approach or is it just to stop emacs complaining?
>
> Valid.  The variable is free in your function.
>
> > Was considering to use (let (n) ...
>
> Where are you going to put your `let'?
>
> You want the value to persist beyond an invocation of
> your function, right?

auto-fill would be buffer local and the function property 'state' in
being changed.  Additionally, it is only used so not to use the longer
(get 'auto-fill-cycle 'state) for the when condition.  Why would you want
'n' to persist beyond an invocation of auto-fill-cycle?  I don't see a reason
to do that.  Can do '(let (n)' and close it after setting the state to 1 when
the function gets cycled to  state 3.

With the use of 'let' would I then use the following?
(setq n (get 'gungadin-auto-fill-cycle 'state))

>



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

end of thread, other threads:[~2020-12-05 23:53 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-02 15:34 Removing line and column number settings from some buffers daniela-spit
2020-12-02 21:18 ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-02 23:21   ` daniela-spit
2020-12-02 23:28     ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-02 23:32       ` daniela-spit
2020-12-02 23:56         ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-02 23:57         ` daniela-spit
2020-12-03  0:04           ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-12-03 22:14           ` Michael Heerdegen
2020-12-03 22:19             ` daniela-spit
2020-12-03 22:22               ` Jean Louis
2020-12-03 22:33                 ` daniela-spit
2020-12-03 22:52                   ` Jean Louis
2020-12-03 23:09                     ` daniela-spit
2020-12-04  0:38                       ` Christopher Dimech
2020-12-04  1:16                         ` Michael Heerdegen
2020-12-04  1:33                           ` Christopher Dimech
2020-12-04  2:10                             ` daniela-spit
2020-12-04  2:42                               ` Christopher Dimech
2020-12-04  6:10                                 ` Jean Louis
2020-12-04  6:31                                   ` Christopher Dimech
2020-12-04  8:40                                   ` Eli Zaretskii
2020-12-05  5:13                                   ` Christopher Dimech
2020-12-05 15:41                                     ` Drew Adams
2020-12-05 17:58                                       ` Jean Louis
2020-12-05 18:16                                         ` Drew Adams
2020-12-05 18:57                                           ` Jean Louis
2020-12-04  2:46                               ` Michael Heerdegen
2020-12-04  3:12                                 ` Christopher Dimech
2020-12-04  4:16                               ` daniela-spit
2020-12-04  4:36                                 ` daniela-spit
2020-12-04  5:58                                   ` daniela-spit
2020-12-04  7:19                                     ` Jean Louis
2020-12-05  4:42                                       ` daniela-spit
2020-12-05 21:32                                         ` Michael Heerdegen
2020-12-05 21:35                                   ` Michael Heerdegen
2020-12-05 22:54                                     ` daniela-spit
2020-12-05 22:57                                       ` Drew Adams
2020-12-05 23:05                                         ` daniela-spit
2020-12-05 23:37                                           ` Drew Adams
2020-12-05 23:53                                             ` daniela-spit
2020-12-04  7:40                                 ` Jean Louis
2020-12-04  6:07                               ` Jean Louis
2020-12-03 23:24               ` Michael Heerdegen
2020-12-03 23:36                 ` daniela-spit

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.