From: Alex <agrambot@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: Line Numbers and the Options Menu
Date: Fri, 14 Jul 2017 00:18:51 -0600 [thread overview]
Message-ID: <877ezbzgl0.fsf@lylat> (raw)
In-Reply-To: <87h8yg7er5.fsf@detlef> (Michael Albinus's message of "Thu, 13 Jul 2017 13:33:34 +0200")
Michael Albinus <michael.albinus@gmx.de> writes:
> Hi,
>
> now that we have `display-line-numbers', I propose to offer its setting
> in the Options Menu. Any objection to install the appended patch?
>
> Best regards, Michael.
Hi,
I personally don't use the Options menu in these situations, but I
figure I should comment since I'm making a minor mode interface for
`display-line-numbers' (see the thread starting from [1]).
Firstly, I think that it makes more sense to put this inside of the
Show/Hide submenu.
Secondly, it might be nicer to use the (hopefully) upcoming mode
interface for the menu for the following reasons:
1) The other entries in the menu appear to enable/disable features
globally.
2) The other entries appear to allow for specific buffers to
enable/disable the feature apart from the menu-bar (without them
menu-bar overwriting the buffer's customization).
Feel free to not use it though.
Here's something I quickly tested out which may help if you choose to
use the mode, which I believe satisfies the above. It would replace your
lambda expressions.
(defun menu-bar-display-line-numbers-mode (type)
(require 'display-line-numbers)
(setq-default display-line-numbers-type type)
(if type
(if global-display-line-numbers-mode
(dolist (b (buffer-list))
(with-current-buffer b
(when display-line-numbers-mode
(setq display-line-numbers type))))
(global-display-line-numbers-mode))
(global-display-line-numbers-mode -1)))
Footnotes: [1]
https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00275.html
next prev parent reply other threads:[~2017-07-14 6:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-13 11:33 Line Numbers and the Options Menu Michael Albinus
2017-07-13 16:05 ` Eli Zaretskii
2017-07-14 6:18 ` Alex [this message]
2017-07-14 8:13 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877ezbzgl0.fsf@lylat \
--to=agrambot@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).