From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= Newsgroups: gmane.emacs.help Subject: Re: Enabling a globalized-minor-mode by default Date: Fri, 11 Sep 2020 11:03:55 +0200 Message-ID: <87ft7olm6c.fsf@gmail.com> References: <87pn6tmoti.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7578"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 11 11:04:47 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kGez9-0001kh-0F for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 11 Sep 2020 11:04:47 +0200 Original-Received: from localhost ([::1]:51774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGez8-0003xS-34 for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 11 Sep 2020 05:04:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGeyP-0003Nl-G7 for help-gnu-emacs@gnu.org; Fri, 11 Sep 2020 05:04:01 -0400 Original-Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:35861) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGeyN-0005dI-AP for help-gnu-emacs@gnu.org; Fri, 11 Sep 2020 05:04:01 -0400 Original-Received: by mail-wm1-x336.google.com with SMTP id z9so4043771wmk.1 for ; Fri, 11 Sep 2020 02:03:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=WecAhBj61VE5zP8kiG99kPNYUa+u9lRFbhOi5Jvu2HY=; b=clnZAtBtYMSK84wpMhgKQ56TUqjAPVdjHkI0mldHh4cU9wq5i1h97Xc5a71kGqoHXW 53WRgyyLg0x70ka1hd2InXO4eOE0MZWxCZkUH2ytZ89OkcosE9wFqL/yUXVC4SLLpFnN cjVO7jnlHY1oRmym5Jz2av4KJeuCgPSYp6pJlpWXDts9/P1ZZ/heAatYcij8tb++RtLK Lz1dfbJHPp6c9UXqkMyU4rwfizkBlkBySdyfYdr9SmTP70upR2tL1kYYYw5MNwONbFYh qrBIYnPoMf5AcYRbQMaFP037dGRZT+wYGAOmQs5GmYbcz5WxQuH1t5UaYigaMT/pA04e QD8w== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=WecAhBj61VE5zP8kiG99kPNYUa+u9lRFbhOi5Jvu2HY=; b=sfJnETsIHZca0GsUUETS5Ys1922t9g1V+fjAcuoCO1nce1XyVThqYJTJGlxz8Y4Keu 4j3aQBUyvBz5lyHVhaJUwxU1r3mf1So33ZjvSh7LZzf2HhKcg9XmJTZPnIH+gcUNVpFR 0OOw0vHONX+UZvvMXLn4AP1jbyhe6D5Tq7oXvCvOysM7/Qc+2Ogoa6/ux82cGQ/M6xmF cuKq5/prklekMYN84fHPJiQ9sIdTkGFBkr+LuttrYO9caOE1OmSfWG7RK/bKCK5Cji2Q itMDoF21Juyuuus+W37Q/aPcrzGfurzrjPtRiYmZlpj3UTikO6RUoMZYMSf+Z/QyMr0S AebA== X-Gm-Message-State: AOAM5306oLZNuhKVbG1ghReA3VXZV/8jLmJqzuKS2/JyciMO6GK3DgDf JaSm6ubIga90ODyPda8w8c6mhYeiyvs= X-Google-Smtp-Source: ABdhPJzmkHb+XtsjrKauVNChveNk2DXPvTl4y/cOrtBukOUqZ+ZtPcSXiVFi/+AdArF9j7MiVcvrDg== X-Received: by 2002:a1c:e1d6:: with SMTP id y205mr1188873wmg.92.1599815036783; Fri, 11 Sep 2020 02:03:56 -0700 (PDT) Original-Received: from hirondell ([2a01:e0a:20e:d340:41b7:7b2e:4aab:4832]) by smtp.gmail.com with ESMTPSA id k8sm3123145wrl.42.2020.09.11.02.03.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 02:03:56 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Thu, 10 Sep 2020 17:14:11 -0400") Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=kevin.legouguec@gmail.com; helo=mail-wm1-x336.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124018 Archived-At: Stefan Monnier writes: > Loading an ELisp file should not affect the visible behavior of Emacs, > so according to that principle a global mode that's pre-enabled should > only ever exist if it's bundled with Emacs. > > For the same kind of reasons merely installing a package should not > affect the visible behavior of Emacs. OK. I see that "(elisp) Defining Minor Modes" indeed says that define-minor-mode's INIT-VALUE should be nil under "most" circumstances. Nothing in the docstring suggests that though AFAICT; maybe it would be worth hinting at this? > [ And yes "affect the visible behavior" is not well defined, or at least > it needs to be tempered by some tolerated exceptions. For example, > it's considered normal for a package to add itself (via its autoloads) > to `auto-mode-alist`, which does have a visible impact on Emacs's > behavior. ] Interesting! I see "(elisp) Major Mode Conventions" and "(elisp) Packaging Basics" both mention this use-case; would it make sense to add this "acceptable use" (and maybe others, if they exist) to "(elisp) When to Autoload"? >> Is that bad form somehow, or is that the way to go? > > Yup. M-x spit-take >> Admittedly, maybe forcing a globalized minor mode on users by default is >> bad form. For context, I am trying to make magit-file-mode work >> out-of-the-box, i.e. without users having to (1) (require 'anything) in >> their config or (2) customize global-magit-file-mode to t explicitly, >> which should be redundant because this is the default value. > > `require` is definitely not needed here. (Right; I actually started this whole "crusade" after seeing you argue that a .emacs should not require anything[1][2][3]). > Only `(global-magit-file-mode 1)` needs to be added to the init file > (or do the equivalent via Customize) and it shouldn't be redundant > because t shouldn't be the default value ;-) Got it. I would joke and say that this will all be solved when (1) we get Magit into GNU ELPA and (2) we implement bundling GNU ELPA packages into Emacs, but I'm pretty sure that would score way too high on some twisted bad-taste private-joke form of bingo, and it's not a game I care to play ;o) [1] https://lists.gnu.org/archive/html/emacs-devel/2020-04/msg00947.html emacs-devel [2] https://gitter.im/magit/magit?at=5ea154f561a0002f7943209e [3] https://gitter.im/magit/magit?at=5eac311a9f0c955d7d9a89b9