unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked
@ 2020-12-07 10:33 Jean Louis
  2020-12-07 15:55 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Jean Louis @ 2020-12-07 10:33 UTC (permalink / raw)
  To: 45098


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
⎔ λ 🄯 𝍄 𝌡 𝌚





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked
  2020-12-07 10:33 bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked Jean Louis
@ 2020-12-07 15:55 ` Lars Ingebrigtsen
  2020-12-07 20:33   ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-07 15:55 UTC (permalink / raw)
  To: Jean Louis; +Cc: Stefan Monnier, 45098

Jean Louis <bugs@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





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked
  2020-12-07 15:55 ` Lars Ingebrigtsen
@ 2020-12-07 20:33   ` Stefan Monnier
  2020-12-07 20:44     ` Jean Louis
  2020-12-08 14:13     ` Lars Ingebrigtsen
  0 siblings, 2 replies; 12+ messages in thread
From: Stefan Monnier @ 2020-12-07 20:33 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Jean Louis, 45098

>> 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






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked
  2020-12-07 20:33   ` Stefan Monnier
@ 2020-12-07 20:44     ` Jean Louis
  2020-12-08 14:21       ` Stefan Monnier
  2020-12-08 14:13     ` Lars Ingebrigtsen
  1 sibling, 1 reply; 12+ messages in thread
From: Jean Louis @ 2020-12-07 20:44 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Lars Ingebrigtsen, 45098

* Stefan Monnier <monnier@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?






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked
  2020-12-07 20:33   ` Stefan Monnier
  2020-12-07 20:44     ` Jean Louis
@ 2020-12-08 14:13     ` Lars Ingebrigtsen
  2020-12-08 14:22       ` Stefan Monnier
  1 sibling, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-08 14:13 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Jean Louis, 45098

Stefan Monnier <monnier@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





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked
  2020-12-07 20:44     ` Jean Louis
@ 2020-12-08 14:21       ` Stefan Monnier
  2020-12-08 14:55         ` Jean Louis
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2020-12-08 14:21 UTC (permalink / raw)
  To: Jean Louis; +Cc: Lars Ingebrigtsen, 45098

>> 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






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked
  2020-12-08 14:13     ` Lars Ingebrigtsen
@ 2020-12-08 14:22       ` Stefan Monnier
  2020-12-08 14:24         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2020-12-08 14:22 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Jean Louis, 45098

>> 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






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked
  2020-12-08 14:22       ` Stefan Monnier
@ 2020-12-08 14:24         ` Lars Ingebrigtsen
  2020-12-10 18:16           ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-08 14:24 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Jean Louis, 45098

Stefan Monnier <monnier@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





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked
  2020-12-08 14:21       ` Stefan Monnier
@ 2020-12-08 14:55         ` Jean Louis
  2020-12-08 23:51           ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Jean Louis @ 2020-12-08 14:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Lars Ingebrigtsen, 45098

* Stefan Monnier <monnier@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.
  





^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked
  2020-12-08 14:55         ` Jean Louis
@ 2020-12-08 23:51           ` Stefan Monnier
  2020-12-09  5:54             ` Jean Louis
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2020-12-08 23:51 UTC (permalink / raw)
  To: Jean Louis; +Cc: Lars Ingebrigtsen, 45098

> 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






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked
  2020-12-08 23:51           ` Stefan Monnier
@ 2020-12-09  5:54             ` Jean Louis
  0 siblings, 0 replies; 12+ messages in thread
From: Jean Louis @ 2020-12-09  5:54 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Lars Ingebrigtsen, 45098

* Stefan Monnier <monnier@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.






^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked
  2020-12-08 14:24         ` Lars Ingebrigtsen
@ 2020-12-10 18:16           ` Stefan Monnier
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2020-12-10 18:16 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Jean Louis, 45098

>> 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






^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-12-10 18:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 10:33 bug#45098: 28.0.50; gnu-elpa: if user says `no' to install package, it aborts the previous function invoked Jean Louis
2020-12-07 15:55 ` Lars Ingebrigtsen
2020-12-07 20:33   ` Stefan Monnier
2020-12-07 20:44     ` Jean Louis
2020-12-08 14:21       ` Stefan Monnier
2020-12-08 14:55         ` Jean Louis
2020-12-08 23:51           ` Stefan Monnier
2020-12-09  5:54             ` Jean Louis
2020-12-08 14:13     ` Lars Ingebrigtsen
2020-12-08 14:22       ` Stefan Monnier
2020-12-08 14:24         ` Lars Ingebrigtsen
2020-12-10 18:16           ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).