From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.devel Subject: Re: Line Numbers and the Options Menu Date: Fri, 14 Jul 2017 00:18:51 -0600 Message-ID: <877ezbzgl0.fsf@lylat> References: <87h8yg7er5.fsf@detlef> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1500013439 664 195.159.176.226 (14 Jul 2017 06:23:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 14 Jul 2017 06:23:59 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 14 08:23:46 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVu0m-0007Oz-Pr for ged-emacs-devel@m.gmane.org; Fri, 14 Jul 2017 08:23:36 +0200 Original-Received: from localhost ([::1]:35726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVu0s-0007M3-23 for ged-emacs-devel@m.gmane.org; Fri, 14 Jul 2017 02:23:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVtwi-0004ZU-RY for emacs-devel@gnu.org; Fri, 14 Jul 2017 02:19:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVtwf-0003sb-KO for emacs-devel@gnu.org; Fri, 14 Jul 2017 02:19:24 -0400 Original-Received: from mail-it0-x22e.google.com ([2607:f8b0:4001:c0b::22e]:35254) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVtwf-0003qH-EV for emacs-devel@gnu.org; Fri, 14 Jul 2017 02:19:21 -0400 Original-Received: by mail-it0-x22e.google.com with SMTP id v202so12976846itb.0 for ; Thu, 13 Jul 2017 23:19:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=YljLOy9iMcQj9SyRXzB9xZ9qUOOn1eAgxXYj5G1HBX8=; b=JaK2cyGtuqbT7myH+6FuJqFDBWhQa+C92sQ3Jpfnob9yZjhBRr0pYvtC7RSPUM+u+C qwdE4kS4qWME2YGJKpROBw906nefY6aRXEq9pZdDJRMI7srlclz9JAI6eoDNZCTZuTRr iKtlaRBIk8TzZTDxDVbs7BxA2uf7RGApk9c5EEaqgHU1srpLOR+/rSQzbNDQ9q7MqWRr bRcVYAtvU3Xn6quMNh2cgg4Veypwi2gWZPzyht4uM2KmQajw7T4IT10KtgzZhKqgqODD Mb11bF8KLQmzk1qOvkmPg7YnJq97A4I1pZwJGufgJ/XLDGZA3UE2kexASpMBmZFGDBqj lgrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=YljLOy9iMcQj9SyRXzB9xZ9qUOOn1eAgxXYj5G1HBX8=; b=bFAcgkvEoGLcot1enpbuxXq1YCmtDZ2m5UgRsl/mWZiXrUrgoyf5w5ascuhMX/nZAN mlWyd1KErzpUOWAzLCtr/ucqVrUih2NglpGZjHCnmacn0IxVEgetiKTY75DmPGO/vgEA ceJPnSQHjtw3e+nDGWdiL2+NMOTsbMsRKb3dfEDuHyh07XtDCXUsaZRzcclwkqfydoJw 9kI/ybak3VGN6NJIfV/o4hS5mGdLLhVu8Uv3ukgkzHkDqA9+58hPb1RtgpoA1+ezzcE0 To+6phpmDx9CbvmmufV8jMqqCPTgUyD5oToGGTNuJJGxKhqW/5RP6EOCKJgfsgDfLeEc lDxw== X-Gm-Message-State: AIVw112ZpM7EgxWmx6LfrVaYfqMhdnRhICkwO+YXYBG2sxYsvxB5LK6l 8KkXD4Y4dgvsSEOc X-Received: by 10.36.10.16 with SMTP id 16mr2381130itw.7.1500013158807; Thu, 13 Jul 2017 23:19:18 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id n127sm827650itg.6.2017.07.13.23.19.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 23:19:17 -0700 (PDT) In-Reply-To: <87h8yg7er5.fsf@detlef> (Michael Albinus's message of "Thu, 13 Jul 2017 13:33:34 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216632 Archived-At: Michael Albinus 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