From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#6037: 24.0.50; menu-bar-mode function doesn't toggle Date: Mon, 26 Apr 2010 23:05:18 -0400 Message-ID: References: <87r5m2vf28.fsf@kzsu.stanford.edu> <201004261741.o3QHfJq8040081@kzsu.stanford.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272338873 3954 80.91.229.12 (27 Apr 2010 03:27:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 27 Apr 2010 03:27:53 +0000 (UTC) Cc: 6037@debbugs.gnu.org To: Joe Brenner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 27 05:27:52 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O6bSh-00082d-Nk for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Apr 2010 05:27:52 +0200 Original-Received: from localhost ([127.0.0.1]:45770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6bSh-0000hJ-4a for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Apr 2010 23:27:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6bQc-0008Ry-RJ for bug-gnu-emacs@gnu.org; Mon, 26 Apr 2010 23:25:42 -0400 Original-Received: from [140.186.70.92] (port=36766 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6bQb-0008Qg-Fo for bug-gnu-emacs@gnu.org; Mon, 26 Apr 2010 23:25:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6bQZ-0002JH-97 for bug-gnu-emacs@gnu.org; Mon, 26 Apr 2010 23:25:41 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47360) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6bQZ-0002JD-7b for bug-gnu-emacs@gnu.org; Mon, 26 Apr 2010 23:25:39 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O6b7Z-0006P3-OT; Mon, 26 Apr 2010 23:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Apr 2010 03:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6037 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6037-submit@debbugs.gnu.org id=B6037.127233752524604 (code B ref 6037); Tue, 27 Apr 2010 03:06:01 +0000 Original-Received: (at 6037) by debbugs.gnu.org; 27 Apr 2010 03:05:25 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6b6y-0006On-AO for submit@debbugs.gnu.org; Mon, 26 Apr 2010 23:05:24 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6b6w-0006Oi-QI for 6037@debbugs.gnu.org; Mon, 26 Apr 2010 23:05:23 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAP7w1UvO+KoL/2dsb2JhbACcRXK/CoULBINWiDeDCw X-IronPort-AV: E=Sophos;i="4.52,277,1270440000"; d="scan'208";a="62654801" Original-Received: from 206-248-170-11.dsl.teksavvy.com (HELO ceviche.home) ([206.248.170.11]) by ironport2-out.pppoe.ca with ESMTP; 26 Apr 2010 23:05:18 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id BBC18660DC; Mon, 26 Apr 2010 23:05:18 -0400 (EDT) In-Reply-To: <201004261741.o3QHfJq8040081@kzsu.stanford.edu> (Joe Brenner's message of "Mon, 26 Apr 2010 10:41:19 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 26 Apr 2010 23:06:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36541 Archived-At: > You're of the opinion that using "nil" to turn on a minor-mode is actually > correct behavior? Yes. > And the important justification for breaking long-standing behavior > was... ? It fixes a lot of (add-hook 'foo-mode 'toto-minor-mode) where the coder assumed unconsciously that toto-minor-mode was not yet enabled. >> If you really want to toggle (I've never seen such a case from Elisp), >> just do (menu-bar-mode 'toggle). > Okay, thanks for the hint. Is that documented anywhere? Not yet. > If you'd like a use-case in elisp, I've been doing this in some form > of or another for quite some time: > ;------------ > ; luddite mode > (tool-bar-mode -1) > (global-set-key [f12] '(lambda () > (interactive) > (menu-bar-mode -1) > (scroll-bar-mode) > (setq use-dialog-box nil) > )) I don't know what this is meant to do, so I don't see where you need the toggle behavior. Note that in Emacs-23, when calling a minor-mode with nil (or no) argument to turn it off, it usually outputted a warning (because practice showed that such calls are usually erroneous). > Allow me to quote the documentation for menu-bar-mode: > "Toggle display of a menu bar on each frame." > And again for scroll-bar-mode: > "Toggle display of vertical scroll bars on all frames." And indeed M-x menu-bar-mode toggles, just like M-x scroll-bar-mode. Only the non-interactive calls are affected. Stefan