Mercurial > hg > xemacs-beta
comparison lisp/iso8859-1.el @ 5321:57a64ab2ae45
Implement some basic Lisp functions in terms of Common Lisp builtins.
2010-12-30 Aidan Kehoe <kehoea@parhasard.net>
* simple.el (assoc-ignore-case): Remove a duplicate definition of
this function (it's already in subr.el).
* iso8859-1.el (char-width):
On non-Mule, make this function equivalent to that produced by
(constantly 1), but preserve its docstring.
* subr.el (subst-char-in-string): Define this in terms of
#'substitute, #'nsubstitute.
(string-width): Define this using #'reduce and #'char-width.
(char-width): Give this a simpler definition, it makes far more
sense to check for mule at load time and redefine, as we do in
iso8859-1.el.
(store-substring): Implement this in terms of #'replace, now
#'replace is cheap.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 30 Dec 2010 01:00:40 +0000 |
parents | 0cee1ff42db4 |
children | 6506fcb40fcf |
comparison
equal
deleted
inserted
replaced
5320:31be2a3d121d | 5321:57a64ab2ae45 |
---|---|
82 | 82 |
83 ;; Everything Latin-1 and above should be displayed as its character value | 83 ;; Everything Latin-1 and above should be displayed as its character value |
84 ;; by default. | 84 ;; by default. |
85 (setq-default ctl-arrow #xA0) | 85 (setq-default ctl-arrow #xA0) |
86 | 86 |
87 (when (and (compiled-function-p (symbol-function 'char-width)) | |
88 (not (featurep 'mule))) | |
89 (defalias 'char-width | |
90 (let ((constantly (constantly 1))) | |
91 (make-byte-code (compiled-function-arglist constantly) | |
92 (compiled-function-instructions constantly) | |
93 (compiled-function-constants constantly) | |
94 (compiled-function-stack-depth constantly) | |
95 (compiled-function-doc-string | |
96 (symbol-function 'char-width)))))) | |
97 | |
87 ;; Shouldn't be necessary, but one file in the packages uses it: | 98 ;; Shouldn't be necessary, but one file in the packages uses it: |
88 (provide 'iso8859-1) | 99 (provide 'iso8859-1) |
89 | 100 |
90 ;;; iso8859-1.el ends here | 101 ;;; iso8859-1.el ends here |