From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.devel Subject: Re: [elpa] externals/hyperbole faa8294 2/3: Redo hyperbole-mode; new {r} HyRolo search in match buffer Date: Thu, 29 Apr 2021 22:35:10 -0400 Message-ID: References: <20210429035707.30958.16274@vcs0.savannah.gnu.org> <20210429035709.3DF2320D0F@vcs0.savannah.gnu.org> Reply-To: rswgnu@gmail.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000080145705c12777af" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20059"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lidell Mats , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 30 04:36:29 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lcJ13-00059O-0l for ged-emacs-devel@m.gmane-mx.org; Fri, 30 Apr 2021 04:36:29 +0200 Original-Received: from localhost ([::1]:39232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcJ12-0000xM-5f for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Apr 2021 22:36:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcJ0F-0000X0-Gy for emacs-devel@gnu.org; Thu, 29 Apr 2021 22:35:39 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54775) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcJ0F-0002ht-9U for emacs-devel@gnu.org; Thu, 29 Apr 2021 22:35:39 -0400 Original-Received: from mail-lf1-f53.google.com ([209.85.167.53]:47040) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1lcJ0D-0007DG-RD; Thu, 29 Apr 2021 22:35:38 -0400 Original-Received: by mail-lf1-f53.google.com with SMTP id 12so107588520lfq.13; Thu, 29 Apr 2021 19:35:37 -0700 (PDT) X-Gm-Message-State: AOAM531ZNSEN7uPOo6ac+K2h9g8iZ6fGlwiWSx0dZIDkZfrngNJe681D clIqJNw5LCKpIw4y/OFHuhzPMmiNrrnvoNfGEEQ= X-Google-Smtp-Source: ABdhPJyXYRBrPQQk6H2QX16Ra/iP3EiJPyrGi/Q/kVPDb1E6ctI+oD7Vlp31AaQ7G8d+YgEbyTMKEhcxXNop1FUSXqI= X-Received: by 2002:a19:c304:: with SMTP id t4mr1785207lff.86.1619750136319; Thu, 29 Apr 2021 19:35:36 -0700 (PDT) In-Reply-To: X-Gmail-Original-Message-ID: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268649 Archived-At: --00000000000080145705c12777af Content-Type: text/plain; charset="UTF-8" Thanks, Stefan. Will implement these updates. On your last comment, we want Hyperbole initialization deferred until after Emacs init time, so that looks right to me. Regards, Bob On Thu, Apr 29, 2021 at 2:00 AM Stefan Monnier wrote: > > +(defun enable-hyperbole-mode () > > + "Enable Hyperbole global minor mode." > > + (interactive) > > The `hyperbole-mode` command already offers that functionality, so > there's no point providing this as an interactive command. > I'd recommend you use a "--" in the name and keep that function "internal". > Also please use a "hyperbole-" prefix. > > > + ;; Activate hyperbole-mode > > + (run-hooks 'hyperbole-mode-hook)) > > `define-minor-mode` runs `hyperbole-mode-hook` for you already, so this > `run-hooks` will cause the hook to be run twice in a row. > > > :keymap hyperbole-mode-map > > This argument is redundant. > > > +(if after-init-time > > + ;; Initialize Hyperbole key bindings and hooks. > > + (hyperb:init) > > + ;; Initialize after other key bindings are loaded at startup. > > + (add-hook 'after-init-hook #'hyperb:init t)) > > > > ;; !! FIXME: Loading a file should not change Emacs's behavior but we > > ;; need this here for awhile until can ensure Hyperbole users know to > > I suspect the above code and the above comment should be swapped? > > > Stefan > > --00000000000080145705c12777af Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks, Stefan.=C2=A0 Will implement these updates.

On = your last comment, we want Hyperbole initialization deferred until after Em= acs init time, so that looks right to me.

Regards,

Bob

On Thu, Apr 29, 2021 at 2:00 AM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> +(defun enable-hyperbole-= mode ()
> +=C2=A0 "Enable Hyperbole global minor mode."
> +=C2=A0 (interactive)

The `hyperbole-mode` command already offers that functionality, so
there's no point providing this as an interactive command.
I'd recommend you use a "--" in the name and keep that functi= on "internal".
Also please use a "hyperbole-" prefix.

> +=C2=A0 ;; Activate hyperbole-mode
> +=C2=A0 (run-hooks 'hyperbole-mode-hook))

`define-minor-mode` runs `hyperbole-mode-hook` for you already, so this
`run-hooks` will cause the hook to be run twice in a row.

>=C2=A0 =C2=A0 :keymap hyperbole-mode-map

This argument is redundant.

> +(if after-init-time
> +=C2=A0 =C2=A0 ;; Initialize Hyperbole key bindings and hooks.
> +=C2=A0 =C2=A0 (hyperb:init)
> +=C2=A0 ;; Initialize after other key bindings are loaded at startup.<= br> > +=C2=A0 (add-hook 'after-init-hook #'hyperb:init t))
>=C2=A0
>=C2=A0 ;; !! FIXME: Loading a file should not change Emacs's behavi= or but we
>=C2=A0 ;; need this here for awhile until can ensure Hyperbole users kn= ow to

I suspect the above code and the above comment should be swapped?


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--00000000000080145705c12777af--