Created
April 13, 2026 13:52
-
-
Save leotada/257b6f655484f522aa7381397ede8bb7 to your computer and use it in GitHub Desktop.
Configuração da Área de Transferência em Wayland no Emacs puro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; ========================================== | |
| ;; Configuração de UTF-8 e Área de Transferência | |
| ;; ========================================== | |
| ;; 1. Padroniza o UTF-8 em todo o Emacs | |
| (prefer-coding-system 'utf-8) | |
| (set-default-coding-systems 'utf-8) | |
| (set-terminal-coding-system 'utf-8) | |
| (set-keyboard-coding-system 'utf-8) | |
| (set-selection-coding-system 'utf-8) | |
| ;; 2. Habilita a integração padrão com a área de transferência | |
| (setq select-enable-clipboard t) | |
| ;; 3. Força a cópia via wl-copy com o MIME type exigido pelo motor Chromium | |
| (setq interprogram-cut-function | |
| (lambda (text) | |
| (let* ((utf8-text (encode-coding-string text 'utf-8)) | |
| (process-connection-type nil) | |
| (proc (start-process "wl-copy" nil "wl-copy" "--type" "text/plain;charset=utf-8"))) | |
| (process-send-string proc utf8-text) | |
| (process-send-eof proc)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment