From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] scratch/so-long 7273fb2: Add so-long library Date: Thu, 10 Jan 2019 13:07:25 -0500 Message-ID: References: <20190107065207.21793.53271@vcs0.savannah.gnu.org> <20190107065208.BA36C21736@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1547143740 18057 195.159.176.226 (10 Jan 2019 18:09:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 10 Jan 2019 18:09:00 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Phil Sainty To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 10 19:08:55 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghelD-0004bb-H4 for ged-emacs-devel@m.gmane.org; Thu, 10 Jan 2019 19:08:55 +0100 Original-Received: from localhost ([127.0.0.1]:40367 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghenK-0000Z9-FK for ged-emacs-devel@m.gmane.org; Thu, 10 Jan 2019 13:11:06 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghek0-00063u-9J for emacs-devel@gnu.org; Thu, 10 Jan 2019 13:07:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghejz-0002m4-D9 for emacs-devel@gnu.org; Thu, 10 Jan 2019 13:07:40 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:55084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghejy-0002Vo-Va for emacs-devel@gnu.org; Thu, 10 Jan 2019 13:07:39 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id x0AI7PaR031100; Thu, 10 Jan 2019 13:07:25 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 77B716AB32; Thu, 10 Jan 2019 13:07:25 -0500 (EST) In-Reply-To: <20190107065208.BA36C21736@vcs0.savannah.gnu.org> (Phil's message of "Mon, 7 Jan 2019 01:52:08 -0500 (EST)") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6458=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6458> : inlines <6992> : streams <1809695> : uri <2777887> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:232288 Archived-At: > +FIXME: +++ once all documentation has been added. No need for this FIXME: the whole point of this system is that you don't need to do anything special to mark entries as "not yet handled" (any `**` header without a preceding `---` or `+++` has not been handled yet), so it's "fail safe". > +;; Installation > +;; ------------ > +;; And add the following to your init file to enable the library: > +;; > +;; (when (require 'so-long nil :noerror) > +;; (so-long-enable)) I think the above should just be (so-long-auto-mode 1) and so-long-auto-mode (just my suggestion for a name, feel free to chose something else) should be an autoloaded global minor mode which activates so-long-mode. On the design side, I think you should merge `so-long` and `so-long-mode` into a single function and make that function a (buffer-local) minor-mode (i.e. not have any major mode, just use fundamental-mode instead). Making it a minor mode rather than a major-mode will also make it easier to remember the previous major-mode without any need for a change-major-mode-hook hack. > +(defvar so-long-enabled t > + "Set to nil to prevent `so-long' from being triggered automatically.") Loading a file should not change the behavior of Emacs, so the default should be nil unless/until we decide to preload this package. Rather than defadvice, please use advice-add. Other than that, looks great, thanks. Stefan