[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa-admin d4c962a 438/439: * elpa-admin.el (elpaa--get-section
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa-admin d4c962a 438/439: * elpa-admin.el (elpaa--get-section): Add docstring, rename vars |
Date: |
Sun, 17 Oct 2021 15:48:52 -0400 (EDT) |
branch: elpa-admin
commit d4c962aaed9d483006aa14b01606c77e66a147d4
Author: Adam Porter <adam@alphapapa.net>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* elpa-admin.el (elpaa--get-section): Add docstring, rename vars
---
elpa-admin.el | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/elpa-admin.el b/elpa-admin.el
index 4c84360..ac72f2f 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -1167,25 +1167,28 @@ Rename DIR/ to PKG-VERS/, and return the descriptor."
(insert-file-contents mainsrcfile)
(lm-header prop))))))
-(defun elpaa--get-section (hsection fsection srcdir pkg-spec)
- (when (consp fsection)
- (while (cdr-safe fsection)
- (setq fsection
- (if (file-readable-p (expand-file-name (car fsection) srcdir))
- (car fsection)
- (cdr fsection))))
- (when (consp fsection) (setq fsection (car fsection))))
+(defun elpaa--get-section (header file srcdir pkg-spec)
+ "Return specified section as a string from SRCDIR for PKG-SPEC.
+If FILE is readable in SRCDIR, return its contents. Otherwise
+return section under HEADER in package's main file."
+ (when (consp file)
+ (while (cdr-safe file)
+ (setq file
+ (if (file-readable-p (expand-file-name (car file) srcdir))
+ (car file)
+ (cdr file))))
+ (when (consp file) (setq file (car file))))
(cond
- ((file-readable-p (expand-file-name fsection srcdir))
+ ((file-readable-p (expand-file-name file srcdir))
(with-temp-buffer
- (insert-file-contents (expand-file-name fsection srcdir))
+ (insert-file-contents (expand-file-name file srcdir))
(buffer-string)))
((file-readable-p (expand-file-name (elpaa--main-file pkg-spec) srcdir))
(with-temp-buffer
(insert-file-contents
(expand-file-name (elpaa--main-file pkg-spec) srcdir))
- (emacs-lisp-mode) ;lm-section-start needs the outline-mode setting.
- (let ((start (lm-section-start hsection)))
+ (emacs-lisp-mode) ;lm-section-start needs the outline-mode setting.
+ (let ((start (lm-section-start header)))
(when start
;; FIXME: Emacs<28 had a bug in `lm-section-end', so cook up
;; our own ad-hoc replacement.
- [nongnu] elpa-admin de2fd22 418/439: * elpa-admin.el (elpaa-read-config): Allow lists of strings, (continued)
- [nongnu] elpa-admin de2fd22 418/439: * elpa-admin.el (elpaa-read-config): Allow lists of strings, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin e3683d9 426/439: elpa-admin.el: Improve the badge generation code, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 8e351cc 425/439: * elpa-admin.el (elpaa--string-width): Use `elpaa--call`, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin e850286 428/439: Merge branch 'elpa-admin' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa into elpa-admin, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 6b5c39d 423/439: ; * elpa-admin.el (elpaa--html-footer): Fix LibreJS support., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 4541ebe 430/439: * elpa-admin.el (elpaa--get-release-revision): Workaround for git bug, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 1beeffd 433/439: * elpa-admin.el (elpaa--make-one-tarball): Return nil on error!, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 005c37e 434/439: * README (Configuration (elpa-config)): Document `elpa-config`, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 97d2765 436/439: * elpa-admin.el (ignore-error): Add backward compatibility definition, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 9b28c79 432/439: * elpa-admin.el (elpaa--make-one-tarball-1): Return non-nil when built, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin d4c962a 438/439: * elpa-admin.el (elpaa--get-section): Add docstring, rename vars,
Philip Kaludercic <=
- [nongnu] elpa-admin 6734638 244/439: Merge commit 'd7bac581f04756582078cd9ea45e5a28406ee05c', Philip Kaludercic, 2021/10/17