Suggestion - add additional characters to syntax table to support evil mode word motions
還沒有人認領這個 Issue。
評估
研究方向
定位 clojure-mode-syntax-table,並先檢視其中現有的單字語法項目。使用 this-symbol?! 重現 Evil-mode 的 w 和 W 行為,並將其與提議的 Clojure 符號字元進行比較,包括 #、/、: 和 .. 當單字移動能一致地處理預期字元,且不會錯誤地吸收周圍的方括號時,即視為完成。
由索引模型根據 Issue 內容生成。
描述
Expected behavior
in evil mode w motion should work on clojure symbols for example: this-symbol?!
Actual behavior
currently the motion will only include 'this' - i.e up to to the hyphen.
Steps to reproduce the problem
std doom-emacs with clojure mode
Environment & Version information
clojure-mode version
clojure-mode (version 5.16.0)
Emacs version
GNU emascs 27.1
Operating system
Linux 5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Suggested change
I am not too familiar with emacs lisp or the clojure mode so this is just a suggestion - it has worked for me in my local configs.
add the following extensions to the word syntax definitions in the clojure-mode-syntax-table (there may be a more compact way of expressing that but I am not familiar with required syntax).
you may or may not want to include the # character. I found it useful and it is accepted in symbols
I am not certain how/if to this should be changed where a character is not allowed as the first char of a word....
I note also that motions like yW are a problem because they pick up brackets when at the end of an expression. So I also included # / : and . because these are useful. There may be a better way to include these...
;; word syntax: add clojure symbol characters
;; as per https://clojure.org/reference/reader
(modify-syntax-entry ?* "w" table)
(modify-syntax-entry ?+ "w" table)
(modify-syntax-entry ?! "w" table)
(modify-syntax-entry ?- "w" table)
(modify-syntax-entry ?_ "w" table)
(modify-syntax-entry ?' "w" table)
(modify-syntax-entry ?? "w" table)
(modify-syntax-entry ?< "w" table)
(modify-syntax-entry ?> "w" table)
;; word-syntax: and other characters that
;; are useful in word motions
(modify-syntax-entry ?# "w" table)
(modify-syntax-entry ?/ "w" table)
(modify-syntax-entry ?: "w" table)
(modify-syntax-entry ?. "w" table)
- 主要語言
- Emacs Lisp
- 星號
- 1k
- 分支
- 249
- 平均合併
- 1 天 6 小時
- 30 天內合併 PR
- 6
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
clojure-emacs/clojure-mode 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 35/100
clojure-emacs/clojure-mode#699 ·
-
難度 4/5 3-5 天 新手友好度 35/100
clojure-emacs/clojure-mode#660 · 5 則留言 ·
-
bug help wanted indentation
難度 3/5 1-2 天 新手友好度 42/100
clojure-emacs/clojure-mode#620 ·
-
難度 3/5 1-2 天 新手友好度 45/100
clojure-emacs/clojure-mode#613 · 1 個 reaction ·
-
Indent very slow未關閉help wanted indentation
難度 4/5 3-5 天 新手友好度 35/100
clojure-emacs/clojure-mode#606 · 6 則留言 ·
查看 clojure-emacs/clojure-mode 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 72/100
pathintegral-institute/mcpm.sh#568 ·
維護者通常 21 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
georgestephanis/diff-leppard#46 ·
維護者通常 1 天內回覆
-
area: dry-run good first issue
難度 2/5 1-3 小時 新手友好度 75/100
srikar-kompella/ottl-lens#12 ·
-
難度 1/5 1 小時以內 新手友好度 88/100
py-econometrics/pyfixest#2114 ·
維護者通常 1 天內回覆
-
enhancement good first issue help wanted
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 2 天內回覆