Skip to content

clojure-find-def fails on spurious comments #686

Open
@smendezs

Description

@smendezs

If I put a comment after a defn like this:

(defn
   ;; comment
   foo [a b]
   (+ a b))

it's still syntactically valid clojure. However, this breaks some clojure-mode functionality.

Expected behavior

(clojure-find-def) with the pointer in that function should return ("defn" "foo").

Actual behavior

It returns nil.

The regexp responsible for this, clojure-def-type-and-name-regex doesn't take into account any comments before the symbol name (foo in this case).

Steps to reproduce the problem

Execute (clojure-find-def) while the pointer is in the above function def.

Environment & Version information

clojure-mode version

clojure-mode (version `20241211)`

Emacs version

29.4

Operating system

Ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy