From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Line Numbers and the Options Menu Date: Thu, 13 Jul 2017 13:33:34 +0200 Message-ID: <87h8yg7er5.fsf@detlef> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1499945633 641 195.159.176.226 (13 Jul 2017 11:33:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 13 Jul 2017 11:33:53 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 13 13:33:47 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 1dVcNM-0008AJ-1y for ged-emacs-devel@m.gmane.org; Thu, 13 Jul 2017 13:33:44 +0200 Original-Received: from localhost ([::1]:58899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVcNR-0005E9-G7 for ged-emacs-devel@m.gmane.org; Thu, 13 Jul 2017 07:33:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVcNK-0005Dn-44 for emacs-devel@gnu.org; Thu, 13 Jul 2017 07:33:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVcNF-0004we-7I for emacs-devel@gnu.org; Thu, 13 Jul 2017 07:33:42 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:58074) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVcNE-0004wA-Rf for emacs-devel@gnu.org; Thu, 13 Jul 2017 07:33:37 -0400 Original-Received: from detlef.gmx.de ([213.220.147.117]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MK0Np-1dUFSd3x4v-001RvF for ; Thu, 13 Jul 2017 13:33:35 +0200 X-Provags-ID: V03:K0:4F+AlHQQ4t5PH7wkreq9ET9ISQHkNEQWI3//TS9k0GhmL/62fwk Q+kTMYzJfrShpqoNOvHQfZ9PM7Pvw//Cv7Dh7I+GLHL9IZ4EOik1Uhf8Pl3fz70ClQ8dPnw ISaRD/vLg2TPV95gyh7br4vARItyuPIe+ste67D6M/z5hKCS8fjfJum97g5JcOzoz5ss5/v yrcYO3cZTLHjpGeorq/DA== X-UI-Out-Filterresults: notjunk:1;V01:K0:QGIgOitIxdo=:rgrnY0HNLRXcI8PyT/XfHk C9O0abXofLCsVX4fNHO82NsMGutjIgzum4JsFjSPqrqtfhD5q1N1GvxekK7OObzaNzvv5iqXC QLwqmZqbPcxh2Hl575SX7uZHv6KTPNPnd2PgMAak22aZXo0JeH8+w9v4VTQmQR6ybVbFToyC5 oQZXKnPHH5ZgS2vAeiwhOZZW5SdYTsmpnHWepiONhHlHOd3nEqF9LeYeTnx7W2ELLhDys9Eeu aDQN26Hq/AE1d3G5yr6k+Bq6Q/R5kc798Ey4Re6eE6xAAJ3q3bahMzubq5Hmp5hQHmP+dKWxV mB8j7l1QALFd1gkScSLvqxcBIZwFfoK4Nu4uXwnKzoXdXyFHLbxqHRHQ5TSD2QHGfB0oxch8Y KUrscRqQDhANZeCRk9Qjft27NCowDiBAsY4FmGSVWi47fOc0/0Dwd+YMsm6jBJTH3JByc54QV FkbffL/9exyySP6cmbPWUCsX1n006nrV64gzM+Y8uc6nurAHv2wRxQbCIkw+kelTcEo/ty6GY PSfXJTmMl3q7VxhuNFrO8N13JomEofKS5pJfAyxmt94cu4UmRXb7/Rvk+yZQKkrR/7ugFx8g9 dcUM+D+cLnsYyNMZjKgm/pbyirohLUtLPyarai0lsqd+gEQ6v5cXhyPbz8XOsRtcXBbjK724g M12LbziWdHt0FbV9J96Cp/k3Vsq+vvc6aEfiKkm1Mcz9Pkq655dCoebSLLgjy4tbcDDsiiEUp vGTRQ71LVlmUy6OclXgbTs8UWZPQxcSkgEf8ng5nOA5iaY8LuKGRomu60Ih2cr2AKiryuQHu X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.15.18 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:216573 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=*vc-diff* diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 3ca7d1b..612ea65 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1202,6 +1202,50 @@ menu-bar-showhide-menu 'tool-bar-lines)))))) menu)) +(defvar menu-bar-line-numbers-menu + (let ((menu (make-sparse-keymap "Line Numbers"))) + + (bindings--define-key menu [visual] + `(menu-item "Visual Line Numbers" + ,(lambda () + (interactive) + (setq display-line-numbers 'visual) + (message "Visual line numbers enabled")) + :help "Enable visual line numbers" + :button (:radio . (eq display-line-numbers 'visual)) + :visible (menu-bar-menu-frame-live-and-visible-p))) + + (bindings--define-key menu [relative] + `(menu-item "Relative Line Numbers" + ,(lambda () + (interactive) + (setq display-line-numbers 'relative) + (message "Relative line numbers enabled")) + :help "Enable relative line numbers" + :button (:radio . (eq display-line-numbers 'relative)) + :visible (menu-bar-menu-frame-live-and-visible-p))) + + (bindings--define-key menu [absolute] + `(menu-item "Absolute Line Numbers" + ,(lambda () + (interactive) + (setq display-line-numbers t) + (message "Absolute line numbers enabled")) + :help "Enable absolute line numbers" + :button (:radio . (eq display-line-numbers t)) + :visible (menu-bar-menu-frame-live-and-visible-p))) + + (bindings--define-key menu [none] + `(menu-item "No Line Numbers" + ,(lambda () + (interactive) + (setq display-line-numbers nil) + (message "Line numbers disabled")) + :help "Disable line numbers" + :button (:radio . (null display-line-numbers)) + :visible (menu-bar-menu-frame-live-and-visible-p))) + menu)) + (defvar menu-bar-line-wrapping-menu (let ((menu (make-sparse-keymap "Line Wrapping"))) @@ -1408,6 +1452,10 @@ menu-bar-options-menu `(menu-item "Default Search Options" ,menu-bar-search-options-menu)) + (bindings--define-key menu [line-numbers] + `(menu-item "Line Numbers in This Buffer" + ,menu-bar-line-numbers-menu)) + (bindings--define-key menu [line-wrapping] `(menu-item "Line Wrapping in This Buffer" ,menu-bar-line-wrapping-menu)) --=-=-=--