GNU bug report logs - #64108
hippie-expand's try-expand-all-abbrevs nil has trouble expanding abbrevs given as list(aka. expand.el snipets)

Previous Next

Package: emacs;

Reported by: Yilkal Argaw <yilkalargawworkneh <at> gmail.com>

Date: Fri, 16 Jun 2023 14:25:02 UTC

Severity: normal

To reply to this bug, email your comments to 64108 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#64108; Package emacs. (Fri, 16 Jun 2023 14:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yilkal Argaw <yilkalargawworkneh <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 16 Jun 2023 14:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Yilkal Argaw <yilkalargawworkneh <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: hippie-expand's try-expand-all-abbrevs nil has trouble expanding
 abbrevs given as list(aka. expand.el snipets)
Date: Fri, 16 Jun 2023 17:24:15 +0300
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64108; Package emacs. (Fri, 16 Jun 2023 16:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 64108 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yilkal Argaw <yilkalargawworkneh <at> gmail.com>
Cc: 64108 <at> debbugs.gnu.org
Subject: Re: bug#64108: hippie-expand's try-expand-all-abbrevs nil has trouble
 expanding abbrevs given as list(aka. expand.el snipets)
Date: Fri, 16 Jun 2023 19:25:54 +0300
> From: Yilkal Argaw <yilkalargawworkneh <at> gmail.com>
> Date: Fri, 16 Jun 2023 17:24:15 +0300
> 
> 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.

It looks like hippie-expand doesn't support "special" abbrevs, those
whose expansion is obtained by running a hook function (as opposed to
just using the string that is the abbrev's expansion).  IOW,
hippie-expand expects that abbrev-expansion returns a string, which is
not what happens with "special" abbrevs.  And expand.el, where
expand-add-abbrevs is defined, defines such "special" abbrevs.

Patches to adapt hippie-expand to abbrevs created by expand.el are
welcome.




This bug report was last modified 322 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.