<2022-08-18 周四>
边读Emacs Lisp Intro边做题(一)
打开emacs,按C-h i打开Info页,找到Emacs Lisp Intro。我做了几个练习题,觉得应该把它记录在笔记中,如下:

说明,对照上图,以后函数的名称以章节编号,比如下面的函数名为exercise-5.5,函数的注释为题目的英文描述,如下:
(defun exercise-5.5 (&optional arg)
"Write an interactive function with an optional argument that tests
whether its argument, a number, is greater than or equal to, or else,
less than the value of ‘fill-column’, and tells you which, in a message.
However, if you do not pass an argument to the function, use 56 as a
default value."
(interactive "p")
(or (numberp arg)
(setq arg '56))
(if (</

本文介绍了如何在EmacsLisp中实践练习题,包括编写带有可选参数的测试函数、显示缓冲区前60字符、搜索字符串和处理kill环等交互式功能。
最低0.47元/天 解锁文章
406

被折叠的 条评论
为什么被折叠?



