Subject: hippie-expand's try-expand-all-abbrevs nil has trouble expanding abbrevs given as list(aka. expand.el snipets)

From: Yilkal Argaw <[email-masked]>
Date: Fri, 16 Jun 2023 17:24:15 +0300

Hello,
When trying to use hippie-expand to expand a simple expand.el snippet
causes a bug about lists not being acceptable.

To recreate the bug use the following init.el and try to expand def using
hippie expand
;;init.el
(defconst elisp-expand-list
  '(("def" "(defun ()\n ) " (8 9 11 12)))
  "Expansions for elisp mode")
(add-hook 'emacs-lisp-mode-hook
 (lambda () (expand-add-abbrevs emacs-lisp-mode-abbrev-table
elisp-expand-list)))
(add-hook 'lisp-interaction-mode-hook
 (lambda () (expand-add-abbrevs emacs-lisp-mode-abbrev-table
elisp-expand-list)))
(global-set-key [remap dabbrev-expand] 'hippie-expand)

This error persists even when calling the (try-expand-all-abbrevs nil)
using eval expression the debug log is as follows.

Debugger entered--Lisp error: (wrong-type-argument stringp ["(defun ()\n )
" 6 (13 8 9 11 12)])
  he-transfer-case("def" ["(defun ()\n ) " 6 (13 8 9 11 12) nil])
  he-string-member(["(defun ()\n ) " 6 (13 8 9 11 12) nil] ("def") t)
  try-expand-all-abbrevs(nil)
  eval-expression((try-expand-all-abbrevs nil) nil nil 127)
  funcall-interactively(eval-expression (try-expand-all-abbrevs nil) nil
nil 127)
  command-execute(eval-expression)

With Regards
Yilkal Argaw