在Emacs Lisp中,如果您在一个变量中存储了缓冲区位置,那么如何找到它所在的列?
Trey已经解决了这个问题(虽然我个人没有尝试过),但是这里有一些我写的代码可以实现它。
(defun calculate-column (point)
(save-excursion
(goto-char point)
(beginning-of-line)
(- point (point))))
current-column
了,为什么还要自己计算呢?你只会忘记所有特殊情况,比如制表符。 - nschum
line-number-at-pos
相对应的column-number-at-pos
函数? - wdkrnls