포인트가 실용적인 끝점인지 테스트하기위한 루틴을 작성하고 있습니다.Elisp 함수가 올바른 값 대신 표시를 반환 함
(defun end-of-line-p()
"T if there is only \w* between point and end of line"
(interactive)
(save-excursion
(set-mark-command nil) ;mark where we are
(move-end-of-line nil) ;move to the end of the line
(let ((str (buffer-substring (mark) (point)))) ;; does any non-ws text exist in the region? return false
(if (string-match-p "\W*" str)
t
nil))))
문제는 실행시 T 또는 nil 대신에 미니 패드 창에 "마크 세트"가 표시된다는 것입니다.
이맥스, 프로그래밍 팁을 LISP 잘못된 목적. 자세한 내용은'set-mark '문서를 참조하십시오. –