Changeset 4030
- Timestamp:
- 2006年02月03日 17時46分43秒 (3 years ago)
- Files:
-
- trunk/lisp/ChangeLog.Meadow (modified) (1 diff)
- trunk/lisp/international/mw32script.el (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/ChangeLog.Meadow
r4028 r4030 1 2006-02-03 Hideyuki SHIRAI <shirai@meadowy.org> 2 3 * international/mw32script.el 4 (mw32script-file-executable-p): Add dos-string. 5 (mw32script-original-executable-find): New variable. 6 (mw32script-executable-find): New function. 7 (mw32script-init): Substitute `executable-find' to 8 `mw32script-executable-find' and tiny fix. 9 1 10 2006-02-03 Masayuki FUJII <boochang@m4.kcn.ne.jp> 2 11 trunk/lisp/international/mw32script.el
r4028 r4030 35 35 (defvar mw32script-recursive nil) 36 36 (defvar mw32script-original-file-executable-p nil) 37 (defvar mw32script-original-executable-find nil) 37 38 ;; end --- options 38 39 (defvar mw32script-bufsiz 256) … … 174 175 175 176 (defun mw32script-file-executable-p (filename) 177 "Return t if filename can be executed by you. 178 For a directory, this means you can access files in that directory. 179 180 Add an analytical capability of the script file to this function by Meadow." 176 181 (or (funcall mw32script-original-file-executable-p filename) 177 182 (and (mw32script-resolve-script filename) 178 183 t))) 184 185 (defun mw32script-executable-find (command) 186 "Search for command in `exec-path' and return the absolute file name. 187 Return nil if command is not found anywhere in `exec-path'. 188 189 Add an analytical capability of the script file to this function by Meadow." 190 (catch 'detect 191 (let ((paths exec-path) 192 (suffixes exec-suffixes) 193 cmds names path file) 194 (while suffixes 195 (setq cmds (cons (concat command (car suffixes)) cmds)) 196 (setq suffixes (cdr suffixes))) 197 (setq cmds (nreverse cmds)) 198 (while (setq path (car paths)) 199 (setq paths (cdr paths)) 200 (setq names cmds) 201 (while names 202 (setq file (locate-file-internal (car names) (list path))) 203 (when (and file 204 (not (file-directory-p file)) 205 (mw32script-file-executable-p file)) 206 (throw 'detect file)) 207 (setq names (cdr names))))))) 179 208 180 209 (defun mw32script-init () … … 185 214 (function mw32script-argument-editing-function) 'last) 186 215 (add-to-list 'exec-suffix-list "") 187 (if (not mw32script-original-file-executable-p) 188 (progn 189 (setq mw32script-original-file-executable-p 190 (symbol-function 'file-executable-p)) 191 (fset 'file-executable-p 192 (symbol-function 'mw32script-file-executable-p))))) 216 (unless mw32script-original-file-executable-p 217 (setq mw32script-original-file-executable-p 218 (symbol-function 'file-executable-p)) 219 (fset 'file-executable-p 'mw32script-file-executable-p)) 220 (unless mw32script-original-executable-find 221 (setq mw32script-original-executable-find 222 (symbol-function 'executable-find)) 223 (fset 'executable-find 'mw32script-executable-find))) 193 224 194 225 (provide 'mw32script)
