+2005-06-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * filename.el (filename-special-filter-1): New macro defined for
+ filename-special-filter to use aref instead of sref for the recent
+ Emacsen.
+ (filename-special-filter): Use it.
+
2005-06-05 Tatsuya Kinoshita <tats@vega.ocn.ne.jp>
* poe-xemacs.el: Load `timer' even if `timer-funcs' exists.
(let ((code (char-int character)))
(or (< code 32)(= code 127))))
+(eval-when-compile
+ (defmacro filename-special-filter-1 (string)
+ (let (sref inc-i)
+ (if (or (not (fboundp 'sref))
+ (>= emacs-major-version 21)
+ (and (= emacs-major-version 20)
+ (>= emacs-minor-version 3)))
+ (setq sref 'aref
+ inc-i '(1+ i))
+ (setq sref 'aref
+ inc-i '(+ i (char-length chr))))
+ (` (let* ((string (, string))
+ (len (length string))
+ (b 0)(i 0)
+ (dest ""))
+ (while (< i len)
+ (let ((chr ((, sref) string i))
+ (lst filename-replacement-alist)
+ ret)
+ (while (and lst (not ret))
+ (if (if (functionp (car (car lst)))
+ (setq ret (funcall (car (car lst)) chr))
+ (setq ret (memq chr (car (car lst)))))
+ t ; quit this loop.
+ (setq lst (cdr lst))))
+ (if ret
+ (setq dest (concat dest (substring string b i)
+ (cdr (car lst)))
+ i (, inc-i)
+ b i)
+ (setq i (, inc-i)))))
+ (concat dest (substring string b)))))))
+
(defun filename-special-filter (string)
- (let ((len (length string))
- (b 0)(i 0)
- (dest ""))
- (while (< i len)
- (let ((chr (sref string i))
- (lst filename-replacement-alist)
- ret)
- (while (and lst (not ret))
- (if (if (functionp (car (car lst)))
- (setq ret (funcall (car (car lst)) chr))
- (setq ret (memq chr (car (car lst)))))
- t ; quit this loop.
- (setq lst (cdr lst))))
- (if ret
- (setq dest (concat dest (substring string b i)(cdr (car lst)))
- i (+ i (char-length chr))
- b i)
- (setq i (+ i (char-length chr))))))
- (concat dest (substring string b))))
+ (filename-special-filter-1 string))
(defun filename-eliminate-top-low-lines (string)
(if (string-match "^_+" string)