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

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

Re: Function for enabling or disabling emacs bars


From: angelomolina
Subject: Re: Function for enabling or disabling emacs bars
Date: Mon, 14 Mar 2022 18:40:49 +0100 (CET)

Mar 14, 2022, 15:02 by project@gnuhacker.org:

> angelomolina--- via Users list for the GNU Emacs text editor
> <help-gnu-emacs@gnu.org> writes:
>
>> Would like to have a function that enables or disables emacs bars.  Perhaps 
>> using an optional
>> argument for this?
>>
>> (defun emacsbars ()
>>  "Enables or disables Emacs Bars"
>>  (menu-bar-mode 1)
>>  (tool-bar-mode 1)
>>  (scroll-bar-mode 1))
>>
>
> #+begin_src elisp
>
> (defun emacsbars (&optional num)
>  "Enables or disables Emacs Bars"
>  (interactive "p")
>  (menu-bar-mode num)
>  (tool-bar-mode num)
>  (scroll-bar-mode num))
>  
> #+end_src
>
> Try with:
>
> M-x emacsbars RET --> show bars
>
> C-u  -1  M-x emacsbars RET --> hide bars
>

Could I also call it using  (emacsbars  1)  and  (emacsbars  -1)  ?


> -- 
> Emacs Lover.
> FSF Member.
> Free/Libre Software supporter.
> stallmansupport.org - Disinformation succeeds because so many people
> care deeply about injustice but do not take the time to check the facts.
>



reply via email to

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