diff options
author | João Távora <joaotavora@gmail.com> | 2021-10-02 00:49:48 +0100 |
---|---|---|
committer | João Távora <joaotavora@gmail.com> | 2021-10-02 01:43:16 +0100 |
commit | 9307889d68222bad1a7e449d3adddac40da788cc (patch) | |
tree | ead3d91bf099336508a980313d32666738fd1e1e /lisp/international/mule.el | |
parent | 5c77cc958451b3bc9ddb6752be1d32f50cba3e41 (diff) | |
download | emacs-9307889d68222bad1a7e449d3adddac40da788cc.tar.gz emacs-9307889d68222bad1a7e449d3adddac40da788cc.tar.bz2 emacs-9307889d68222bad1a7e449d3adddac40da788cc.zip |
Simplify shorthand injection (bug#50946)
* lisp/loadup.el: Load "shorthands" relatively late. Set
load-source-file-function to load-with-shorthands-and-code-conversion
* lisp/international/mule.el (hack-elisp-shorthands)
(load-with-shorthands-and-code-conversion): Move to
lisp/shorthands.el
* lisp/shorthands.el: New file.
Diffstat (limited to 'lisp/international/mule.el')
-rw-r--r-- | lisp/international/mule.el | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 2298af42b28..2a855b56736 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -294,31 +294,6 @@ attribute." (apply 'define-charset-internal name (mapcar 'cdr attrs)))) -(defun hack-elisp-shorthands (fullname) - "Return value of the `elisp-shorthands' file-local variable in FULLNAME. -FULLNAME is the absolute file name of an Elisp .el file which -potentially specifies a file-local value for `elisp-shorthands'. -The Elisp code in FULLNAME isn't read or evaluated in any way, except -for extraction of the buffer-local value of `elisp-shorthands'." - (let ((size (nth 7 (file-attributes fullname)))) - (with-temp-buffer - (insert-file-contents fullname nil (max 0 (- size 3000)) size) - (goto-char (point-max)) - (let* ((found (search-backward-regexp "elisp-shorthands:[ \t]*" 0 t)) - (val (and found - (goto-char (match-end 0)) - (ignore-errors (read (current-buffer))))) - (probe val) - aux) - (catch 'done - (when (consp probe) - (while (setq aux (pop probe)) - (unless (and (consp aux) - (stringp (car aux)) - (stringp (cdr aux))) - (throw 'done nil))) - val)))))) - (defun load-with-code-conversion (fullname file &optional noerror nomessage) "Execute a file of Lisp code named FILE whose absolute name is FULLNAME. The file contents are decoded before evaluation if necessary. @@ -378,13 +353,6 @@ Return t if file exists." (message "Loading %s...done" file))) t))) -(defun load-with-shorthands-and-code-conversion (fullname file noerror nomessage) - "Like `load-with-code-conversion', but also consider Elisp shorthands. -This function uses shorthands defined in the file FULLNAME's local -value of `elisp-shorthands', when it processes that file's Elisp code." - (let ((elisp-shorthands (hack-elisp-shorthands fullname))) - (load-with-code-conversion fullname file noerror nomessage))) - (defun charset-info (charset) "Return a vector of information of CHARSET. This function is provided for backward compatibility. |