unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Jean Louis <bugs@gnu.support>, 45098@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <jwvr1o174oa.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87zh2pfw5k.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 07 Dec 2020 16:55:35 +0100")

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






  reply	other threads:[~2020-12-07 20:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvr1o174oa.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=45098@debbugs.gnu.org \
    --cc=bugs@gnu.support \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).