Nach einigen Graben in das gleiche Problem zu tun, wie ich glaube, dass das Problem liegt tatsächlich in der Emacs x-select-text
Funktion, die explizit den Wert von x-select-enable-clipboard
ignoriert auf NextStep (und OS X ist ein NextStep).
Ich habe "gelöst" dieses Problem, indem x-select-text
mit einer no-op-Funktion zu ersetzen, dann mit ns- explizit {get, set} Pappe für interprogram {Ausschneiden, Einfügen} -Funktion:
; Override the default x-select-text function because it doesn't
; respect x-select-enable-clipboard on OS X.
(defun x-select-text (text))
(setq x-select-enable-clipboard nil)
(setq x-select-enable-primary nil)
(setq mouse-drag-copy-region nil)
(setq interprogram-cut-function 'ns-set-pasteboard)
(setq interprogram-paste-function 'ns-get-pasteboard)
hier ist das Original x-select-text
Code:
(defun x-select-text (text)
"Select TEXT, a string, according to the window system.
On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the
clipboard. If `x-select-enable-primary' is non-nil, put TEXT in
the primary selection.
On MS-Windows, make TEXT the current selection. If
`x-select-enable-clipboard' is non-nil, copy the text to the
clipboard as well.
On Nextstep, put TEXT in the pasteboard (`x-select-enable-clipboard'
is not used)."
(cond ((eq (framep (selected-frame)) 'w32)
(if x-select-enable-clipboard
(w32-set-clipboard-data text))
(setq x-last-selected-text text))
((featurep 'ns) ; This is OS X
;; Don't send the pasteboard too much text.
;; It becomes slow, and if really big it causes errors.
(ns-set-pasteboard text)
(setq ns-last-selected-text text))
(t
;; With multi-tty, this function may be called from a tty frame.
(when (eq (framep (selected-frame)) 'x)
(when x-select-enable-primary
(x-set-selection 'PRIMARY text)
(setq x-last-selected-text-primary text))
(when x-select-enable-clipboard
(x-set-selection 'CLIPBOARD text)
(setq x-last-selected-text-clipboard text))))))
Jeder Grund, diese Antwort ist besser? – justingordon
Es behebt das Problem, dass ausgewählter Text überall auf der Tastatur erscheint, nicht nur von Evil. –
Für mich scheinen diese ns-set-pasteboard, ns-get-pasteboard nicht zu existieren, so bekomme ich Fehler beim Schneiden von Text etc. (emacs-mac) –