unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34147: 27.0.50; M-x describe-package groovy-mode breaks
@ 2019-01-20 15:17 Xu Chunyang
  2019-02-05 23:08 ` Federico Tedin
  0 siblings, 1 reply; 4+ messages in thread
From: Xu Chunyang @ 2019-01-20 15:17 UTC (permalink / raw)
  To: 34147

I've setup Melpa, C-h P groovy-mode breaks, here is the backtrace

Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
  #f(compiled-function (pkg) #<bytecode 0x45e6b941>)(groovy-mode)
  apply(#f(compiled-function (pkg) #<bytecode 0x45e6b941>) groovy-mode)
  describe-package-1(groovy-mode)
  describe-package(groovy-mode)
  funcall-interactively(describe-package groovy-mode)
  call-interactively(describe-package nil nil)
  command-execute(describe-package)

By evaluating describe-package-1 to get detailed Backtrace (I didn't
paste it since it is very long), it seems the error is caused by the
"last" expression of describe-package-1:

(insert readme-string)

when readme-string is nil.

I notice Melpa fails to provide the readme file, this URL is 404

https://melpa.org/packages/groovy-mode-readme.txt

--
In GNU Emacs 27.0.50
Repository revision: 436c225f1b8ca48fa7c7e769fe6b7055f37af95d
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1671
System Description:  Mac OS X 10.14.2





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

* bug#34147: 27.0.50; M-x describe-package groovy-mode breaks
  2019-01-20 15:17 bug#34147: 27.0.50; M-x describe-package groovy-mode breaks Xu Chunyang
@ 2019-02-05 23:08 ` Federico Tedin
  2019-03-13  0:39   ` Federico Tedin
  0 siblings, 1 reply; 4+ messages in thread
From: Federico Tedin @ 2019-02-05 23:08 UTC (permalink / raw)
  To: Xu Chunyang; +Cc: 34147

> By evaluating describe-package-1 to get detailed Backtrace (I didn't
> paste it since it is very long), it seems the error is caused by the
> "last" expression of describe-package-1:
>
> (insert readme-string)
>
> when readme-string is nil.
>
> I notice Melpa fails to provide the readme file, this URL is 404
>
> https://melpa.org/packages/groovy-mode-readme.txt

It looks like when a package doesn't provide a 'Commentary' field, the
xyz-readme.txt file isn't generated by MELPA (see
https://github.com/melpa/package-build/blob/master/package-build.el#L382).

Other packages without 'Commentary' (in no particular order):
- instapaper
- javap-mode
- tdd-status-mode-line
- jknav
- runtests

Using C-h P on these packages will trigger the same error. I guess we
could replace:

(insert readme-string)

with:

(when readme-string
  (insert readme-string))

or:

(if readme-string
    (insert readme-string)
  (insert "This package does not provide a description."))

to cover cases where the xyz-readme.txt file for the package doesn't
exist.





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

* bug#34147: 27.0.50; M-x describe-package groovy-mode breaks
  2019-02-05 23:08 ` Federico Tedin
@ 2019-03-13  0:39   ` Federico Tedin
  2019-03-22  4:10     ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Federico Tedin @ 2019-03-13  0:39 UTC (permalink / raw)
  To: Xu Chunyang; +Cc: 34147

[-- Attachment #1: Type: text/plain, Size: 65 bytes --]

I'm attaching a small patch with the changes I suggested above.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 938 bytes --]

From b842f54518a6565edd78a363b65e8a8b690dbdf8 Mon Sep 17 00:00:00 2001
From: Federico Tedin <federicotedin@gmail.com>
Date: Tue, 12 Mar 2019 21:34:31 -0300
Subject: [PATCH 1/1] Correctly handle packages without description in
 describe-package

* lisp/emacs-lisp/package.el (describe-package-1): Do not call insert
  if package description is nil (Bug#34147).
---
 lisp/emacs-lisp/package.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 5e8864ec73..ad1fb363f1 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2482,7 +2482,8 @@ describe-package-1
                 (insert ?\n)))
             (setq readme-string (buffer-string))
             t)
-          (insert readme-string))
+          (when readme-string
+            (insert readme-string)))
         ))))
 
 (defun package-install-button-action (button)
-- 
2.17.1


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

* bug#34147: 27.0.50; M-x describe-package groovy-mode breaks
  2019-03-13  0:39   ` Federico Tedin
@ 2019-03-22  4:10     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2019-03-22  4:10 UTC (permalink / raw)
  To: Federico Tedin; +Cc: Xu Chunyang, monnier

Version:27.1

> I'm attaching a small patch with the changes I suggested above.

Pushed, but inserting a fall back text.
Thank you very much,


        Stefan





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

end of thread, other threads:[~2019-03-22  4:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-20 15:17 bug#34147: 27.0.50; M-x describe-package groovy-mode breaks Xu Chunyang
2019-02-05 23:08 ` Federico Tedin
2019-03-13  0:39   ` Federico Tedin
2019-03-22  4:10     ` 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).