GNU bug report logs - #45098
28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked

Previous Next

Package: emacs;

Reported by: Jean Louis <bugs <at> gnu.support>

Date: Mon, 7 Dec 2020 10:34:02 UTC

Severity: minor

Found in version 28.0.50

To reply to this bug, email your comments to 45098 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Mon, 07 Dec 2020 10:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jean Louis <bugs <at> gnu.support>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 07 Dec 2020 10:34:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jean Louis <bugs <at> gnu.support>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the
 previous function invoked
Date: Mon, 07 Dec 2020 13:33:01 +0300
I am using M-x sql-postgres and when invoked with gnu-elpa package
installed it asks me to install sql-indent, but I say no and on saying
no it aborts my action and I cannot even reach to sql-postgres
mode. To reach it I have to invoke M-x sql-postgres second time


In GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.14.8, Xaw3d scroll bars)
 of 2020-11-25 built on protected.rcdrun.com
Repository revision: 30c437752df0a3a9410f1249fa0f237110811af2
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11907000
System Description: Hyperbola GNU/Linux-libre

Configured using:
 'configure --prefix=/package/text/emacs --with-modules
 --with-x-toolkit=lucid'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB
NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS JSON
PDUMPER LCMS2

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LANG: de_DE.UTF-8
  value of $XMODIFIERS: @im=exwm-xim
  locale-coding-system: utf-8-unix

Major mode: ELisp/d

Minor modes in effect:
  TeX-PDF-mode: t
  jabber-activity-mode: t
  hpath:find-file-urls-mode: t
  timeclock-mode-line-display: t
  show-paren-mode: t
  savehist-mode: t
  save-place-mode: t
  immortal-scratch-mode: t
  electric-pair-mode: t
  display-time-mode: t
  display-battery-mode: t
  helm-ff-cache-mode: t
  shell-dirtrack-mode: t
  async-bytecomp-package-mode: t
  persistent-scratch-autosave-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

-- 
Thanks,
Jean Louis
⎔ λ 🄯 𝍄 𝌡 𝌚




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Mon, 07 Dec 2020 15:56:01 GMT) Full text and rfc822 format available.

Message #8 received at 45098 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jean Louis <bugs <at> gnu.support>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 45098 <at> debbugs.gnu.org
Subject: Re: bug#45098: 28.0.50; gnu-elpa: if user says `no' to install
 package, it aborts the previous function invoked
Date: Mon, 07 Dec 2020 16:55:35 +0100
Jean Louis <bugs <at> gnu.support> writes:

> I am using M-x sql-postgres and when invoked with gnu-elpa package
> installed it asks me to install sql-indent, but I say no and on saying
> no it aborts my action and I cannot even reach to sql-postgres
> mode. To reach it I have to invoke M-x sql-postgres second time

I can confirm this problem.  I had a peek at gnu-elpa, but decoding the
control flow was beyond what I could do in 30 seconds.  Stefan?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Mon, 07 Dec 2020 20:34:01 GMT) Full text and rfc822 format available.

Message #11 received at 45098 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Jean Louis <bugs <at> gnu.support>, 45098 <at> debbugs.gnu.org
Subject: Re: bug#45098: 28.0.50; gnu-elpa: if user says `no' to install
 package, it aborts the previous function invoked
Date: Mon, 07 Dec 2020 15:33:07 -0500
>> I am using M-x sql-postgres and when invoked with gnu-elpa package
>> installed it asks me to install sql-indent, but I say no and on saying
>> no it aborts my action and I cannot even reach to sql-postgres
>> mode. To reach it I have to invoke M-x sql-postgres second time
>
> I can confirm this problem.  I had a peek at gnu-elpa, but decoding the
> control flow was beyond what I could do in 30 seconds.  Stefan?

I think there are 2 problems:

1 - when the user says "no" to installing `sql-indent`, `gnu-elpa`
    doesn't try to remember this fact, so it will happily ask the user
    again and again.

2 - when the user says "no" to installing `sql-indent`, `gnu-elpa`
    doesn't "keep going" but instead it "aborts" (i.e. by signaling an
    error).

Problem (1) should be reasonably easy to fix by removing the
corresponding autoload and storing the list of unwanted packages
somewhere for future Emacs sessions (and also changing the question from
"yes/no" to "yes/notnow/never").

