All top-level def forms should have consistent font-lock

未关闭
#578 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
clojure, emacs-lisp

调研方向

首先检查现有的 clojure-mode font-lock 规则,以及它们如何为 def、defn、let 绑定和其他类似 def 的形式分配 face。确定顶层定义是否需要共享的 face,以及类似 def 的关键字是否需要自己的高亮类别;当所有示例中的行为和 face 层次结构保持一致时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

Some thoughts on syntax highlighting.

(def foo 42) ; font-lock-variable-name-face
(defn bar [x] x) ; font-lock-function-name-face

I think variable-name-face should be used for foo in (let [foo 42] ...), but not for foo in (def foo 42). Top-level definitions should use the same face, whether its a function or a 'variable'. It seems more logical, since if I want to make both "foo" and "bar" use the same bold and highly visible face (since both are top-level defs), then e.g. in my c code I get local variables and function arguments highlighted with the same face.

I guess the correct hierarchy would be: top-level-definition-face -> (function-face, var-face[1]). It would be nice to have a separate space for def-like keywords as well (so a user could highlight "defn", but not "do" or "let").

[1]: technically defn also creates a var; what's the best short name for a top-level definition that is not a function? Do we actually need/want this distinction at all? I don't really see how it's useful.

主要语言
Emacs Lisp
星标
1k
派生
249
平均合并
1 天 6 小时
30 天内合并 PR
6

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

clojure-emacs/clojure-mode 的其他 Issue

查看 clojure-emacs/clojure-mode 的全部 Issue

相似的 Issue

更多 DevTools Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。