emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [nongnu] elpa/evil 460af439e5: Suppress operator for some normal sta


From: Stefan Monnier
Subject: Re: [nongnu] elpa/evil 460af439e5: Suppress operator for some normal state commands
Date: Fri, 07 Oct 2022 20:01:34 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

ELPA Syncer [2022-10-03 16:58:25] wrote:

> branch: elpa/evil
> commit 460af439e51da7f6602732318ff52820bd2286fd
> Author: Tom Dalziel <tom_dl@hotmail.com>
> Commit: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>
>
>     Suppress operator for some normal state commands
[...]
> @@ -2002,11 +2093,12 @@ with regard to indentation."
>    (or (and (>= char ?A) (<= char ?Z))
>        (assq char (default-value 'evil-markers-alist))))
>  
> -(defun evil-set-marker (char &optional pos advance)
> +(evil-define-command evil-set-marker (char &optional pos advance)
>    "Set the marker denoted by CHAR to position POS.
>  POS defaults to the current position of point.
>  If ADVANCE is t, the marker advances when inserting text at it;
>  otherwise, it stays behind."
> +  :suppress-operator t
>    (interactive (list (read-char)))
>    (catch 'done
>      (let ((marker (evil-get-marker char t)) alist)

This hunk breaks compilation of `evil-common.el` (unless you call the
compiler after you loaded that non-compiled file, to fix the
circularity by hand):

When compiling the file, the compiler needs to macro expand this
`evil-define-command`.  The macro is defined a few lines earlier, so
that part works fine, but the macro calls during its expansion a few
other functions defined in that same file: while the functions are
defined earlier in the file, this still breaks because when the file is
compiled the `defun`s are not yet executed (i.e. the functions get
compiled but they don't get defined).  So we get an error of the form:

Error: void-function (evil-interactive-form)
  debug(error (void-function evil-interactive-form))
  evil-interactive-form((list (read-char)))
  apply(evil-interactive-form (list (read-char)))
  [...]
  macroexpand-1((evil-define-command evil-set-marker ...
  [...]

To fix this, we need either:
- wrap inside `eval-and-compile` all the functions used during the macro
  expansion of `evil-define-command`.
- Move the definition of `evil-set-marker` to another file, like
  `evil-commands.el`.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]