Problem (2) is largely unsolvable on `gnu-elpa`s side.
Basically, the code in `sql-indent-enable` in sql.el does:

    (when (fboundp 'sqlind-minor-mode)
      (sqlind-minor-mode (if sql-use-indent-support +1 -1)))

With `gnu-elpa` installed, `sqlind-minor-mode` is defined (as an
autoloaded function), so we call it which in turns loads `gnu-elpa.el`,
but from there we can't "uncall" the function.  We could signal
a different error than "Abort", and then change the call so it just
ignores such errors, or we could have a special hack in `gnu-elpa` for
`sqlind-minor-mode` such that when the user decides not to
install the package we install a dummy version of the function which
does nothing (and then undefines the function), but I'm not sure it's
worth the trouble.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Mon, 07 Dec 2020 20:49:01 GMT) Full text and rfc822 format available.

Message #14 received at 45098 <at> debbugs.gnu.org (full text, mbox):

From: Jean Louis <bugs <at> gnu.support>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 45098 <at> debbugs.gnu.org
Subject: Re: bug#45098: 28.0.50; gnu-elpa: if user says `no' to install
 package, it aborts the previous function invoked
Date: Mon, 7 Dec 2020 23:44:48 +0300
* Stefan Monnier <monnier <at> iro.umontreal.ca> [2020-12-07 23:33]:
> Problem (1) should be reasonably easy to fix by removing the
> corresponding autoload and storing the list of unwanted packages
> somewhere for future Emacs sessions (and also changing the question from
> "yes/no" to "yes/notnow/never").

I am just worried that if that package becomes enabled by default in
future Emacs that it will be nagging users who just wish to edit and
not access Internet. It should be rather option that user enables to
be asked just as it is common to enable packages.

Is asking users to enable or load or install various packages the sole
purpose of gnu-elpa package?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Tue, 08 Dec 2020 14:14:02 GMT) Full text and rfc822 format available.

Message #17 received at 45098 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Jean Louis <bugs <at> gnu.support>, 45098 <at> debbugs.gnu.org
Subject: Re: bug#45098: 28.0.50; gnu-elpa: if user says `no' to install
 package, it aborts the previous function invoked
Date: Tue, 08 Dec 2020 15:13:45 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> Problem (2) is largely unsolvable on `gnu-elpa`s side.
> Basically, the code in `sql-indent-enable` in sql.el does:
>
>     (when (fboundp 'sqlind-minor-mode)
>       (sqlind-minor-mode (if sql-use-indent-support +1 -1)))
>
> With `gnu-elpa` installed, `sqlind-minor-mode` is defined (as an
> autoloaded function), so we call it which in turns loads `gnu-elpa.el`,
> but from there we can't "uncall" the function.  We could signal
> a different error than "Abort", and then change the call so it just
> ignores such errors, or we could have a special hack in `gnu-elpa` for
> `sqlind-minor-mode` such that when the user decides not to
> install the package we install a dummy version of the function which
> does nothing (and then undefines the function), but I'm not sure it's
> worth the trouble.

Couldn't gnu-elpa just make sqlind-minor-mode into `indentity' (or
something similar) in these cases?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Tue, 08 Dec 2020 14:22:01 GMT) Full text and rfc822 format available.

Message #20 received at 45098 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jean Louis <bugs <at> gnu.support>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 45098 <at> debbugs.gnu.org
Subject: Re: bug#45098: 28.0.50; gnu-elpa: if user says `no' to install
 package, it aborts the previous function invoked
Date: Tue, 08 Dec 2020 09:21:23 -0500
>> Problem (1) should be reasonably easy to fix by removing the
>> corresponding autoload and storing the list of unwanted packages
>> somewhere for future Emacs sessions (and also changing the question from
>> "yes/no" to "yes/notnow/never").
> I am just worried that if that package becomes enabled by default in
> future Emacs that it will be nagging users who just wish to edit and
> not access Internet. It should be rather option that user enables to
> be asked just as it is common to enable packages.

Hmm... indeed you're right.  It *is* worth the trouble if we want to
enable it by default.

> Is asking users to enable or load or install various packages the sole
> purpose of gnu-elpa package?

Yes and no: it's not the "purpose" but it's the way it reaches its
purpose.  Its purpose is to integrate GNU ELPA more closely into Emacs,
and generally promote GNU ELPA packages.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Tue, 08 Dec 2020 14:23:02 GMT) Full text and rfc822 format available.

Message #23 received at 45098 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Jean Louis <bugs <at> gnu.support>, 45098 <at> debbugs.gnu.org
Subject: Re: bug#45098: 28.0.50; gnu-elpa: if user says `no' to install
 package, it aborts the previous function invoked
