[CM] From Cursor to N'th Mark (Snd-8.9)

Bill Schottstaedt bil@ccrma.Stanford.EDU
Mon, 26 Mar 2007 13:15:40 -0700

> Is there any way to define a selection from the cursor to a named 
> mark? 

(bind-key #\m 0 
  (lambda ()
    (prompt-in-minibuffer "mark name:"
      (lambda (response) ; this expects a string (use double quotes)
        (define (define-selection beg end)
          (let* ((s (selected-sound))
                 (c (selected-channel s)))
            (set! (selection-member? s c) #t)
            (set! (selection-position s c) beg)
            (set! (selection-frames s c) (1+ (- end beg)))))
        (let ((m (find-mark response)))
          (if (mark? m)
              (define-selection (cursor) (mark-sample m))
              (report-in-minibuffer "no such mark")))))))

(if the minibuffer gets clogged up, use C-g to clear it -- I need
to make this prettier).