emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature/package-vc has been merged


From: Rudolf Adamkovič
Subject: Re: feature/package-vc has been merged
Date: Tue, 08 Nov 2022 00:17:22 +0100

Philip Kaludercic <philipk@posteo.net> writes:

> The thing is the user options aren't strictly variables.  The usually
> are, but they are explicitly meant to operate on a higher abstraction
> level, sort of even in a separate name space.

Gotcha!

> But of course, I understand that not everyone feels comfortable with
> this.  So while I insist that package-vc-selected-packages ought to be
> a user option, I have also made `package-vc-install-selected-packages'
> autoloaded (I have yet to push all the commits) and invocable as a
> regular function

Perfect.  Win-win.  Thank you so much!

(I hope you also marked the function as interactive.  When playing with
VC package, I have half of the history in M-x and the other half in M-:.
Switching between the two all the time confuses me to no end.)

>> I like the clear distinction between `foo' and `(foo)' in Lisp.  I even
>> like the `*' in C that clearly says "a pointer".  Brilliant ideas lost
>> to the history in most modern languages.  But I digress!
>
> Maybe I am missing your point, but why shouldn't `foo' and (foo) be
> different?  The only context where I can think of `foo' and (foo)
> being treated the same is in some APL-like language ...

I apologize for the digression!  :)

To quickly explain, consider Swift code:

  class Things {
    // stored property
    var count = 0 // set during init
  }

and

  class Things {
    // computed property
    var count: Int {
       // arbitrary code
    }
  }

One calls `things.count' in both cases, with no parentheses, so one has
no idea whether `count' is a *stored* property (true variable) with O(1)
access or a *computed* property that runs in say in O(n).  Accidentally
quadratic code in no time!  Plus, one also know nothing about side
effects.

(Further, one can also define `willSet' and `didSet' on *stored*
properties, makes things even worse.)

In C, one sees `count' or `*count' or `count()' and everything is clear
on the first sight.  Similarly, in Scheme, one sees `count' or
`(count)'.

> I see, this is an interesting approach.  But just to make sure, can
> you confirm that package-vc doesn't break any of the assumptions you
> make that are necessary for your configuration to work as intended?

Suddenly ... so many issues!  :)

First, Emacs failed with "circular loads" errors (or something like
that).  I had to comment out `(package-vc-ensure-packages)' here to work
around the problem:

(defcustom package-vc-selected-packages '()
  [...]
  :set (lambda (sym val)
         (custom-set-default sym val)
         (package-vc-ensure-packages))

I then tried to change all packages to VC at once and got:

  user-error: Package has no VC data

Which one, I wondered.

Anyway, I reverted the config and decided to proceed in smaller steps.

As a side note, while I investigated various issues, I found myself
wishing for a hyperlink to

`package-vc-archive-spec-alist'

from the help page for

`package-vc-selected-packages'.

(The help page mentions does not use a hyperlink.)

Finally, I got to MELPA packages and got stuck altoegether.

When I

(1) require `package-vc', and then
(2) run `package-refresh-contents',

I get

Debugger entered--Lisp error: (file-error
  "https://melpa.org/packages/elpa-packages.eld"; "Not found")
  signal(file-error ("https://melpa.org/packages/elpa-packages.eld"; "Not
  found")) package--with-response-buffer-1("https://melpa.org/packages/";
  #f(compiled-function () #<bytecode 0x1fdb28378e1ccb5e>) :file
  "elpa-packages.eld" :async nil :error-function #f(compiled-function ()
  #<bytecode -0x3d0e809e66d1a0c>) :noerror nil)
  package--download-one-archive(("melpa"
  . "https://melpa.org/packages/";) "elpa-packages.eld" nil)
  (condition-case nil (package--download-one-archive archive
  "elpa-packages.eld" async) ((debug error) (message "Failed to download
  `%s' archive." (car archive)))) (let ((archive (car tail)))
  (condition-case nil (package--download-one-archive archive
  "elpa-packages.eld" async) ((debug error) (message "Failed to download
  `%s' archive." (car archive)))) (setq tail (cdr tail))) (while tail
  (let ((archive (car tail))) (condition-case nil
  (package--download-one-archive archive "elpa-packages.eld" async)
  ((debug error) (message "Failed to download `%s' archive." (car
  archive)))) (setq tail (cdr tail)))) (let ((tail package-archives))
  (while tail (let ((archive (car tail))) (condition-case nil
  (package--download-one-archive archive "elpa-packages.eld" async)
  ((debug error) (message "Failed to download `%s' archive." (car
  archive)))) (setq tail (cdr tail)))))
  package-vc--download-and-read-archives(nil)
  run-hook-with-args(package-vc--download-and-read-archives nil)
  package-refresh-contents()
  funcall-interactively(package-refresh-contents)
  call-interactively(package-refresh-contents record nil)
  command-execute(package-refresh-contents record)
  execute-extended-command(nil "package-refresh-contents" nil)
  funcall-interactively(execute-extended-command nil
  "package-refresh-contents" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Rudy
--
"'Contrariwise,' continued Tweedledee, 'if it was so, it might be; and
if it were so, it would be; but as it isn't, it ain't.  That's logic.'"
-- Lewis Carroll, Through the Looking Glass, 1871/1872

Rudolf Adamkovič <salutis@me.com> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



reply via email to

[Prev in Thread] Current Thread [Next in Thread]