Skip to content

Infinite loop in clojure-sort-ns when sorting a ns with comments #645

Closed
@ieure

Description

@ieure

Expected behavior

The ns should be sorted.

Actual behavior

My Emacs session freezes until I hit C-g.

Steps to reproduce the problem

  1. Open an empty .clj file and put this in it:

    (ns test
      (:require [some]
                ;; [other]
                ))
    
  2. Hit M-x clojure-sort-ns RET.

  3. Emacs freezes.

If you uncomment the line with [other] and try again, it works fine. It also works fine if the #_ reader macro is used.

Environment & Version information

clojure-mode version

clojure-mode (version 5.16.0)

Emacs version

GNU Emacs 28.2 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)

Operating system

Debian 11 "bullseye"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions