小编Tom*_*oft的帖子

Emacs:设置和切换show-trailing-whitespace

在linux上使用emacs 23.3.1的两个相关问题:

首先,为什么不能我的值设置show-trailing-whitespacetsetq如下图所示?当我把setq版本放在我的版本中.emacs它不会改变值(从功能和使用中看到M-x describe-variable).

(setq show-trailing-whitespace t)  ; Does not change variable value or give error

(custom-set-variables              ; Sets show-trailing-whitespace as expected
 '(show-trailing-whitespace t))
Run Code Online (Sandbox Code Playgroud)

其次,我怎么可以切换之间的价值tnil?我认为这个答案正是我所需要的,但在这种情况下它不起作用.我用了:

(global-set-key "\M-ow" 'tf-toggle-show-trailing-whitespace)

(defun tf-toggle-show-trailing-whitespace ()
    "Toggle show-trailing-whitespace between t and nil"
    (interactive)
    (setq show-trailing-whitespace (if (= show-trailing-whitespace nil) t nil))
    (redraw-display))
Run Code Online (Sandbox Code Playgroud)

当我点击时M-ow我得到一个错误Wront type argument: number-or-marker-p, nil.有任何想法吗?

emacs

11
推荐指数
1
解决办法
5606
查看次数

动态函数docstring

我想编写一个具有动态创建的文档字符串的python函数.本质上对于一个函数func()我想func.__doc__成为一个调用自定义__get__函数的描述符,根据请求创建docstring.然后help(func)应该返回动态生成的docstring.

这里的上下文是在现有的分析包中编写一个包含大量命令行工具的python包.每个工具都成为一个类似命名的模块函数(通过函数工厂创建并插入到模块命名空间中),通过分析包动态生成函数文档和接口参数.

python

10
推荐指数
1
解决办法
5804
查看次数

标签 统计

emacs ×1

python ×1