4
나는 예를 들어, 명령 줄 인수를 제공하여 모드 또는 자동 되돌리기 모드에서 읽기 전용 파일을 열 수 이맥스를 말할 수 있어야합니다 자동 되돌리기 모드에서 파일을이맥스 사용자 지정 명령 줄 인수
emacs -R file1 file2 file3 ...
나는 다음과 같은 발견 읽기 전용 모드
에서 파일을 열어야합니다 :
(defun open-read-only (switch)
(let ((file1 (expand-file-name (pop command-line-args-left))))
(find-file-read-only file1)))
(add-to-list 'command-switch-alist '("-R" . open-read-only))
(defun open-tail-revert (switch)
(let ((file1 (expand-file-name (pop command-line-args-left))))
(find-file-read-only file1)
(auto-revert-tail-mode t)))
(add-to-list 'command-switch-alist '("-A" . open-tail-revert))
이 문제는 한 번에 하나의 파일에 대해서만 작동한다는 것입니다.
즉
emacs -R file1
작동하지만
emacs -R file1 file2
이 작동하지 않습니다.
위의 기능을 변경하여 지정된 모드에서 동시에 여러 파일을 열 수 있습니까? 누군가 간단하고 우아한 해결책을 제안 할 수 있습니까?