(add (scrolled go) (canvas go))
(show (canvas go)))))
-(define x-editor #f)
-(define (get-x-editor)
- (if (not x-editor)
- (set! x-editor (getenv "XEDITOR")))
- x-editor)
-
(define ifs #f)
(define (get-ifs)
(if (not ifs)
(define (spawn-editor location)
(let* ((file-name (car location))
(line (cadr location))
- (column (caddr location))
- (template (substring (get-x-editor) 0))
-
- ;; Adhere to %l %c %f?
- (command
- (regexp-substitute/global
- #f "%l" (regexp-substitute/global
- #f "%c"
- (regexp-substitute/global
- #f "%f" template 'pre file-name 'post)
- 'pre (number->string column)
- 'post)
- 'pre (number->string line) 'post)))
-
+ (char (caddr location))
+ (column (cadddr location))
+ (command (get-editor-command file line char column)))
(debugf "spawning: ~s\n" command)
(if (= (primitive-fork) 0)
(let ((command-list (string-split command #\ )));; (get-ifs))))