help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: package-vc-install bug?


From: Philip Kaludercic
Subject: Re: package-vc-install bug?
Date: Sun, 11 Feb 2024 09:28:41 +0000

James Thomas <jimjoe@gmx.net> writes:

> Philip Kaludercic wrote:
>
>> James Thomas <jimjoe@gmx.net> writes:
>>
>>> M-x package-vc-install RET <package> RET fails with the following on my
>>> system:
>>
>> Does this issue occur for every package?
>
> Yes, for every one I've tried (in my system).

In that case this should be reported as a bug.

>> What I don't get, is what adding a newline to the end of a string should
>> change?
>>
>> (read-from-string "((emacs \"29.1\"))")   ;=> (((emacs "29.1")) . 16)
>> (read-from-string "((emacs \"29.1\"\n))") ;=> (((emacs "29.1")) . 17)
>
> The problem occurs in `package-read-from-string', not `read-from-string'

I understood that, the point is that the cdr of the return value in both
cases points to the end of the string, so the second `read-from-string'
call in the `condition-case' will in both cases raise the same
`end-of-file', as is the case here:

  (read-from-string "")
  (read-from-string "x" 1)

> (I add the newline at the very end: "((emacs \"29.1\"))\n"):
>
> (defun package-read-from-string (str)
>   "Read a Lisp expression from STR.
> Signal an error if the entire string was not used."
>   (pcase-let ((`(,expr . ,offset) (read-from-string str)))
>     (condition-case ()
>         ;; The call to `ignore' suppresses a compiler warning.
>         (progn (ignore (read-from-string str offset))
>                (error "Can't read whole string"))
>       (end-of-file expr))))
>
> Because of the last line (`end-of-file') in the `condition-case'.

Can you confirm this by using edebug? 

> Regards,
> James

-- 
Philip Kaludercic



reply via email to

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