all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrii Kolomoiets <andreyk.mad@gmail.com>
To: Philip Kaludercic <philipk@posteo.net>
Cc: 59684@debbugs.gnu.org
Subject: bug#59684: 29.0.50; [PATCH] package.el: Insert news for installed packages only
Date: Tue, 29 Nov 2022 23:38:24 +0200	[thread overview]
Message-ID: <m2pmd5xwz3.fsf@gmail.com> (raw)
In-Reply-To: <87edtlbghf.fsf@posteo.net> (Philip Kaludercic's message of "Tue,  29 Nov 2022 21:25:32 +0000")

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

Philip Kaludercic <philipk@posteo.net> writes:

>>>> +                          ((file-regular-p file)))
>>>
>>> Shouldn't we keep `file-readable-p'?
>>
>> I think we should use `file-regular-p' so even if the pkg-dir will
>> contain directory named "news" we will not try to insert it with
>> `insert-file-contents'.
>
> I agree that `file-regular-p' is sensible, what I meant was using
> `file-readable-p' in addition to that.  But I guess that all in all,
> this is a rare circumstance...

Oh, right.  Makes sense.  I've updated the patch.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Insert-news-for-installed-packages-only.patch --]
[-- Type: text/x-patch, Size: 1197 bytes --]

From ac7fddd70d8cc1ff946826d4624370538032de7a Mon Sep 17 00:00:00 2001
From: muffinmad <andreyk.mad@gmail.com>
Date: Mon, 28 Nov 2022 23:09:59 +0200
Subject: [PATCH] Insert news for installed packages only

* lisp/emacs-lisp/package.el (describe-package-1): Check package is
installed and "news" is a regular file.
---
 lisp/emacs-lisp/package.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 8d44fae30a0..99538df228b 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2696,7 +2696,10 @@ describe-package-1
          (signed (if desc (package-desc-signed desc)))
          (maintainer (cdr (assoc :maintainer extras)))
          (authors (cdr (assoc :authors extras)))
-         (news (and-let* ((file (expand-file-name "news" pkg-dir))
+         (news (and-let* (pkg-dir
+                          ((not built-in))
+                          (file (expand-file-name "news" pkg-dir))
+                          ((file-regular-p file))
                           ((file-readable-p file)))
                  file)))
     (when (string= status "avail-obso")
-- 
2.32.1 (Apple Git-133)


  reply	other threads:[~2022-11-29 21:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 16:54 bug#59684: 29.0.50; [PATCH] package.el: Insert news for installed packages only Andrii Kolomoiets
2022-11-29 21:06 ` Philip Kaludercic
2022-11-29 21:16   ` Andrii Kolomoiets
2022-11-29 21:25     ` Philip Kaludercic
2022-11-29 21:38       ` Andrii Kolomoiets [this message]
2022-11-30 19:53         ` Philip Kaludercic

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

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

  git send-email \
    --in-reply-to=m2pmd5xwz3.fsf@gmail.com \
    --to=andreyk.mad@gmail.com \
    --cc=59684@debbugs.gnu.org \
    --cc=philipk@posteo.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.