From d6a43eef7ca214bdba649d0681b8e8ddc4d9d8f8 Mon Sep 17 00:00:00 2001 From: vemv Date: Thu, 24 Aug 2023 07:51:55 +0200 Subject: [PATCH] x --- clojure-mode.el | 2 +- test/clojure-mode-util-test.el | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/clojure-mode.el b/clojure-mode.el index 2f68a0db..517f8803 100644 --- a/clojure-mode.el +++ b/clojure-mode.el @@ -2110,7 +2110,7 @@ content) are considered part of the preceding sexp." (make-obsolete-variable 'clojure-namespace-name-regex 'clojure-namespace-regexp "5.12.0") (defconst clojure-namespace-regexp - (rx line-start "(" (? "clojure.core/") (or "in-ns" "ns" "ns+") symbol-end)) + (rx "(" (? "clojure.core/") (or "in-ns" "ns" "ns+") symbol-end)) (defcustom clojure-cache-ns nil "Whether to cache the results of `clojure-find-ns'. diff --git a/test/clojure-mode-util-test.el b/test/clojure-mode-util-test.el index a35babbe..ba9bfeea 100644 --- a/test/clojure-mode-util-test.el +++ b/test/clojure-mode-util-test.el @@ -125,6 +125,23 @@ (with-clojure-buffer "(ns foo) (ns-unmap *ns* 'map) (ns.misleading 1 2 3)" + (expect (clojure-find-ns) :to-equal "foo"))) + (it "should skip leading garbage" + (with-clojure-buffer " (ns foo)" + (expect (clojure-find-ns) :to-equal "foo")) + (with-clojure-buffer "1(ns foo)" + (expect (clojure-find-ns) :to-equal "foo")) + (with-clojure-buffer "1 (ns foo)" + (expect (clojure-find-ns) :to-equal "foo")) + (with-clojure-buffer "1 +(ns foo)" + (expect (clojure-find-ns) :to-equal "foo")) + (with-clojure-buffer "[1] +(ns foo)" + (expect (clojure-find-ns) :to-equal "foo")) + (with-clojure-buffer "[1] (ns foo)" + (expect (clojure-find-ns) :to-equal "foo")) + (with-clojure-buffer "[1](ns foo)" (expect (clojure-find-ns) :to-equal "foo")))) (describe "clojure-sort-ns" @@ -154,7 +171,7 @@ ;;[comment2] ))"))) (it "should sort requires in ns with copyright disclamer and comments" - (with-clojure-buffer ";; Copyright (c) John Doe. All rights reserved. + (with-clojure-buffer ";; Copyright (c) John Doe. All rights reserved. ;; The use and distribution terms for this software are covered by the ;; Eclipse Public License 1.0 (https://opensource.org/license/epl-1-0/) (ns clojure.core 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