[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa-admin 8e351cc 425/439: * elpa-admin.el (elpaa--string-widt
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa-admin 8e351cc 425/439: * elpa-admin.el (elpaa--string-width): Use `elpaa--call` |
Date: |
Sun, 17 Oct 2021 15:48:50 -0400 (EDT) |
branch: elpa-admin
commit 8e351cc4781cd232b5c2f723ef8f64b2663a75e1
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* elpa-admin.el (elpaa--string-width): Use `elpaa--call`
---
elpa-admin.el | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/elpa-admin.el b/elpa-admin.el
index 38ace62..64e37dc 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -649,15 +649,14 @@ Return non-nil if a new tarball was created."
(defun elpaa--string-width (str)
"Determine string width in pixels of STR."
- (let ((output (shell-command-to-string
- (format "convert -debug annotate xc: -font DejaVu-Sans\
- -pointsize 110 -annotate 0 %s null: 2>&1"
- (shell-quote-argument str)))))
- (save-match-data
- (if (string-match
- "Metrics:.*?width: \\([0-9]+\\)"
- output)
- (string-to-number (match-string 1 output))
+ (with-temp-buffer
+ (elpaa--call (current-buffer)
+ "convert" "-debug" "annotate" "xc:" "-font" "DejaVu-Sans"
+ "-pointsize" "110" "-annotate" "0" str "null:")
+ (save-match-data ;;FIXME: Why?
+ (goto-char (point-min))
+ (if (re-search-forward "Metrics:.*?width: \\([0-9]+\\)")
+ (string-to-number (match-string 1))
(error "Could not determine string width")))))
(defun elpaa--make-badge (file left right)
@@ -676,6 +675,7 @@ Return non-nil if a new tarball was created."
(width . ,width)
(color . ,color)
(pad . ,pad))))
+ ;; FIXME: Use `svg.el'?
(with-temp-buffer
(insert
(replace-regexp-in-string
@@ -821,10 +821,12 @@ place the resulting tarball into the file named
ONE-TARBALL."
(elpaa--release-email pkg-spec metadata dir)))))
;; Generate missing badges
+ ;; FIXME: Why here?
(unless (and (not new) (file-exists-p devel-badge))
(elpaa--make-badge devel-badge
(format "%s-devel ELPA" elpaa--name)
(format "%s %s" pkgname devel-vers)))
+ ;; FIXME: Shouldn't it be made already above?
(unless (file-exists-p release-badge)
(elpaa--make-badge release-badge
(format "%s ELPA" elpaa--name)
- [nongnu] elpa-admin 97ebbd5 405/439: * elpa-admin.el (elpaa--prune-old-tarballs): "(Re)move" the non-kept files, (continued)
- [nongnu] elpa-admin 97ebbd5 405/439: * elpa-admin.el (elpaa--prune-old-tarballs): "(Re)move" the non-kept files, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 8ed7b88 354/439: Rename vars and functions with `elpaa-` prefix, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin d8903b6 358/439: * elpa-admin.el: Add some of the support needed to build Org packages, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 7e5b75b 359/439: * elpa-admin.el: Add support for checking copyright notices, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin c26df96 392/439: * elpa-admin.el: Allow `:doc` to specify several doc files, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 396a74b 421/439: Bump license for package pages to CC BY-ND 4.0, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin c29da22 424/439: * elpa-admin.el: Generate SVG badges, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin fa18a66 413/439: * elpa-admin.el: Improve doc build for the :core packages, Philip Kaludercic, 2021/10/17
- [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 <=
- [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, 2021/10/17
- [nongnu] elpa-admin 6734638 244/439: Merge commit 'd7bac581f04756582078cd9ea45e5a28406ee05c', Philip Kaludercic, 2021/10/17