From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#27047: 26.0.50; Scroll bar menu UI glitches [patch] Date: Tue, 23 May 2017 23:08:03 +0200 Message-ID: <87d1azffik.fsf@rosalinde> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1495573755 12847 195.159.176.226 (23 May 2017 21:09:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 23 May 2017 21:09:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: 27047@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 23 23:09:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dDH3H-0003Ay-7r for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 May 2017 23:09:11 +0200 Original-Received: from localhost ([::1]:51611 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDH3L-0001Bp-1E for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 May 2017 17:09:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDH3D-0001BY-9X for bug-gnu-emacs@gnu.org; Tue, 23 May 2017 17:09:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDH38-0004Rz-4r for bug-gnu-emacs@gnu.org; Tue, 23 May 2017 17:09:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60719) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dDH38-0004Rr-04 for bug-gnu-emacs@gnu.org; Tue, 23 May 2017 17:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dDH37-0004EA-R7 for bug-gnu-emacs@gnu.org; Tue, 23 May 2017 17:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 May 2017 21:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 27047 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.149557370416198 (code B ref -1); Tue, 23 May 2017 21:09:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 May 2017 21:08:24 +0000 Original-Received: from localhost ([127.0.0.1]:35163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dDH2V-0004DA-F7 for submit@debbugs.gnu.org; Tue, 23 May 2017 17:08:24 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dDH2S-0004Cw-SK for submit@debbugs.gnu.org; Tue, 23 May 2017 17:08:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDH2M-00042y-3U for submit@debbugs.gnu.org; Tue, 23 May 2017 17:08:15 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:47892) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dDH2L-00042s-VD for submit@debbugs.gnu.org; Tue, 23 May 2017 17:08:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDH2K-00019F-18 for bug-gnu-emacs@gnu.org; Tue, 23 May 2017 17:08:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDH2E-000408-RX for bug-gnu-emacs@gnu.org; Tue, 23 May 2017 17:08:11 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:64889) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dDH2E-0003zq-Fv for bug-gnu-emacs@gnu.org; Tue, 23 May 2017 17:08:06 -0400 Original-Received: from rosalinde ([83.135.14.80]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M8NWM-1e8yDh2Sd0-00vxvX for ; Tue, 23 May 2017 23:08:04 +0200 X-Provags-ID: V03:K0:irfe3CjHldbQ8VXjlXLsCEK6wg0tu7JHJLFXNovd+6lsSwCN6xr 3SDPKQty6eIgxYgAeBMFXemHzVYGCWE0agcyWrY6tSPMKDpoQg5S6MWLYgDMf8lliISvBn0 huHCF7JDSXsw3ZY0W8jBXJAM1Nz7lVcet6x2zbIFhxxag39KG3EW7Pe7ttoED3M47GJkFjV tWaJZf/ML7pTr4aHYUQvg== X-UI-Out-Filterresults: notjunk:1;V01:K0:QgpLAm8lUdo=:cUbOBDSE56nka/GCEwT+ds jqo2SNL3YI6VPIVoADBBZOLNl93HfOSJh8RLdCkYs6BSv6sDy9T4UlmUqDzWMZ59+LNcCgkWq 6/cC4fhAWor+aG4gNXYTWc2VC44embvZ0+dBEVKv9jbniL3D/FZk74LTo2tlDwSCd//DRpB7a G2my5iAoikaNqyqJAqgASz6hlHwznAL10CVIiqaJCeZFyPpbmkJcZWmxJgQ9gAarTS51hjEbE 6PiopvvFre5JB0whF2ee/43MGnMIQsqZ6FdQgMDUsIO7bJv0PoFTXZ/LpxS6RRsuyfsOVNIPU ujRHduYz9ZOPkYegBHnZXoDAugZFAhE98pe99Tzly8UCyIHgUffYw1dQALppPjwQIUhZtO+L+ /yJ71xaUM+znO2RQqa+5vtcuTHNjud7ZRgCgMMo86jZi+4Ky9TyYybCtLOnMBYFVV+D0kdHLd vwbLePOLKSNSrPmZol8GA1zS3fBHSRdwzsfc2LGWt5kPeDc3K0anGdKgtQjN6PPtVOcB+9BhJ UJ/3dwhgJB8Vz88T7xO3O3F99bjamZce3xyP9jrH/o5B3eSCVMxswinakWynfKAkKh2s8KdAl bBwvQWdv3dC0GJ9kD8BhUH8ZyihZqsqBJsadrzG3JtK/0A+zL1zkUDXtvnXjqYMGQaz4evTAS T1UPcokRLLf/Flv2Ja86xV/FWpIn6m+WZ4dnDBKsv40DdFalk2m6/e39Wmid7/sWC2wY4OV3B wAtg1qJNOLhA6Qto2GD6EYhgkq5KmX4tnAHzyxnsRXAG3jTNLvMxka+P7Vs= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:132767 Archived-At: --=-=-= Content-Type: text/plain The Options->Show/Hide->Scroll-bar menu functions correctly -- when you press any of the five radio buttons, the result is what it should be -- but the UI is broken. With -Q the vertical scroll bar is on the right, there is no horizontal scroll bar and the menu shows the radio button "None-horizontal" [sic] pressed. If you press any of the other buttons in that menu, the scroll bars change accordingly, but the menu continues to show the same "None-horizontal" button pressed. The attached patch fixes this UI glitch. In addition, I find the current scroll bar menu somewhat incoherent and the patch offers an improvement (IMO): the radio buttons are confined to the vertical scroll bar, and the two buttons for the horizontal scroll bar are replaced by a single check box toggle, and a separator is added to visually emphasize that two UI components are involved. While I was looking at the Show/Hide menu, I noticed that the spelling there is not consistent with the convention of the Emacs manual, which uses "scroll bar", "tool bar" and "menu bar" without hyphenation. So the patch changes the spelling of these in the menu and tooltips too. In GNU Emacs 26.0.50 (build 19, x86_64-pc-linux-gnu, GTK+ Version 3.22.8) of 2017-05-22 built on rosalinde Repository revision: bc78276e81956b3caa8a5eb7ef26959fa4c84b7b Windowing system distributor 'The X.Org Foundation', version 11.0.11901000 --=-=-= Content-Type: text/plain Content-Disposition: inline Content-Description: ChangeLog entry 2017-05-23 Stephen Berman Fix and improve UI of scroll bar menu In addition, since the Emacs manual writes "scroll bar", "tool bar" and "menu bar", use this convention in the Show/Hide menues and tooltips as well. * lisp/menu-bar.el (menu-bar-showhide-scroll-bar-menu): Make pressing a radio button in the menu actually show that it was pressed. Replace the two radio buttons to turn the horizontal scroll bar on and off with a single check-box toggle and add a separator between this and the vertical scroll bar radio buttons. (menu-bar-showhide-tool-bar-menu): (menu-bar-showhide-menu): (menu-bar-mode): Use conventional spelling. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: Show/Hide menu patch diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 6befa6d234..c8eb565942 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -981,43 +981,39 @@ menu-bar-no-horizontal-scroll-bar (customize-set-variable 'horizontal-scroll-bar-mode nil)) (defvar menu-bar-showhide-scroll-bar-menu - (let ((menu (make-sparse-keymap "Scroll-bar")) - (vsb (frame-parameter nil 'vertical-scroll-bars)) - (hsb (frame-parameter nil 'horizontal-scroll-bars))) + (let ((menu (make-sparse-keymap "Scroll Bar"))) + (bindings--define-key menu [horizontal] - `(menu-item "Horizontal" - menu-bar-horizontal-scroll-bar - :help "Horizontal scroll bar" - :visible (horizontal-scroll-bars-available-p) - :button (:radio . ,hsb))) - - (bindings--define-key menu [none-horizontal] - `(menu-item "None-horizontal" - menu-bar-no-horizontal-scroll-bar - :help "Turn off horizontal scroll bars" - :visible (horizontal-scroll-bars-available-p) - :button (:radio . (not ,hsb)))) + (menu-bar-make-mm-toggle horizontal-scroll-bar-mode + "Horizontal" + "Horizontal scroll bar")) + + (bindings--define-key menu [scrollbar-separator] + menu-bar-separator) (bindings--define-key menu [right] - `(menu-item "On the Right" - menu-bar-right-scroll-bar - :help "Scroll-bar on the right side" + '(menu-item "On the Right" menu-bar-right-scroll-bar + :help "Scroll bar on the right side" :visible (display-graphic-p) - :button (:radio . (eq ,vsb 'right)))) + :button (:radio . (and scroll-bar-mode + (eq (frame-parameter + nil 'vertical-scroll-bars) + 'right))))) (bindings--define-key menu [left] - `(menu-item "On the Left" - menu-bar-left-scroll-bar - :help "Scroll-bar on the left side" + '(menu-item "On the Left" menu-bar-left-scroll-bar + :help "Scroll bar on the left side" :visible (display-graphic-p) - :button (:radio . (eq ,vsb 'left)))) + :button (:radio . (and scroll-bar-mode + (eq (frame-parameter + nil 'vertical-scroll-bars) + 'left))))) (bindings--define-key menu [none] - `(menu-item "None" - menu-bar-no-scroll-bar - :help "Turn off scroll-bar" + '(menu-item "No Vertical Scroll Bar" menu-bar-no-scroll-bar + :help "Turn off vertical scroll bar" :visible (display-graphic-p) - :button (:radio . (not ,vsb)))) + :button (:radio . (eq scroll-bar-mode nil)))) menu)) (defun menu-bar-frame-for-menubar () @@ -1057,24 +1053,24 @@ menu-bar-showhide-tool-bar-menu-customize-enable-bottom (when (featurep 'move-toolbar) (defvar menu-bar-showhide-tool-bar-menu - (let ((menu (make-sparse-keymap "Tool-bar"))) + (let ((menu (make-sparse-keymap "Tool Bar"))) (bindings--define-key menu [showhide-tool-bar-left] '(menu-item "On the Left" menu-bar-showhide-tool-bar-menu-customize-enable-left - :help "Tool-bar at the left side" + :help "Tool bar at the left side" :visible (display-graphic-p) :button (:radio . (and tool-bar-mode - (eq (frame-parameter + (frame-parameter (menu-bar-frame-for-menubar) 'tool-bar-position) - 'left))))) + 'left)))) (bindings--define-key menu [showhide-tool-bar-right] '(menu-item "On the Right" menu-bar-showhide-tool-bar-menu-customize-enable-right - :help "Tool-bar at the right side" + :help "Tool bar at the right side" :visible (display-graphic-p) :button (:radio . (and tool-bar-mode @@ -1086,7 +1082,7 @@ menu-bar-showhide-tool-bar-menu-customize-enable-bottom (bindings--define-key menu [showhide-tool-bar-bottom] '(menu-item "On the Bottom" menu-bar-showhide-tool-bar-menu-customize-enable-bottom - :help "Tool-bar at the bottom" + :help "Tool bar at the bottom" :visible (display-graphic-p) :button (:radio . (and tool-bar-mode @@ -1098,7 +1094,7 @@ menu-bar-showhide-tool-bar-menu-customize-enable-bottom (bindings--define-key menu [showhide-tool-bar-top] '(menu-item "On the Top" menu-bar-showhide-tool-bar-menu-customize-enable-top - :help "Tool-bar at the top" + :help "Tool bar at the top" :visible (display-graphic-p) :button (:radio . (and tool-bar-mode @@ -1110,7 +1106,7 @@ menu-bar-showhide-tool-bar-menu-customize-enable-bottom (bindings--define-key menu [showhide-tool-bar-none] '(menu-item "None" menu-bar-showhide-tool-bar-menu-customize-disable - :help "Turn tool-bar off" + :help "Turn tool bar off" :visible (display-graphic-p) :button (:radio . (eq tool-bar-mode nil)))) menu))) @@ -1168,7 +1164,7 @@ menu-bar-showhide-menu :visible (display-graphic-p))) (bindings--define-key menu [showhide-scroll-bar] - `(menu-item "Scroll-bar" ,menu-bar-showhide-scroll-bar-menu + `(menu-item "Scroll Bar" ,menu-bar-showhide-scroll-bar-menu :visible (display-graphic-p))) (bindings--define-key menu [showhide-tooltip-mode] @@ -1178,8 +1174,8 @@ menu-bar-showhide-menu :button (:toggle . tooltip-mode))) (bindings--define-key menu [menu-bar-mode] - '(menu-item "Menu-bar" toggle-menu-bar-mode-from-frame - :help "Turn menu-bar on/off" + '(menu-item "Menu Bar" toggle-menu-bar-mode-from-frame + :help "Turn menu bar on/off" :button (:toggle . (menu-bar-positive-p (frame-parameter (menu-bar-frame-for-menubar) @@ -1188,12 +1184,12 @@ menu-bar-showhide-menu (if (and (boundp 'menu-bar-showhide-tool-bar-menu) (keymapp menu-bar-showhide-tool-bar-menu)) (bindings--define-key menu [showhide-tool-bar] - `(menu-item "Tool-bar" ,menu-bar-showhide-tool-bar-menu + `(menu-item "Tool Bar" ,menu-bar-showhide-tool-bar-menu :visible (display-graphic-p))) ;; else not tool bar that can move. (bindings--define-key menu [showhide-tool-bar] - '(menu-item "Tool-bar" toggle-tool-bar-mode-from-frame - :help "Turn tool-bar on/off" + '(menu-item "Tool Bar" toggle-tool-bar-mode-from-frame + :help "Turn tool bar on/off" :visible (display-graphic-p) :button (:toggle . (menu-bar-positive-p @@ -2268,11 +2264,11 @@ menu-bar-mode (assq-delete-all 'menu-bar-lines default-frame-alist))))) ;; Make the message appear when Emacs is idle. We can not call message - ;; directly. The minor-mode message "Menu-bar mode disabled" comes + ;; directly. The minor-mode message "Menu Bar mode disabled" comes ;; after this function returns, overwriting any message we do here. (when (and (called-interactively-p 'interactive) (not menu-bar-mode)) (run-with-idle-timer 0 nil 'message - "Menu-bar mode disabled. Use M-x menu-bar-mode to make the menu bar appear."))) + "Menu Bar mode disabled. Use M-x menu-bar-mode to make the menu bar appear."))) ;;;###autoload ;; (This does not work right unless it comes after the above definition.) --=-=-=--