emacs-helm/helm

helm-packages fails when archive name is too long

Closed this issue · 6 comments

What happened?

When archive name is longer than 10 characters the helm-packages fails to start. Only the following line is produced in *Messages*:

helm-packages-transformer: Wrong type argument: wholenump, -1

Not withstanding using a shorter name for archive, I've hacked around a bit and changing how archive name is displayed (provider) to:

                              (helm-substring (or provider "") 10)
                              ;; Separator.
                              (make-string (1+ (- 10 (min (length provider) 10))) ? )

makes the issue go away. I wonder if other places may suffer from a similar issues (i.e., some strange version scheme, etc.) 🤔

How to reproduce?

Start Emacs:

emacs -Q

Evaluate the following:

(require 'package)
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/"))
(package-initialize)
(package-refresh-contents)
(package-install 'helm)
(helm-packages)

Backtrace is from the Emacs-30 on Linux, but can also reproduce on Emacs-29.4 (emacs-mac) on macOS.

Helm Version

Master branch

Emacs Version

Emacs-25*

OS

GNU/Linux

Relevant backtrace (if possible)

Debugger entered--Lisp error: (wrong-type-argument wholenump -1)
  make-string(-1 32)
  helm-packages-transformer(("zig-mode" "xah-fly-keys" "workroom" "why-this" "vcomplete" "vc-fossil" "undo-fu-session" "undo-fu" "ujelly-theme" "textile-mode" "testcover-mark-line" "tangotango-theme" "sweeprolog" "subed" "spell-fu" "scroll-on-jump" "scroll-on-drag" "recomplete" "racket-mode" "popon" "pacmacs" "p4-16-mode" "org-present" "org-contrib" "oblivion-theme" "minibar" "lorem-ipsum" "kotlin-mode" "iwindow" "inkpot-theme" "idle-highlight-mode" "hl-column" ...) ((name . "Available external packages") (init #f(compiled-function () #<bytecode -0x46257ecca27f5e8>)) (candidates . helm-candidates-in-buffer) (update . helm-packages--refresh-contents) (keymap keymap (f12 . #f(compiled-function () ... #<bytecode 0x1866bda1352280>)) (f11 . #f(compiled-function () ... #<bytecode 0x1866bda136e280>)) (f10 . #f(compiled-function () ... #<bytecode 0x1866bda137a280>)) (f9 . #f(compiled-function () ... #<bytecode 0x1866bda1316280>)) (f8 . #f(compiled-function () ... #<bytecode 0x1866bda1302280>)) (f7 . #f(compiled-function () ... #<bytecode 0x1866bda133e280>)) (f6 . #f(compiled-function () ... #<bytecode 0x1866bda132a280>)) (f5 . #f(compiled-function () ... #<bytecode 0x1866bda13e6280>)) (f4 . #f(compiled-function () ... #<bytecode 0x1866bda13f2280>)) (f3 . #f(compiled-function () ... #<bytecode 0x1866bda13ce280>)) (f2 . #f(compiled-function () ... #<bytecode 0x1866bda13da280>)) (menu-bar keymap (help-menu keymap ...)) (help keymap (109 . helm-help)) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 . #f(compiled-function () ... #<bytecode 0x1866bda13b6280>)) (8 keymap (109 . helm-help) (104 . undefined) (8 . undefined) (100 . helm-debug-output) (99 . helm-customize-group) (4 . helm-enable-or-switch-to-debug)) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (26 . helm-toggle-full-frame) (3 keymap (57 . #f(compiled-function () ... #<bytecode 0x1e856af6d1a91f6>)) (56 . #f(compiled-function () ... #<bytecode 0x1e856af6d7691f6>)) (55 . #f(compiled-function () ... #<bytecode 0x1e856af6d6291f6>)) (54 . #f(compiled-function () ... #<bytecode 0x1e856af6d5e91f6>)) (53 . #f(compiled-function () ... #<bytecode 0x1e856af6d4a91f6>)) (52 . #f(compiled-function () ... #<bytecode 0x1e856af6cc691f6>)) (51 . #f(compiled-function () ... #<bytecode 0x1e856af6cd291f6>)) (50 . #f(compiled-function () ... #<bytecode 0x1e856af6cee91f6>)) (49 . #f(compiled-function () ... #<bytecode 0x1e856af6cfa91f6>)) (110 . helm-helm-run-cycle-resume-with-subkeys) (108 . helm-display-line-numbers-mode) (62 . helm-toggle-truncate-line) (21 . helm-refresh) (6 . helm-follow-mode) (9 . helm-insert-or-copy) (11 . helm-kill-selection-and-quit) (25 . helm-yank-selection) (37 . helm-exchange-minibuffer-and-header-line) (95 . helm-toggle-full-frame) (45 . helm-swap-windows)) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) (18 . undefined) (19 . undefined) (24 keymap (57 . #f(compiled-function () ... #<bytecode 0x1e85396159291f6>)) (56 . #f(compiled-function () ... #<bytecode 0x1e8539615ae91f6>)) (55 . #f(compiled-function () ... #<bytecode 0x1e8539615ba91f6>)) (54 . #f(compiled-function () ... #<bytecode 0x1e8539615d691f6>)) (53 . #f(compiled-function () ... #<bytecode 0x1e8539615c291f6>)) (52 . #f(compiled-function () ... #<bytecode 0x1e8539615fe91f6>)) (51 . #f(compiled-function () ... #<bytecode 0x1e8539615ea91f6>)) (50 . #f(compiled-function () ... #<bytecode 0x1e85396152691f6>)) (49 . #f(compiled-function () ... #<bytecode 0x1e85396153291f6>)) (2 . helm-resume-list-buffers-after-quit) (98 . helm-resume-previous-session-after-quit) (6 . helm-quit-and-find-file)) (127 . helm-delete-char-backward) (11 . helm-delete-minibuffer-contents) (67108896 . helm-toggle-visible-mark-forward) (0 . helm-toggle-visible-mark) ...) (action ("Describe package" . helm-packages-describe) ("Visit homepage" . helm-packages-visit-homepage) ("Install packages(s)" . helm-packages-install)) (requires-pattern . 0) (filtered-candidate-transformer helm-packages-transformer (lambda (candidates _source) (sort candidates ...)) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (redisplay . identity) (coerce . helm-symbolify) (header-line . #("C-j: Describe package (keeping session)" 0 3 (font-lock-face help-key-binding face help-key-binding))) (multimatch . t) (find-file-target . helm-packages-quit-an-find-file) (group . helm) (data zig-mode xah-fly-keys workroom why-this vcomplete vc-fossil undo-fu-session undo-fu ujelly-theme textile-mode testcover-mark-line tangotango-theme sweeprolog subed spell-fu scroll-on-jump scroll-on-drag recomplete racket-mode popon pacmacs p4-16-mode org-present org-contrib oblivion-theme minibar lorem-ipsum kotlin-mode iwindow inkpot-theme idle-highlight-mode ...) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn)))
  apply(helm-packages-transformer (("zig-mode" "xah-fly-keys" "workroom" "why-this" "vcomplete" "vc-fossil" "undo-fu-session" "undo-fu" "ujelly-theme" "textile-mode" "testcover-mark-line" "tangotango-theme" "sweeprolog" "subed" "spell-fu" "scroll-on-jump" "scroll-on-drag" "recomplete" "racket-mode" "popon" "pacmacs" "p4-16-mode" "org-present" "org-contrib" "oblivion-theme" "minibar" "lorem-ipsum" "kotlin-mode" "iwindow" "inkpot-theme" "idle-highlight-mode" "hl-column" ...) ((name . "Available external packages") (init #f(compiled-function () #<bytecode -0x46257ecca27f5e8>)) (candidates . helm-candidates-in-buffer) (update . helm-packages--refresh-contents) (keymap keymap (f12 . #f(compiled-function () ... #<bytecode 0x1866bda1352280>)) (f11 . #f(compiled-function () ... #<bytecode 0x1866bda136e280>)) (f10 . #f(compiled-function () ... #<bytecode 0x1866bda137a280>)) (f9 . #f(compiled-function () ... #<bytecode 0x1866bda1316280>)) (f8 . #f(compiled-function () ... #<bytecode 0x1866bda1302280>)) (f7 . #f(compiled-function () ... #<bytecode 0x1866bda133e280>)) (f6 . #f(compiled-function () ... #<bytecode 0x1866bda132a280>)) (f5 . #f(compiled-function () ... #<bytecode 0x1866bda13e6280>)) (f4 . #f(compiled-function () ... #<bytecode 0x1866bda13f2280>)) (f3 . #f(compiled-function () ... #<bytecode 0x1866bda13ce280>)) (f2 . #f(compiled-function () ... #<bytecode 0x1866bda13da280>)) (menu-bar keymap ...) (help keymap ...) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 . #f(compiled-function () ... #<bytecode 0x1866bda13b6280>)) (8 keymap ... ... ... ... ... ...) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (26 . helm-toggle-full-frame) (3 keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) (18 . undefined) (19 . undefined) (24 keymap ... ... ... ... ... ... ... ... ... ... ... ...) (127 . helm-delete-char-backward) (11 . helm-delete-minibuffer-contents) (67108896 . helm-toggle-visible-mark-forward) (0 . helm-toggle-visible-mark) ...) (action ("Describe package" . helm-packages-describe) ("Visit homepage" . helm-packages-visit-homepage) ("Install packages(s)" . helm-packages-install)) (requires-pattern . 0) (filtered-candidate-transformer helm-packages-transformer (lambda ... ...) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (redisplay . identity) (coerce . helm-symbolify) (header-line . #("C-j: Describe package (keeping session)" 0 3 ...)) (multimatch . t) (find-file-target . helm-packages-quit-an-find-file) (group . helm) (data zig-mode xah-fly-keys workroom why-this vcomplete vc-fossil undo-fu-session undo-fu ujelly-theme textile-mode testcover-mark-line tangotango-theme sweeprolog subed spell-fu scroll-on-jump scroll-on-drag recomplete racket-mode popon pacmacs p4-16-mode org-present org-contrib oblivion-theme minibar lorem-ipsum kotlin-mode iwindow inkpot-theme idle-highlight-mode ...) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn))))
  helm-apply-functions-from-source(((name . "Available external packages") (init #f(compiled-function () #<bytecode -0x46257ecca27f5e8>)) (candidates . helm-candidates-in-buffer) (update . helm-packages--refresh-contents) (keymap keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (action ... ... ...) (requires-pattern . 0) (filtered-candidate-transformer helm-packages-transformer ... helm-fuzzy-highlight-matches) (volatile . t) (match identity) (redisplay . identity) (coerce . helm-symbolify) (header-line . ...) (multimatch . t) (find-file-target . helm-packages-quit-an-find-file) (group . helm) (data zig-mode xah-fly-keys workroom why-this vcomplete vc-fossil undo-fu-session undo-fu ujelly-theme textile-mode testcover-mark-line tangotango-theme sweeprolog subed spell-fu scroll-on-jump scroll-on-drag recomplete racket-mode ...) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn)) (helm-packages-transformer (lambda ... ...) helm-fuzzy-highlight-matches) ("zig-mode" "xah-fly-keys" "workroom" "why-this" "vcomplete" "vc-fossil" "undo-fu-session" "undo-fu" "ujelly-theme" "textile-mode" "testcover-mark-line" "tangotango-theme" "sweeprolog" "subed" "spell-fu" "scroll-on-jump" "scroll-on-drag" "recomplete" "racket-mode" "popon" ...) ((name . "Available external packages") (init #f(compiled-function () #<bytecode -0x46257ecca27f5e8>)) (candidates . helm-candidates-in-buffer) (update . helm-packages--refresh-contents) (keymap keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (action ... ... ...) (requires-pattern . 0) (filtered-candidate-transformer helm-packages-transformer ... helm-fuzzy-highlight-matches) (volatile . t) (match identity) (redisplay . identity) (coerce . helm-symbolify) (header-line . ...) (multimatch . t) (find-file-target . helm-packages-quit-an-find-file) (group . helm) (data zig-mode xah-fly-keys workroom why-this vcomplete vc-fossil undo-fu-session undo-fu ujelly-theme textile-mode testcover-mark-line tangotango-theme sweeprolog subed spell-fu scroll-on-jump scroll-on-drag recomplete racket-mode ...) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn)))
  helm-process-filtered-candidate-transformer(("zig-mode" "xah-fly-keys" "workroom" "why-this" "vcomplete" "vc-fossil" "undo-fu-session" "undo-fu" "ujelly-theme" "textile-mode" "testcover-mark-line" "tangotango-theme" "sweeprolog" "subed" "spell-fu" "scroll-on-jump" "scroll-on-drag" "recomplete" "racket-mode" "popon" "pacmacs" "p4-16-mode" "org-present" "org-contrib" "oblivion-theme" "minibar" "lorem-ipsum" "kotlin-mode" "iwindow" "inkpot-theme" "idle-highlight-mode" "hl-column" ...) ((name . "Available external packages") (init #f(compiled-function () #<bytecode -0x46257ecca27f5e8>)) (candidates . helm-candidates-in-buffer) (update . helm-packages--refresh-contents) (keymap keymap (f12 . #f(compiled-function () ... #<bytecode 0x1866bda1352280>)) (f11 . #f(compiled-function () ... #<bytecode 0x1866bda136e280>)) (f10 . #f(compiled-function () ... #<bytecode 0x1866bda137a280>)) (f9 . #f(compiled-function () ... #<bytecode 0x1866bda1316280>)) (f8 . #f(compiled-function () ... #<bytecode 0x1866bda1302280>)) (f7 . #f(compiled-function () ... #<bytecode 0x1866bda133e280>)) (f6 . #f(compiled-function () ... #<bytecode 0x1866bda132a280>)) (f5 . #f(compiled-function () ... #<bytecode 0x1866bda13e6280>)) (f4 . #f(compiled-function () ... #<bytecode 0x1866bda13f2280>)) (f3 . #f(compiled-function () ... #<bytecode 0x1866bda13ce280>)) (f2 . #f(compiled-function () ... #<bytecode 0x1866bda13da280>)) (menu-bar keymap (help-menu keymap ...)) (help keymap (109 . helm-help)) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 . #f(compiled-function () ... #<bytecode 0x1866bda13b6280>)) (8 keymap (109 . helm-help) (104 . undefined) (8 . undefined) (100 . helm-debug-output) (99 . helm-customize-group) (4 . helm-enable-or-switch-to-debug)) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (26 . helm-toggle-full-frame) (3 keymap (57 . #f(compiled-function () ... #<bytecode 0x1e856af6d1a91f6>)) (56 . #f(compiled-function () ... #<bytecode 0x1e856af6d7691f6>)) (55 . #f(compiled-function () ... #<bytecode 0x1e856af6d6291f6>)) (54 . #f(compiled-function () ... #<bytecode 0x1e856af6d5e91f6>)) (53 . #f(compiled-function () ... #<bytecode 0x1e856af6d4a91f6>)) (52 . #f(compiled-function () ... #<bytecode 0x1e856af6cc691f6>)) (51 . #f(compiled-function () ... #<bytecode 0x1e856af6cd291f6>)) (50 . #f(compiled-function () ... #<bytecode 0x1e856af6cee91f6>)) (49 . #f(compiled-function () ... #<bytecode 0x1e856af6cfa91f6>)) (110 . helm-helm-run-cycle-resume-with-subkeys) (108 . helm-display-line-numbers-mode) (62 . helm-toggle-truncate-line) (21 . helm-refresh) (6 . helm-follow-mode) (9 . helm-insert-or-copy) (11 . helm-kill-selection-and-quit) (25 . helm-yank-selection) (37 . helm-exchange-minibuffer-and-header-line) (95 . helm-toggle-full-frame) (45 . helm-swap-windows)) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) (18 . undefined) (19 . undefined) (24 keymap (57 . #f(compiled-function () ... #<bytecode 0x1e85396159291f6>)) (56 . #f(compiled-function () ... #<bytecode 0x1e8539615ae91f6>)) (55 . #f(compiled-function () ... #<bytecode 0x1e8539615ba91f6>)) (54 . #f(compiled-function () ... #<bytecode 0x1e8539615d691f6>)) (53 . #f(compiled-function () ... #<bytecode 0x1e8539615c291f6>)) (52 . #f(compiled-function () ... #<bytecode 0x1e8539615fe91f6>)) (51 . #f(compiled-function () ... #<bytecode 0x1e8539615ea91f6>)) (50 . #f(compiled-function () ... #<bytecode 0x1e85396152691f6>)) (49 . #f(compiled-function () ... #<bytecode 0x1e85396153291f6>)) (2 . helm-resume-list-buffers-after-quit) (98 . helm-resume-previous-session-after-quit) (6 . helm-quit-and-find-file)) (127 . helm-delete-char-backward) (11 . helm-delete-minibuffer-contents) (67108896 . helm-toggle-visible-mark-forward) (0 . helm-toggle-visible-mark) ...) (action ("Describe package" . helm-packages-describe) ("Visit homepage" . helm-packages-visit-homepage) ("Install packages(s)" . helm-packages-install)) (requires-pattern . 0) (filtered-candidate-transformer helm-packages-transformer (lambda (candidates _source) (sort candidates ...)) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (redisplay . identity) (coerce . helm-symbolify) (header-line . #("C-j: Describe package (keeping session)" 0 3 (font-lock-face help-key-binding face help-key-binding))) (multimatch . t) (find-file-target . helm-packages-quit-an-find-file) (group . helm) (data zig-mode xah-fly-keys workroom why-this vcomplete vc-fossil undo-fu-session undo-fu ujelly-theme textile-mode testcover-mark-line tangotango-theme sweeprolog subed spell-fu scroll-on-jump scroll-on-drag recomplete racket-mode popon pacmacs p4-16-mode org-present org-contrib oblivion-theme minibar lorem-ipsum kotlin-mode iwindow inkpot-theme idle-highlight-mode ...) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn)))
  helm-compute-matches(((name . "Available external packages") (init #f(compiled-function () #<bytecode -0x46257ecca27f5e8>)) (candidates . helm-candidates-in-buffer) (update . helm-packages--refresh-contents) (keymap keymap (f12 . #f(compiled-function () (interactive nil) #<bytecode 0x1866bda1352280>)) (f11 . #f(compiled-function () (interactive nil) #<bytecode 0x1866bda136e280>)) (f10 . #f(compiled-function () (interactive nil) #<bytecode 0x1866bda137a280>)) (f9 . #f(compiled-function () (interactive nil) #<bytecode 0x1866bda1316280>)) (f8 . #f(compiled-function () (interactive nil) #<bytecode 0x1866bda1302280>)) (f7 . #f(compiled-function () (interactive nil) #<bytecode 0x1866bda133e280>)) (f6 . #f(compiled-function () (interactive nil) #<bytecode 0x1866bda132a280>)) (f5 . #f(compiled-function () (interactive nil) #<bytecode 0x1866bda13e6280>)) (f4 . #f(compiled-function () (interactive nil) #<bytecode 0x1866bda13f2280>)) (f3 . #f(compiled-function () (interactive nil) #<bytecode 0x1866bda13ce280>)) (f2 . #f(compiled-function () (interactive nil) #<bytecode 0x1866bda13da280>)) (menu-bar keymap (help-menu keymap (describe keymap ...))) (help keymap (109 . helm-help)) (23 . helm-helm-yank-text-at-point-with-subkeys) (f1 . #f(compiled-function () (interactive nil) #<bytecode 0x1866bda13b6280>)) (8 keymap (109 . helm-help) (104 . undefined) (8 . undefined) (100 . helm-debug-output) (99 . helm-customize-group) (4 . helm-enable-or-switch-to-debug)) (20 . helm-toggle-resplit-and-swap-windows) (C-tab . undefined) (67108897 . helm-toggle-suspend-update) (26 . helm-toggle-full-frame) (3 keymap (57 . #f(compiled-function () ... #<bytecode 0x1e856af6d1a91f6>)) (56 . #f(compiled-function () ... #<bytecode 0x1e856af6d7691f6>)) (55 . #f(compiled-function () ... #<bytecode 0x1e856af6d6291f6>)) (54 . #f(compiled-function () ... #<bytecode 0x1e856af6d5e91f6>)) (53 . #f(compiled-function () ... #<bytecode 0x1e856af6d4a91f6>)) (52 . #f(compiled-function () ... #<bytecode 0x1e856af6cc691f6>)) (51 . #f(compiled-function () ... #<bytecode 0x1e856af6cd291f6>)) (50 . #f(compiled-function () ... #<bytecode 0x1e856af6cee91f6>)) (49 . #f(compiled-function () ... #<bytecode 0x1e856af6cfa91f6>)) (110 . helm-helm-run-cycle-resume-with-subkeys) (108 . helm-display-line-numbers-mode) (62 . helm-toggle-truncate-line) (21 . helm-refresh) (6 . helm-follow-mode) (9 . helm-insert-or-copy) (11 . helm-kill-selection-and-quit) (25 . helm-yank-selection) (37 . helm-exchange-minibuffer-and-header-line) (95 . helm-toggle-full-frame) (45 . helm-swap-windows)) (67108987 . helm-enlarge-window) (67108989 . helm-narrow-window) (18 . undefined) (19 . undefined) (24 keymap (57 . #f(compiled-function () ... #<bytecode 0x1e85396159291f6>)) (56 . #f(compiled-function () ... #<bytecode 0x1e8539615ae91f6>)) (55 . #f(compiled-function () ... #<bytecode 0x1e8539615ba91f6>)) (54 . #f(compiled-function () ... #<bytecode 0x1e8539615d691f6>)) (53 . #f(compiled-function () ... #<bytecode 0x1e8539615c291f6>)) (52 . #f(compiled-function () ... #<bytecode 0x1e8539615fe91f6>)) (51 . #f(compiled-function () ... #<bytecode 0x1e8539615ea91f6>)) (50 . #f(compiled-function () ... #<bytecode 0x1e85396152691f6>)) (49 . #f(compiled-function () ... #<bytecode 0x1e85396153291f6>)) (2 . helm-resume-list-buffers-after-quit) (98 . helm-resume-previous-session-after-quit) (6 . helm-quit-and-find-file)) (127 . helm-delete-char-backward) (11 . helm-delete-minibuffer-contents) (67108896 . helm-toggle-visible-mark-forward) (0 . helm-toggle-visible-mark) (C-M-up . helm-scroll-other-window-down) (C-M-down . helm-scroll-other-window) (M-prior . helm-scroll-other-window-down) (M-next . helm-scroll-other-window) (12 . helm-recenter-top-bottom-other-window) (left . helm-previous-source) ...) (action ("Describe package" . helm-packages-describe) ("Visit homepage" . helm-packages-visit-homepage) ("Install packages(s)" . helm-packages-install)) (requires-pattern . 0) (filtered-candidate-transformer helm-packages-transformer (lambda (candidates _source) (sort candidates #'helm-generic-sort-fn)) helm-fuzzy-highlight-matches) (volatile . t) (match identity) (redisplay . identity) (coerce . helm-symbolify) (header-line . #("C-j: Describe package (keeping session)" 0 3 (font-lock-face help-key-binding face help-key-binding))) (multimatch . t) (find-file-target . helm-packages-quit-an-find-file) (group . helm) (data zig-mode xah-fly-keys workroom why-this vcomplete vc-fossil undo-fu-session undo-fu ujelly-theme textile-mode testcover-mark-line tangotango-theme sweeprolog subed spell-fu scroll-on-jump scroll-on-drag recomplete racket-mode popon pacmacs p4-16-mode org-present org-contrib oblivion-theme minibar lorem-ipsum kotlin-mode iwindow inkpot-theme idle-highlight-mode hl-column hl-block-mode hideshowvis haskell-ts-mode haskell-tng-mode graphql-mode ...) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn)))
  helm--collect-matches(((... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)))
  helm-update(nil)
  helm-read-from-minibuffer(nil nil nil nil nil nil nil)
  helm-internal(((... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) nil nil nil nil "*helm packages*" nil nil nil)
  apply(helm-internal ((... ... ... ... ...) nil nil nil nil "*helm packages*" nil nil nil))
  helm(((... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) nil nil nil nil "*helm packages*" nil nil nil)
  apply(helm ((... ... ... ... ...) nil nil nil nil "*helm packages*" nil nil nil))
  helm(:sources ((... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) :buffer "*helm packages*")
  helm-packages()
  eval((helm-packages) nil)
  elisp--eval-last-sexp(nil)
  #f(compiled-function () #<bytecode 0x5186499d2fc0a>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x5186499d2fc0a>) (error) eval-expression--debug)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

Minimal configuration

  • I agree using a minimal configuration

@thierryvolpiatto I've just tested and it works for me. Feel free to close this issue.

I was curious what will happen with alignment when there are longest archive names, but seems you thought about it too (62962e9).

But now it made me wonder about two things:

  • What about other columns, for example versions. It seems that xah-fly-keys in nongnu is already pushing it with 26.8.20241118173945 which is just shy of the limit of 20.
  • When these fields become so wide, each package line either will be wrapped or will be truncated. Not sure what the principles are when it comes to user experience in such a case.

Yes, I believe I found this one and have used its length +1. But it is not ideal, the best is to compute this length on the fly but it is costly as it needs an extra loop just for this, which make the display slower. It is why for the candidates themselves we compute this length very early and cache it in a local variable.

• When these fields become so wide, each package line either will be wrapped or will be truncated. Not sure what the principles are when it comes to user experience in such a case.

I always try to make a compromise between performances and user experience, which is not always easy.

Not asking to do anything but I can see at least two ways out:

  • Update how the longest candidate is calculated and instead caching a single number cache as many as needed. One for name, one for version, etc.
  • Decide what's most practical longest string that can fit and trim the rest. Perhaps with a a continuation character (ellipsis?). Say something along the lines:
(defun trim (str max-len how cont)
  "Trim STR to have at most MAX-LEN number of characters.
HOW determines where characters are trimmed, one of \\='left,
\\='right, \\='mid. CONT is the character to use to denote where
characters were trimmed."
  (if-let* ((len (length str))
            ((< max-len len)))
      (pcase how
        ('left
         (format "%c%s"
                 cont
                 (substring str (max 0 (- len (1- max-len))))))
        ('right
         (format "%s%c"
                 (substring str 0 (max 0 (- len (1+ max-len))))
                 cont))
        ('mid
         (format "%s%c%s"
                 (substring str 0  (/ max-len 2))
                 cont
                 (substring str (- len (- (/ max-len 2)
                                          (if (eq 1 (% max-len 2)) 0 1)))))))
    str))

The three methods may be beneficial for different cases, i.e., version would probably be best trimmed in the middle.
Perhaps having a full name in some kind of tooltip would be great, just not sure how to present the full value to an user

I think I am convinced this the best pragmatic approach.

Thank you!