Date: Tue, 08 Dec 2020 09:22:18 -0500
>> Problem (2) is largely unsolvable on `gnu-elpa`s side.
>> Basically, the code in `sql-indent-enable` in sql.el does:
>>
>>     (when (fboundp 'sqlind-minor-mode)
>>       (sqlind-minor-mode (if sql-use-indent-support +1 -1)))
>>
>> With `gnu-elpa` installed, `sqlind-minor-mode` is defined (as an
>> autoloaded function), so we call it which in turns loads `gnu-elpa.el`,
>> but from there we can't "uncall" the function.  We could signal
>> a different error than "Abort", and then change the call so it just
>> ignores such errors, or we could have a special hack in `gnu-elpa` for
>> `sqlind-minor-mode` such that when the user decides not to
>> install the package we install a dummy version of the function which
>> does nothing (and then undefines the function), but I'm not sure it's
>> worth the trouble.
>
> Couldn't gnu-elpa just make sqlind-minor-mode into `indentity' (or
> something similar) in these cases?

You're thinking `ignore`, I suspect, and yes that's what I referred to
with "a dummy version of the function which does nothing".


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Tue, 08 Dec 2020 14:25:01 GMT) Full text and rfc822 format available.

Message #26 received at 45098 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Jean Louis <bugs <at> gnu.support>, 45098 <at> debbugs.gnu.org
Subject: Re: bug#45098: 28.0.50; gnu-elpa: if user says `no' to install
 package, it aborts the previous function invoked
Date: Tue, 08 Dec 2020 15:24:22 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> You're thinking `ignore`, I suspect, and yes that's what I referred to
> with "a dummy version of the function which does nothing".

Oh, OK.  But isn't that worth the trouble?  I'm assuming Emacs is going
to get a ton of these functions that (possibly) hook into GNU ELPA.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Tue, 08 Dec 2020 15:05:03 GMT) Full text and rfc822 format available.

Message #29 received at 45098 <at> debbugs.gnu.org (full text, mbox):

From: Jean Louis <bugs <at> gnu.support>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 45098 <at> debbugs.gnu.org
Subject: Re: bug#45098: 28.0.50; gnu-elpa: if user says `no' to install
 package, it aborts the previous function invoked
Date: Tue, 8 Dec 2020 17:55:54 +0300
* Stefan Monnier <monnier <at> iro.umontreal.ca> [2020-12-08 17:22]:
> >> Problem (1) should be reasonably easy to fix by removing the
> >> corresponding autoload and storing the list of unwanted packages
> >> somewhere for future Emacs sessions (and also changing the question from
> >> "yes/no" to "yes/notnow/never").
> > I am just worried that if that package becomes enabled by default in
> > future Emacs that it will be nagging users who just wish to edit and
> > not access Internet. It should be rather option that user enables to
> > be asked just as it is common to enable packages.
> 
> Hmm... indeed you're right.  It *is* worth the trouble if we want to
> enable it by default.
> 
> > Is asking users to enable or load or install various packages the sole
> > purpose of gnu-elpa package?
> 
> Yes and no: it's not the "purpose" but it's the way it reaches its
> purpose.  Its purpose is to integrate GNU ELPA more closely into Emacs,
> and generally promote GNU ELPA packages.

Nagging user to install package does not tell to user that GNU ELPA
exists even. Think of new user who installs Emacs to do some SQL
editing and is then asked to install sql-indent. I am using PostgreSQL
maybe 20 years, I do not remember, and I never used that package
neither I need it, and I did not know about it. So in that sense it
did work for me, it promoted package to me.

For new users it is good to think how to offer them GNU ELPA packages,
please put yourself in their mind or look from their view point.

- many users will not know what is this dialogue about. 

- user will not know what is this package about, there is no title or
  description. To really promote GNU ELPA it would be good to tell
  about it. Add the third button "Find more about GNU ELPA" that maybe
  leads to Emacs manual.

- user will not know that package is supposed to come from Internet
  and those without Internet or in local network will be asked and
  then action cannot be performed. Do not assume that many people have
  Internet. GNU/Linux is installed on plethora of computers where
  students, professors, teachers use it without direct Internet.

  Make a check if Internet is available, then ask the user.

