相关疑难解决方法(0)

使用Emacs缩进(移位4)代码

我使用ViewSourceWith 和Emacs 编辑StackOverflow的答案和问题.通常,我包含代码和StackOverflow格式规则 ,说它必须缩进四个空格才能被识别.手动或甚至使用宏来做这件事都很痛苦.

我在之前的帖子中搜索过,但一无所获.

从Python模式开始,我写道:

(defun text-shift-region (start end count)
  "Indent lines from START to END by COUNT spaces."
  (save-excursion
(goto-char end)
(beginning-of-line)
(setq end (point))
(goto-char start)
(beginning-of-line)
(setq start (point))
(indent-rigidly start end count)))

(defun text-shift-region-right (start end &optional count)
  "Shift region of code to the right
   Stolen from python-mode.
   The lines from the line containing the start of the current region up
   to (but not including) the line containing the end of the region …
Run Code Online (Sandbox Code Playgroud)

emacs elisp

13
推荐指数
3
解决办法
3339
查看次数

标签 统计

elisp ×1

emacs ×1