问题标签 [font-lock]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
emacs - Emacs 字体锁定突出怪异
我有更改默认颜色主题的代码。我更喜欢这种方式,因为我添加了更多的类然后 default font-lock
。
奇怪的是评论颜色变成了灰色,但函数的名称没有变成紫色。有什么区别,我应该尝试检查什么?
regex - 找出哪个正则表达式导致 Emacs 中的特定面孔
我试图找出哪个正则表达式导致在此缓冲区connect
中突出显示。告诉我这是一个. 看了之后,我看不出这个亮点可能来自哪里。五颜六色的花环是由.cperl-mode
describe-face
font-lock-type-face
font-lock-keywords-alist
font-lock-keywords
rainbow-delimiters-mode
是否有检查哪个正则表达式匹配的功能,以便用这张脸突出显示连接?
emacs - emacs 中的上下文相关字体锁定
基本上,我试图以我想要的方式突出显示以下咖啡脚本代码。可以在这里找到咖啡脚本函数的语法解释。
名称 tstamp、moo 和 boo 应该是粉红色的(没有别的,不是逗号,也不是括号),因为它们是 lambda 函数的参数。
这里是第一个 x 是参数。参数可以有默认参数:
默认参数本身可以是变量:
somsg
和color
above 应该突出显示,但不是defColor
. 一个更棘手的情况是带有默认参数的函数,它们本身就是函数。我认为 emacs 的 font-lock 很难正确突出显示,但我还是把它包括在内:
这似乎在 emacs 中实现起来相当复杂,因为您希望突出显示是上下文敏感的。我已经阅读了有关 font-lock 的文档,但无法弄清楚。
如果有人能告诉我要设置什么以font-lock-defaults
使其语法突出显示我想要的方式,我将不胜感激。
更新显示更多咖啡脚本语法示例。
emacs - EMACS,函数调用高亮
(EMACS 24.2) 我需要突出显示函数调用。我在网上找到了这个
它有效,但它也突出显示以下左括号。我对正则表达式没有信心,请问如何修改匹配字符串以避免括号突出显示?
regex - 如何修复 emacs 中未成功匹配的字体锁定正则表达式
我正在尝试在 emacs 中创建一个正则表达式来锁定任务文件中的任务、项目和注释。
Taskpaper 是一种简单的基于文本的任务管理格式,格式如下:
我正在使用我在这里找到的任务纸模式作为基础(https://github.com/jedthehumanoid/taskpaper.el/blob/master/taskpaper.el)。但是,这种模式是基于空格缩进的,目前看来,任务纸格式使用制表符来缩进。
目前,第三个正则表达式(应该在评论面上锁定注释)不起作用,我不明白为什么。注释是所有不以 a 开头-
且不以 a 结尾的任何缩进的行:
奇怪的是,在正则表达式生成器中,正则表达式^[\t]*[^-\t].*[^:]$
成功匹配注释行。
我已经尝试按照其他一些问题的建议对 \t 字符(如 \\t)进行双重转义,但这似乎没有什么区别。
emacs - latex-mode / font-lock: any way to obtain more than three (3) levels of highlighting?
With latex-mode, is there any way to obtain more than three (3) levels of highlighting?
I would like to control more than three levels of highlighting, however, it appears as though latex-mode may be limited to three (3) levels. I say this because Emacs complains when attempting a fourth level -- Error during redisplay: (jit-lock-function 1) signaled (wrong-type-argument listp prepend)
. The following is just an example of an attempt to control four (4) levels, which gave the error message listed above.
I tried adding (setq font-lock-support-mode 'lazy-lock-mode)
, which caused a freeze. I also tried adding (setq font-lock-maximum-decoration t)
, which didn't seem to have any appreciable effect.
python - python程序的emacs语法高亮问题
我正在使用python-mode
语法突出显示。一切都很好,除了突出显示文档字符串,这使得在 github 存储库中阅读具有复杂文档字符串的代码非常困难。这里有一个例子:
以及您看到它未正确突出显示的相应屏幕截图:
当然这是一个简单的例子。充满此类突出显示错误的复杂文档字符串是完全不可读的。
有解决方案吗?
编辑:有趣的是,stackoverflow 突出显示也有这个问题。
emacs - strange issue for python syntax highlight in emacs
I configured my Emacs 24.3 under Windows for python using the python.el that comes with Emacs 24.3, following is my snippet for python IDE configuration in init.el
it works fine, but I got strange problem for the syntax highlighting as shown in the picture. some of the variables on the left are highlighted as red, and some are not highlighted... what's wrong there?
emacs - Elm Markdown 块突出显示
是否有现成的解决方案可以突出显示[markdown| ... |]
Elm 代码中的块?
目前我正在使用haskell-mode
编辑 Elm 文件,并two-mode-mode
连接到markdown-mode
当我输入适当的块时切换到
理想情况下,会有一个解决方案,只在同一个缓冲区中一次突出显示所有内容,将适当的区域保留在 中,但设置起来markdown-mode
并不像看起来那么复杂。
emacs - emacs中源代码的结构视图
有时我会在不同的结构级别对我的代码进行评论,例如以下 python 代码:
我想为不同级别的评论设置不同的字体大小(或稍微不同的颜色),是否有这样的包来做这样的事情?另外,例如对于 elisp 代码,我通常使用不同数量的标题字符向不同级别添加注释;
,例如:
如果我可以使用不同的面孔显示不同级别的评论,那将极大地有助于查看和理解我的代码结构。谢谢!