X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fsubr.el;h=94a607141ce2c9a6895e85cd43155704beccbf50;hb=19f3d076b847b61fae1f8313d588207cc0d41ab0;hp=6a49cff64abe5980037cfd3d43aa4fa96abf3fe0;hpb=976b002b16336930724ae22476014583ad022e7d;p=chise%2Fxemacs-chise.git diff --git a/lisp/subr.el b/lisp/subr.el index 6a49cff..94a6071 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -294,10 +294,14 @@ Otherwise treat \\ in NEWTEXT string as special: If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." (or pattern (setq pattern "[ \f\t\n\r\v]+")) - ;; The FSF version of this function takes care not to cons in case - ;; of infloop. Maybe we should synch? - (let (parts (start 0)) - (while (string-match pattern string start) + (let (parts (start 0) (len (length string))) + (if (string-match pattern string) + (setq parts (cons (substring string 0 (match-beginning 0)) parts) + start (match-end 0))) + (while (and (< start len) + (string-match pattern string (if (> start (match-beginning 0)) + start + (1+ start)))) (setq parts (cons (substring string start (match-beginning 0)) parts) start (match-end 0))) (nreverse (cons (substring string start) parts)))) @@ -678,6 +682,16 @@ FILE should be the name of a library, with no directory name." (eval-after-load file (read))) (make-compatible 'eval-next-after-load "") +(unless (featurep 'mule) + (defun make-char (charset &optional arg1 arg2) + "Make a character from CHARSET and octets ARG1 and ARG2. +This function is available for compatibility with Mule-enabled XEmacsen. +When CHARSET is `ascii', return (int-char ARG1). Otherwise, return +that value with the high bit set. ARG2 is always ignored." + (int-char (if (eq charset 'ascii) + arg1 + (logior arg1 #x80))))) + ; alternate names (not obsolete) (if (not (fboundp 'mod)) (define-function 'mod '%)) (define-function 'move-marker 'set-marker)