Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Compile Error: List contains a loop: (lower-right lower-left upper-left upper-right #1903

Closed
condy0919 opened this issue May 23, 2024 · 4 comments

Comments

@condy0919
Copy link
Contributor

Issue type

  • Bug report

Environment

Emacs version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0) of 2024-05-23

Operating System: ArchLinux
Evil version: Evil version 1.15.0
Evil installation type: MELPA
Graphical/Terminal: GUI on X
Tested in a make emacs session (see CONTRIBUTING.md): No

Reproduction steps

  • Start Emacs
  • Install evil from melpa

Expected behavior

No errors during byte-comp.

Actual behavior

byte-compiler complains

List contains a loop: (lower-right lower-left upper-left upper-right lower-right lower-left upper-left upper-right lower-right lower-left . #6) 

Further notes

(evil-define-command evil-visual-rotate (corner &optional beg end type)
  "Move point to CORNER of the Visual selection.
Corner may be one of `upper-left', `upper-right', `lower-left' and
`lower-right':

    upper-left +---+ upper-right
               |   |
    lower-left +---+ lower-right

When called interactively, the selection is rotated clockwise."
  :keep-visual t
  (interactive
   (let ((corners '#1=(upper-left upper-right lower-right lower-left . #1#)))
     (list (cadr (memq (evil-visual-block-corner) corners)))))
  (let* ((beg (or beg (point)))
         (end (or end (mark t) beg))
         (type (or type evil-this-type))
         range)
    (cond
     ((memq type '(rectangle block))
      (setq range (evil-block-rotate beg end :corner corner)
            beg (pop range)
            end (pop range))
      (unless (eq corner (evil-visual-block-corner corner beg end))
        (evil-swap beg end))
      (goto-char beg)
      (when (evil-visual-state-p)
        (evil-move-mark end)
        (evil-visual-refresh nil nil nil :corner corner)))
     ((memq corner '(upper-right lower-right))
      (goto-char (max beg end))
      (when (evil-visual-state-p)
        (evil-move-mark (min beg end))))
     (t
      (goto-char (min beg end))
      (when (evil-visual-state-p)
        (evil-move-mark (max beg end)))))))

The variable corners uses an recursive ref #1 in it's definition.

@axelf4
Copy link
Collaborator

axelf4 commented May 23, 2024

Huh, since when is that not allowed? I get no warnings on GNU Emacs 29.3.

@condy0919
Copy link
Contributor Author

Huh, since when is that not allowed? I get no warnings on GNU Emacs 29.3.

Emacs 30 complains.

@axelf4
Copy link
Collaborator

axelf4 commented Sep 21, 2024

I am unable to reproduce with GNU Emacs 30.0.91 on NixOS, using default compilation options.

@condy0919
Copy link
Contributor Author

condy0919 commented Sep 26, 2024

I'm upgrading Emacs to 31.0.50, It can still be reproduced in emacs -Q.

# emacs -Q
(byte-recompile-directory "~/.emacs.d/elpa/evil-20240915.832" 0 t) # fix the evil path

In the Compile-Log buffer, you will see:

evil-commands.el:2644:2: Error: List contains a loop: (lower-right lower-left upper-left upper-right lower-right lower-left upper-left upper-right lower-right lower-left . #6)

Emacs builds under f9fa75c1ef31ee78b43509f15b50cf0603757181

@axelf4 axelf4 closed this as completed in b7ab384 Oct 6, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants