unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#59369: 29.0.50; eudc-mailabbrev-query-internal fails with void-variable
@ 2022-11-18 17:16 Brent Westbrook
  2022-11-19 14:34 ` Thomas Fitzsimmons
       [not found] ` <handler.59369.D59369.166886845527831.notifdone@debbugs.gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Brent Westbrook @ 2022-11-18 17:16 UTC (permalink / raw)
  To: 59369

I was not able to reproduce this with emacs -Q and loading my mu4e
config, but when I try to compose an email with mu4e-compose and press
tab to expand one particular email address ("someemail" used as a
placeholder), it fails with this backtrace:

Debugger entered--Lisp error: (void-variable someemail)
  symbol-value(someemail)
  eudc-mailabbrev-query-internal(((email . "someemail")) (firstname name email))
  eudc-query(((email . "someemail")) (firstname name email))
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_22>(("someemail") t (nil) ((email) (firstname)))
  eudc-query-with-words(("someemail") t)
  eudc-capf-message-expand-name()
  eudc-capf-complete()
  completion--capf-wrapper(eudc-capf-complete all)
  completion-at-point()
  message-tab()
  funcall-interactively(message-tab)
  command-execute(message-tab)

It works fine if I press tab after a substring like "someemai" or "someema" or even
"someemail@", but fails for "someemail" exactly.

This patch seems to fix the issue by checking if the symbol is bound
before calling symbol-value.

diff --git a/lisp/net/eudcb-mailabbrev.el b/lisp/net/eudcb-mailabbrev.el
index 64b50af09b..4a2dd9ad4a 100644
--- a/lisp/net/eudcb-mailabbrev.el
+++ b/lisp/net/eudcb-mailabbrev.el
@@ -78,7 +78,10 @@ RETURN-ATTRS is a list of attributes to return, defaulting to
     (dolist (term query)
       (let* ((attr (car term))
              (value (cdr term))
-             (raw-matches (symbol-value (intern-soft value mail-abbrevs))))
+             (soft (intern-soft value mail-abbrevs))
+             (raw-matches (and
+                           (boundp soft)
+                           (symbol-value soft))))
         (when (and raw-matches
                    (memq attr '(email firstname name)))
           (let* ((matches (split-string raw-matches ", "))






^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#59369: 29.0.50; eudc-mailabbrev-query-internal fails with void-variable
  2022-11-18 17:16 bug#59369: 29.0.50; eudc-mailabbrev-query-internal fails with void-variable Brent Westbrook
@ 2022-11-19 14:34 ` Thomas Fitzsimmons
       [not found] ` <handler.59369.D59369.166886845527831.notifdone@debbugs.gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Fitzsimmons @ 2022-11-19 14:34 UTC (permalink / raw)
  To: Brent Westbrook; +Cc: 59369-done

Hi Ben,

Brent Westbrook <bwestbr2@go.olemiss.edu> writes:

> I was not able to reproduce this with emacs -Q and loading my mu4e
> config, but when I try to compose an email with mu4e-compose and press
> tab to expand one particular email address ("someemail" used as a
> placeholder), it fails with this backtrace:
>
> Debugger entered--Lisp error: (void-variable someemail)
>   symbol-value(someemail)
>   eudc-mailabbrev-query-internal(((email . "someemail")) (firstname name email))
>   eudc-query(((email . "someemail")) (firstname name email))
>   #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_22>(("someemail") t (nil) ((email) (firstname)))
>   eudc-query-with-words(("someemail") t)
>   eudc-capf-message-expand-name()
>   eudc-capf-complete()
>   completion--capf-wrapper(eudc-capf-complete all)
>   completion-at-point()
>   message-tab()
>   funcall-interactively(message-tab)
>   command-execute(message-tab)
>
> It works fine if I press tab after a substring like "someemai" or "someema" or even
> "someemail@", but fails for "someemail" exactly.

Yes, I also noticed this type of failure last night, while I was working
on bug#59314.

> This patch seems to fix the issue by checking if the symbol is bound
> before calling symbol-value.

Thanks for the fix, I pushed it to the master branch.  I confirmed no
regressions by running:

    make -C test lisp/net/eudc-tests.log

Thomas





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#59369: 29.0.50; eudc-mailabbrev-query-internal fails with void-variable
       [not found] ` <handler.59369.D59369.166886845527831.notifdone@debbugs.gnu.org>
@ 2022-11-19 14:39   ` Thomas Fitzsimmons
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Fitzsimmons @ 2022-11-19 14:39 UTC (permalink / raw)
  To: 59369; +Cc: Brent Westbrook

> Hi Ben,

Oops, "Brent", I meant; sorry!

Thomas





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-19 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-18 17:16 bug#59369: 29.0.50; eudc-mailabbrev-query-internal fails with void-variable Brent Westbrook
2022-11-19 14:34 ` Thomas Fitzsimmons
     [not found] ` <handler.59369.D59369.166886845527831.notifdone@debbugs.gnu.org>
2022-11-19 14:39   ` Thomas Fitzsimmons

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).