2004-10-03 05:13:30 -04:00
|
|
|
;;directory-files
|
|
|
|
;;---------------
|
|
|
|
|
2004-10-14 07:58:20 -04:00
|
|
|
;;Basically the result-object of this command is only a wrapper for a
|
|
|
|
;;"browse-dir-list"-object. The messages are simply handed over
|
2004-10-03 05:13:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-10-14 07:58:20 -04:00
|
|
|
(define-record-type dirfiles-res-obj dirfiles-res-obj
|
|
|
|
(make-dirfiles-res-obj browse-obj)
|
|
|
|
dirfiles-res-obj?
|
|
|
|
(browse-obj dirfiles-res-obj-browse-obj))
|
|
|
|
|
|
|
|
|
2004-10-03 05:13:30 -04:00
|
|
|
|
|
|
|
(define dir-files-receiver
|
2004-10-14 07:58:20 -04:00
|
|
|
(lambda (message)
|
|
|
|
(cond
|
2004-10-03 05:13:30 -04:00
|
|
|
((next-command-message? message)
|
2004-10-14 07:58:20 -04:00
|
|
|
(let* ((width (next-command-message-width message))
|
|
|
|
(browse-next-command-message
|
|
|
|
(make-next-command-message "browse-dir-list"
|
|
|
|
'("(directory-files)" "(cwd)")
|
|
|
|
width)))
|
|
|
|
|
|
|
|
(make-dirfiles-res-obj (browse-dir-list-receiver
|
|
|
|
browse-next-command-message))))
|
2004-10-03 05:13:30 -04:00
|
|
|
((print-message? message)
|
2005-05-20 11:20:34 -04:00
|
|
|
(let* ((model (message-result-object message))
|
2004-10-14 07:58:20 -04:00
|
|
|
(width (print-message-width message))
|
|
|
|
(browser (dirfiles-res-obj-browse-obj model))
|
|
|
|
(browse-print-message
|
|
|
|
(make-print-message "browse-dir-list"
|
|
|
|
browser
|
|
|
|
width)))
|
|
|
|
(browse-dir-list-receiver browse-print-message)))
|
2004-10-03 05:13:30 -04:00
|
|
|
((key-pressed-message? message)
|
2005-05-20 11:20:34 -04:00
|
|
|
(let* ((model (message-result-object message))
|
2004-10-14 07:58:20 -04:00
|
|
|
(key (key-pressed-message-key message))
|
|
|
|
(browser (dirfiles-res-obj-browse-obj model))
|
|
|
|
(browse-key-message
|
|
|
|
(make-key-pressed-message "browse-dir-list"
|
|
|
|
browser
|
|
|
|
key)))
|
|
|
|
(make-dirfiles-res-obj (browse-dir-list-receiver
|
|
|
|
browse-key-message))))
|
|
|
|
|
2004-10-03 05:13:30 -04:00
|
|
|
((restore-message? message)
|
2005-05-20 11:20:34 -04:00
|
|
|
(let* ((model (message-result-object message))
|
2004-10-14 07:58:20 -04:00
|
|
|
(browser (dirfiles-res-obj-browse-obj model))
|
|
|
|
(browse-restore-message
|
|
|
|
(make-restore-message "browse-dir-list"
|
|
|
|
browser)))
|
|
|
|
(browse-dir-list-receiver browse-restore-message)))
|
2004-10-03 05:13:30 -04:00
|
|
|
((selection-message? message)
|
2005-05-20 11:20:34 -04:00
|
|
|
(let* ((model (message-result-object message))
|
2004-10-14 07:58:20 -04:00
|
|
|
(browser (dirfiles-res-obj-browse-obj model))
|
|
|
|
(browse-sel-message
|
|
|
|
(make-selection-message "browse-dir-list"
|
|
|
|
browser)))
|
|
|
|
(browse-dir-list-receiver browse-sel-message)))
|
|
|
|
)))
|
|
|
|
|
2005-05-23 08:47:41 -04:00
|
|
|
;(register-plugin!
|
|
|
|
; (make-plugin "directory-files" dir-files-receiver))
|
2004-10-03 05:13:30 -04:00
|
|
|
|
2005-05-23 08:47:41 -04:00
|
|
|
; (register-plugin!
|
|
|
|
; (make-plugin "ls" dir-files-receiver))
|