Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Open
condy0919 opened this issue May 23, 2024 · 2 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants