Minara

Working on copy & paste:

(define (cut-selection-ranges-to-copy-buffer-var buffer)
(copy-selection-ranges-to-copy-buffer-var buffer)
(clear-selection-ranges-var buffer))

(define (paste-copy-buffer-var buffer)
(buffer-insert-undoable buffer
#f
(buffer-to-string (ensure-copy-buffer-var buffer))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Copy
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(define (do-copy-key)
(copy-selection-ranges-to-copy-buffer-var (window-buffer (window-current))))

(keymap-add-fun %global-keymap
do-copy-key
"Cc")

Now when I think “I wish there was a function to do x…”, more often than not I find I’ve already written it. šŸ™‚

Posted in Projects