- gnu-elpa package could also make one question such as: "May I inform
  you from time to time about Emacs?" -- then if user says YES there,
  it could run automatically and from time to time inform user about
  tips on how to use Emacs or tips how to use GNU ELPA. People could
  contribute to those tips to be shown randomly or semantically in the
  context of what user is doing. Emacs has doctor built-in but not an
  artificial intelligence to guide the user. Why not that way.

- additionally I hope that dialogue works in console too, as I did not
  check it.
  




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Tue, 08 Dec 2020 15:05:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Tue, 08 Dec 2020 23:52:01 GMT) Full text and rfc822 format available.

Message #35 received at 45098 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jean Louis <bugs <at> gnu.support>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 45098 <at> debbugs.gnu.org
Subject: Re: bug#45098: 28.0.50; gnu-elpa: if user says `no' to install
 package, it aborts the previous function invoked
Date: Tue, 08 Dec 2020 18:51:45 -0500
> Nagging user to install package does not tell to user that GNU ELPA
> exists even.

The purpose is not to advertise the archive itself, but the features
provided by the packages it hosts.

> - many users will not know what is this dialogue about. 

Yes, it's quite dry and deserves a fair bit of work to make it more
user-friendly.

> - user will not know that package is supposed to come from Internet
>   and those without Internet or in local network will be asked and
>   then action cannot be performed. Do not assume that many people have
>   Internet. GNU/Linux is installed on plethora of computers where
>   students, professors, teachers use it without direct Internet.
>   Make a check if Internet is available, then ask the user.

Yes and no: Emacs shouldn't initiate a network connection without an
explicit request from the user, so we have to ask first.

But you're quite right that the question should be more explicit about
where the package will be fetched.

I'd welcome help with all this UI-side of the package.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Wed, 09 Dec 2020 14:02:01 GMT) Full text and rfc822 format available.

Message #38 received at 45098 <at> debbugs.gnu.org (full text, mbox):

From: Jean Louis <bugs <at> gnu.support>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 45098 <at> debbugs.gnu.org
Subject: Re: bug#45098: 28.0.50; gnu-elpa: if user says `no' to install
 package, it aborts the previous function invoked
Date: Wed, 9 Dec 2020 08:54:27 +0300
* Stefan Monnier <monnier <at> iro.umontreal.ca> [2020-12-09 02:52]:
> > Nagging user to install package does not tell to user that GNU ELPA
> > exists even.
> 
> The purpose is not to advertise the archive itself, but the features
> provided by the packages it hosts.
> 
> > - many users will not know what is this dialogue about. 
> 
> Yes, it's quite dry and deserves a fair bit of work to make it more
> user-friendly.
> 
> > - user will not know that package is supposed to come from Internet
> >   and those without Internet or in local network will be asked and
> >   then action cannot be performed. Do not assume that many people have
> >   Internet. GNU/Linux is installed on plethora of computers where
> >   students, professors, teachers use it without direct Internet.
> >   Make a check if Internet is available, then ask the user.
> 
> Yes and no: Emacs shouldn't initiate a network connection without an
> explicit request from the user, so we have to ask first.

It means then probably this way:

1. First ask user if to engage recommending various packages from GNU
ELPA. Program should also represent itself as being gnu-elpa
package. Since I have installed it I did not yet activate it as by
habit I may read package description later. But it activated itself
and so how I would know which package is doing these functions?
Without me remembering that I installed only that package I would now
know what is doing it. User would not be able to turn it off oneself
if there are many packages installed recently.

2. When confirmed, only then to start recommending packages and if not
confirmed then to remember the choice and stop nagging.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45098; Package emacs. (Thu, 10 Dec 2020 18:17:02 GMT) Full text and rfc822 format available.

Message #41 received at 45098 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Jean Louis <bugs <at> gnu.support>, 45098 <at> debbugs.gnu.org
Subject: Re: bug#45098: 28.0.50; gnu-elpa: if user says `no' to install
 package, it aborts the previous function invoked
Date: Thu, 10 Dec 2020 13:16:02 -0500
>> You're thinking `ignore`, I suspect, and yes that's what I referred to
>> with "a dummy version of the function which does nothing".
> Oh, OK.  But isn't that worth the trouble?  I'm assuming Emacs is going
> to get a ton of these functions that (possibly) hook into GNU ELPA.

Yes, I'm beginning to see that it might be worth the trouble, tho it's
a very ad-hoc kind of job, because what needs to be done will depend on
the specific autoload and other things.


        Stefan





This bug report was last modified 4 years and 191 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.