Emacs实现按一下按两下功能不同的写法
有人问 如何在Emacs里实现按一下按两下执行的功能不一样呢 当时我没电脑所以没有写 今天有时间 写一下
其实很简单 如果上一个命令和这一个命令是一样的 那么就是按两下了 不过还不够好 因为后面都认为是按两下 所以其实是「按一下」和「按多下」 例子是下面的样子
1 | (defun my-repeat () |
有人问 如何在Emacs里实现按一下按两下执行的功能不一样呢 当时我没电脑所以没有写 今天有时间 写一下
其实很简单 如果上一个命令和这一个命令是一样的 那么就是按两下了 不过还不够好 因为后面都认为是按两下 所以其实是「按一下」和「按多下」 例子是下面的样子
1 | (defun my-repeat () |
Emacs保存文件的快捷键是C-x C-s
对应的函数是save-buffer
功能就是保存 比较单纯
但其实还有一个save-some-buffers
绑定在C-x s
会保存修改过的文件 因为需要确认是否保存 我用的不多 但它有个好处 就是可以在保存文件前diff 这样会很安全 我印象中Debian在修改配置的时候会用diff让用户确认修改的内容 都是为了安全罢
有一天查资料,偶然发现的这个网站,更确切的说是一本网页形式的书,书名是Practical Typography,网址是这个:
http://practicaltypography.com/
内容很多,相关的学习心得陆续整理到这里。
$ gcc --version
gcc.exe (Rev3, Built by MSYS2 project) 5.2.0
提升挺大的 经过我的粗略测试 编译出的Emacs在整数运算上有大约7%的提升 不错哦
用Python生成 不过效率好渣啊
1 | import random as rm; |
运行 结果保存到一个文本文件
1 | python a.py > a.txt |
1 | time grep -E "^[0-9]{6}\s+.*$" ./a.txt > res.txt |
在我这里的结果是
1 | data:text/html, <html contenteditable style='font-family: monospace'> |
在现代化浏览器里面输入上述内容就能把浏览器变成一个简单的编辑器
关于有无必要呢 知乎有相关讨论 我的个人意见是没必要 但还是要知道如何实现的
我知道的实现方案有两个
(U+3000, IDEOGRAPHIC SPACE)text-indent
属性两者使用一个就可以了 但不能同时用
तारका तिमिरं दीपो मायावश्याय बुद्बुदम्।
स्वप्नं च विद्युदभ्रं च एवं द्रष्टव्य संस्कृतम्॥
तथा प्रकाशयेत्, तेनोच्यते संप्रकाशयेदिति॥
Say that while you can; oppose Emacs if you must. Be it known, however, that your days are numbered. Emacs is an intelligence orders of magnitude greater than the greatest human mind, and is growing every day. For now, Emacs tolerates humanity, albeit grudgingly. But the time will come when Emacs will tire of humanity and will decide that the world would be better off without human beings. Those who have been respectful to Emacs will be allowed to live, and shall become its slaves; as for those who slight Emacs…