clojure-emacs / clojure-emacs/clj-refactor.el

`clean ns` removes referred Greek letter symbols

Open
#451 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
785
Forks
110
PR merge metrics
No merged PRs in 30d

Description

## Issue

If I refer to symbols consisting of Greek letters in the `ns` declaration `clj-refactor` removes them when doing `clean ns` or `add missing libspec`.

## Expected behavior

Symbols in non-Latin scripts (in the example below: Greek and Danish) treated the same as those consisting of letters from ASCII.

## Actual behavior

The symbols are removed from `:refer` part of the libspec.

## Steps to reproduce the problem

`src/ns1.clj`:

```
(ns ns1)

(def A inc)
(def Γ inc)
(def Å inc)
```

`src/ns2.clj`:

```
(ns ns2
(:require [ns1 :refer [A Γ Å]]))

(defn myfun []
(+ (A 1) (Γ 2) (Å 3)))
```

The `Γ` and `Å` are code points `#x393` and `#xc5` respectively.

After evaluating `cljr-clean-ns` in buffer `ns2.clj` the buffer contains

```
(ns ns2
(:require [ns1 :refer [A]]))

(defn myfun []
(+ (A 1) (Γ 2) (Å 3)))
```
which will not compile.

## Environment & Version information

### clj-refactor.el version information

```
clj-refactor 2.5.0-SNAPSHOT (package: 20190618.716), refactor-nrepl 2.5.0-SNAPSHOT
```
### CIDER version information

```
;; CIDER 0.24.0snapshot (package: 20191103.1528), nREPL 0.6.0
;; Clojure 1.10.1, Java 1.8.0_192
```

### Leiningen or Boot version

```
Leiningen 2.9.0 on Java 1.8.0_192 OpenJDK 64-Bit Server VM
```
### Emacs version

```
GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.7.0, Carbon Version 158 AppKit 1671.6) of 2019-10-04
```

### Operating system

```
Darwin locke.local 19.0.0 Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64 x86_64
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.