나는이 기능을 사용합니다.
(defun my-sort-lines ()
(interactive)
(shell-command-on-region (point-min) (point-max) "LC_COLLATE=en_US.UTF-8 sort" (buffer-name) t ))
편집 : 영역 또는 버퍼를 정렬하려면 :
(defun my-sort-lines-buffer ()
(interactive)
(shell-command-on-region (point-min) (point-max) "LC_COLLATE=en_US.UTF-8 sort" (buffer-name) t ))
(defun my-sort-lines-region (start end)
(interactive "r")
(shell-command-on-region start end "LC_COLLATE=en_US.UTF-8 sort" (buffer-name) t))
(defun my-sort-lines-region-or-buffer ()
(interactive)
(save-excursion
(if (region-active-p)
(progn
(my-sort-lines-region (region-beginning) (region-end))
(message "Sorted selected region"))
(progn
(my-sort-lines-buffer)
(message "Sorted buffer")))))
isearch
하고query-replace
이맥스의 다음 버전에서.