10/04/07 19:48:20
>>120
遅くなって申し訳ないです
アドバイスどおりにしたのですがうまくいきませんでした。
結局以下のように落ち着いたので一応報告までに。
(defun eshell-ls-cd ()
(interactive)
(let ((fname (buffer-substring-no-properties
(previous-single-property-change (point) 'help-echo)
(next-single-property-change (point) 'help-echo))))
(setq fname (replace-regexp-in-string "^[ \t\n]*" "" fname))
(setq fname (replace-regexp-in-string "[ \t\n]*$" "" fname))
(cond ((equal "" fname)
(message "No file name found at point"))
(fname (cd fname) (end-of-buffer) (eshell-send-input)))))
後、フルパス渡したいならeshell/lsとつなげればよかったのですね
調べが足らずに申し訳なかったです。
(defun eshell-ls-execute ()
(interactive)
(let ((fname (buffer-substring-no-properties
(previous-single-property-change (point) 'help-echo)
(next-single-property-change (point) 'help-echo))))
(setq fname (replace-regexp-in-string "^[ \t\n]*" "" fname))
(setq fname (replace-regexp-in-string "[ \t\n]*$" "" fname))
(setq fname (concat (eshell/pwd) "/" fname))
(setq fname (replace-regexp-in-string "//" "/" fname))
(cond ((equal "" fname) (message "No file name found at point"))
(fname (start-process "exe" nil fname)))))