Mercurial > hg > xemacs-beta
comparison lisp/w3/w3-sysdp.el @ 122:d2f30a177268 r20-1b14
Import from CVS: tag r20-1b14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:26:03 +0200 |
parents | 8619ce7e4c50 |
children | b980b6286996 |
comparison
equal
deleted
inserted
replaced
121:419db647c998 | 122:d2f30a177268 |
---|---|
992 | 992 |
993 ;; Misc. | 993 ;; Misc. |
994 ;; NT doesn't have make-symbolic-link | 994 ;; NT doesn't have make-symbolic-link |
995 (sysdep-defalias 'make-symbolic-link 'copy-file) | 995 (sysdep-defalias 'make-symbolic-link 'copy-file) |
996 | 996 |
997 (sysdep-defun run-hook-with-args-until-success (hook &rest args) | |
998 "Run HOOK with the specified arguments ARGS. | |
999 HOOK should be a symbol, a hook variable. Its value should | |
1000 be a list of functions. We call those functions, one by one, | |
1001 passing arguments ARGS to each of them, until one of them | |
1002 returns a non-nil value. Then we return that value. | |
1003 If all the functions return nil, we return nil." | |
1004 (let ((rval nil) | |
1005 (todo (and (boundp hook) (symbol-value hook))) | |
1006 (global (and (boundp hook) (default-value hook))) | |
1007 (cur nil)) | |
1008 (while (and (setq cur (car todo)) (not rval)) | |
1009 (setq todo (cdr todo)) | |
1010 (if (eq cur t) | |
1011 (if global | |
1012 (setq todo (append global todo))) | |
1013 (setq rval (apply cur args)))))) | |
1014 | |
997 (sysdep-defun split-string (string pattern) | 1015 (sysdep-defun split-string (string pattern) |
998 "Return a list of substrings of STRING which are separated by PATTERN." | 1016 "Return a list of substrings of STRING which are separated by PATTERN." |
999 (let (parts (start 0)) | 1017 (let (parts (start 0)) |
1000 (while (string-match pattern string start) | 1018 (while (string-match pattern string start) |
1001 (setq parts (cons (substring string start (match-beginning 0)) parts) | 1019 (setq parts (cons (substring string start (match-beginning 0)) parts) |