如何在emacs缓冲区中编写固定注释,尊重模式?


1

我想写一个小函数来输入一个固定的注释字符串,如下面的新行,尊重模式,例如在elisp中我希望它写

;; this is a comment

在下一行; 并且CI希望它写

/* this is a comment */

在下一行,依此类推。这个怎么做?也许comment-dwim很有用,但我不知道怎么做。谢谢。

Answers:


2

是的,你可以使用comment-dwim

(defun this-is-a-comment()
  (互动)
  (移动结束为零)
  (新队)
  (评论-dwim nil)
  (插入“这是评论”))
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.