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#19693: Further information Date: Mon, 26 Jan 2015 18:14:42 -0500 Message-ID: References: <87ppa1mw51.fsf@opmbx.org> <874mrd8hdi.fsf@opmbx.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1422314119 19554 80.91.229.3 (26 Jan 2015 23:15:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Jan 2015 23:15:19 +0000 (UTC) Cc: 19693@debbugs.gnu.org To: Mark Karpov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 27 00:15:18 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YFssE-0007bU-SF for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jan 2015 00:15:15 +0100 Original-Received: from localhost ([::1]:44541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFssD-0005Nq-VP for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Jan 2015 18:15:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFss6-0005HY-TA for bug-gnu-emacs@gnu.org; Mon, 26 Jan 2015 18:15:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFss3-0007TW-JE for bug-gnu-emacs@gnu.org; Mon, 26 Jan 2015 18:15:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFss3-0007SP-Fs for bug-gnu-emacs@gnu.org; Mon, 26 Jan 2015 18:15:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YFss2-0001hz-N9 for bug-gnu-emacs@gnu.org; Mon, 26 Jan 2015 18:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Jan 2015 23:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19693 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19693-submit@debbugs.gnu.org id=B19693.14223140876529 (code B ref 19693); Mon, 26 Jan 2015 23:15:02 +0000 Original-Received: (at 19693) by debbugs.gnu.org; 26 Jan 2015 23:14:47 +0000 Original-Received: from localhost ([127.0.0.1]:57389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YFsrm-0001hE-QB for submit@debbugs.gnu.org; Mon, 26 Jan 2015 18:14:47 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:37163) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YFsrl-0001h7-0n for 19693@debbugs.gnu.org; Mon, 26 Jan 2015 18:14:45 -0500 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t0QNEg5E013931; Mon, 26 Jan 2015 18:14:43 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id B028366135; Mon, 26 Jan 2015 18:14:42 -0500 (EST) In-Reply-To: <874mrd8hdi.fsf@opmbx.org> (Mark Karpov's message of "Tue, 27 Jan 2015 01:35:37 +0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5198=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5198> : inlines <1959> : streams <1379958> : uri <1843938> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:98774 Archived-At: > I'm sorry if it's not really a bug. After some testing I understood that > functions (something-mode ARG) when called from Lisp, enable > corresponding mode if ARG is omitted, if it's NIL, and even if it's not > NIL (some people use (something-mode t) to enable the such a > actually). So, it's quite strange: almost any argument or its absence > enables the mode, but to disable it one must use negative number. It > would be more logical if T would enable the mode and NIL would disable > it. This is the same for all minor-modes. The reason is partly historical and partly pragmatic. The situation is basically: - there are 3 different cases: enable, disable, toggle (so just using nil and t doesn't cut it). - when called from Elisp the most common case (by far) is `enable' and in many cases it's very handy to be able to skip the argument (typically (add-hook 'foo-mode-hook #'bar-mode) instead of (add-hook 'foo-mode-hook (lambda () (bar-mode )))). This means that (optional) nil has to mean "enable". The rest doesn't matter much. I chose `toggle' for the toggling case, and the "negative/positive" was chosen before I got involved in Emacs. Stefan