0
我在emacs中使用actionscript-mode,在這裏找到http://www.emacswiki.org/emacs/ActionScriptMode。我想修改它。問題在於TAB命令的行爲。我關心的是光標位於已包含代碼的行的第一列。 emacs中的大多數代碼編輯模式通過(1)執行縮進計算和調整以及(2)將光標前移到第一個非空白字符來處理這種情況。出於某種原因,動作模式確實是(1)而不是(2)。我如何修改它?我知道一點emacs-lisp,但不足以遵循代碼。我沒有要發佈整個動作-mode.el,但有可能會在本節的線索:emacs lisp(elisp):在actionscript-mode中修改indent-for-tab-command
(defun actionscript-indent-line()
"Indent current line of As3 code. Delete any trailing
whitespace. Keep point at same relative point in the line."
(interactive)
(save-excursion
(end-of-line)
(delete-horizontal-space))
(let ((old-pos (point)))
(back-to-indentation)
(let ((delta (- old-pos (point)))
(col (max 0 (as3-calculate-indentation))))
(indent-line-to col)
(forward-char delta))))
這裏的評論說:「一直點在該行相同的相對點。」也許我可以關掉那部分。