Commit 8cbe9074 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(quail-update-leim-list-file):

Use insert-file-contents instead of find-file-noselect
and in the process avoid the RAWFILE feature.
parent 3e06294d
...@@ -1709,7 +1709,9 @@ This is a sub-directory of LEIM directory.") ...@@ -1709,7 +1709,9 @@ This is a sub-directory of LEIM directory.")
;;;###autoload ;;;###autoload
(defun quail-update-leim-list-file (dirname) (defun quail-update-leim-list-file (dirname)
"Update entries for Quail packages in LEIM list file of directory DIRNAME. "Update entries for Quail packages in LEIM list file of directory DIRNAME.
LEIM is a library of Emacs input method." LEIM is a directory containing Emacs input methods;
normally, it should specify the `leim' subdirectory
of the Emacs source tree."
(interactive "FDirectory of LEIM: ") (interactive "FDirectory of LEIM: ")
(setq dirname (file-name-as-directory (expand-file-name dirname))) (setq dirname (file-name-as-directory (expand-file-name dirname)))
(let ((quail-dir (concat dirname quail-directory-name)) (let ((quail-dir (concat dirname quail-directory-name))
...@@ -1756,9 +1758,8 @@ LEIM is a library of Emacs input method." ...@@ -1756,9 +1758,8 @@ LEIM is a library of Emacs input method."
;; Insert entries for Quail. ;; Insert entries for Quail.
(while pkg-list (while pkg-list
(message "Checking %s ..." (car pkg-list)) (message "Checking %s ..." (car pkg-list))
(setq pkg-buf (find-file-noselect (car pkg-list) t t)) (with-temp-buffer
(save-excursion (insert-file-contents (car pkg-list))
(set-buffer pkg-buf)
(goto-char (point-min)) (goto-char (point-min))
(while (search-forward "(quail-define-package" nil t) (while (search-forward "(quail-define-package" nil t)
(goto-char (match-beginning 0)) (goto-char (match-beginning 0))
...@@ -1768,7 +1769,8 @@ LEIM is a library of Emacs input method." ...@@ -1768,7 +1769,8 @@ LEIM is a library of Emacs input method."
(insert (format "(register-input-method (insert (format "(register-input-method
%S %S '%s %S %S '%s
%S %S %S %S
%S)\n" (nth 1 form) ; PACKAGE-NAME %S)\n"
(nth 1 form) ; PACKAGE-NAME
(nth 2 form) ; LANGUAGE (nth 2 form) ; LANGUAGE
'quail-use-package ; ACTIVATE-FUNC 'quail-use-package ; ACTIVATE-FUNC
(nth 3 form) ; PACKAGE-TITLE (nth 3 form) ; PACKAGE-TITLE
...@@ -1776,9 +1778,8 @@ LEIM is a library of Emacs input method." ...@@ -1776,9 +1778,8 @@ LEIM is a library of Emacs input method."
(string-match ".*" (nth 5 form)) (string-match ".*" (nth 5 form))
(match-string 0 (nth 5 form))) (match-string 0 (nth 5 form)))
(file-relative-name ; PACKAGE-FILENAME (file-relative-name ; PACKAGE-FILENAME
(file-name-sans-extension (car pkg-list)) dirname) (file-name-sans-extension (car pkg-list))
)))))) dirname)))))))
(kill-buffer pkg-buf)
(setq pkg-list (cdr pkg-list))) (setq pkg-list (cdr pkg-list)))
(save-excursion (save-excursion
(set-buffer list-buf) (set-buffer list-buf)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment