;; ----------------------------------------------------------- ;; Projecto Floresta Sinta(c)tica ;; ----------------------------------------------------------- ;; $Id: floresta, v 0.92r - 27/06/2001 ;; Renato Ribeiro Haber (Renato.R.Haber@informatics.sintef.no) ;; ----------------------------------------------------------- (require 'cus-face) (require 'dired) (require 'hilit-chg) (require 'paren) (require 'thingatpt) (require 'timer) ;;;;;; (setq debug-on-error t) (put 'eval-expression 'disabled nil) (setq inhibit-startup-message t) ;; =========================================================== ;; Configuracoes do ambiente ;; =========================================================== (fset 'yes-or-no-p 'y-or-n-p) ;; tentei converter o "y" para "s", ;; mas, nao consegui ... 8-( (setq visible-bell t) (setq make-backup-files nil) (setq next-line-add-newlines nil) (setq require-final-newline 1) (setq-default transient-mark-mode t) (unless (boundp 'use-home) (progn (setq use-home (expand-file-name "~")) (cond ((string= 'w32 window-system) ()) ((string= "mswindows" window-system) ()) (t (setq use-home (concat use-home "/")))))) (cond (window-system (set-face-background 'modeline "yellow") (set-face-foreground 'modeline "blue") )) ;; =========================================================== ;; configuracao da linha atual ;; =========================================================== (setq mode-line-system-identification (substring (system-name) 0 (string-match "\\..+" (system-name)))) (setq default-mode-line-format (list "" 'mode-line-modified "<" 'mode-line-system-identification "> " "%14b" " " "%[(" 'mode-name 'minor-mode-alist "%n" 'mode-line-process ")%]--" "Line %l--" '(-3 . "%P") "-%-")) (setq mode-line-format default-mode-line-format) ;; =========================================================== ;; altera a fonte do texto/arvore modificado(a) ;; =========================================================== (defun my-highlight-changes-enable-hook () (add-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)) (defun my-highlight-changes-disable-hook () (remove-hook 'local-write-file-hooks 'highlight-changes-rotate-faces)) (add-hook 'highlight-changes-enable-hook 'my-highlight-changes-enable-hook) (add-hook 'highlight-changes-disable-hook'my-highlight-changes-disable-hook) ;; =========================================================== ;; configuracao do "scrooling" ;; =========================================================== (setq scroll-step 1) (setq scroll-conservatively 5) ;; =========================================================== ;; Configuracao do "mouse" ;; =========================================================== (setq mouse-yank-at-point 't) ;; =========================================================== ;; Definicao de funcoes para movimentacao do cursor ;; Microsoft-like ;; =========================================================== (defun s-shift-forward-char () (interactive) (if (not mark-active) (set-mark-command nil) ()) (forward-char)) (defun s-shift-backward-char () (interactive) (if (not mark-active) (set-mark-command nil) ()) (backward-char)) (defun s-shift-previous-line1 () (interactive) (if (not mark-active) (set-mark-command nil) ()) (previous-line 1)) (defun s-shift-next-line1 () (interactive) (if (not mark-active) (set-mark-command nil) ()) (next-line 1)) (defun s-forward-char () (interactive) (if mark-active (set-mark nil) ()) (forward-char)) (defun s-backward-char () (interactive) (if mark-active (set-mark nil) ()) (backward-char)) (defun s-previous-line1 () (interactive) (if mark-active (set-mark nil) ()) (previous-line 1)) (defun s-next-line1 () (interactive) (if mark-active (set-mark nil) ()) (next-line 1)) ;; ;; "End" e "Home" ;; (defun s-shift-end-of-line () (interactive) (if (not mark-active) (set-mark-command nil) ()) (end-of-line)) (defun s-shift-ctrl-end-of-buffer () (interactive) (if (not mark-active) (set-mark-command nil) (message "hi")) (goto-char (point-max))) (defun s-end-of-line () (interactive) (if mark-active (set-mark nil) ()) (end-of-line)) (defun s-shift-beginning-of-line () (interactive) (if (not mark-active) (set-mark-command nil) ()) (beginning-of-line)) (defun s-shift-ctrl-beginning-of-buffer () (interactive) (if (not mark-active) (set-mark-command nil) ()) (goto-char (point-min))) (defun s-beginning-of-line () (interactive) (if mark-active (set-mark nil) ()) (beginning-of-line)) ;; =========================================================== ;; Substitui a string "origem" pela string "destino" em ;; todos os buffers que estejam ativos ;; =========================================================== (defun substitui-todos-buffers (ORIGEM DESTINO) (interactive (progn (setq ORIGEM (read-from-minibuffer "Substitui: ")) (setq DESTINO(read-from-minibuffer (format "Substitui %s por: " ORIGEM))) (list ORIGEM DESTINO))) (let ((BUFFERS (buffer-list)) (current-buffer (current-buffer))) (while (car BUFFERS) (switch-to-buffer (buffer-name (car BUFFERS))) (let ((pos (point))) (goto-char 0) (query-replace ORIGEM DESTINO) (goto-char pos)) (setq BUFFERS (cdr BUFFERS))) (switch-to-buffer current-buffer))) ;; =========================================================== ;; Conta o numero de palavras do buffer ;; >>> terei que adaptar para numero de palavras da arvore <<< ;; =========================================================== (defun conta-palavras-regiao (INICIO FIM) (interactive "r") (let ((org-table (syntax-table)) (TABELA (copy-syntax-table)) (CONTADOR 0)) (save-excursion (goto-char INICIO) (unwind-protect (progn (set-syntax-table TABELA) (modify-syntax-entry ?- "w") (modify-syntax-entry ?_ "w") (while (< (point) FIM) (forward-word 1) (setq CONTADOR (1+ CONTADOR)))) (set-syntax-table org-table))) (if (interactive-p) (message "A regiao possui %d palavras." CONTADOR) CONTADOR))) (defun conta-palavras-buffer () (interactive) (if (interactive-p) (message "O buffer possui %d palavras." (conta-palavras-regiao (point-min) (point-max))) (conta-palavras-regiao (point-min) (point-max)))) ;; =========================================================== ;; Desce o nivel do noh selecionado ;; =========================================================== (defun aumenta-identacao () (interactive) (setq DISTANCIA "") (setq PROXIMO "") (setq ANTERIOR "") (setq PAI "") (setq FOLHA 0) (setq PONTUACAO 0) ;; -------------------------------------------------- ;; obtem a altura (distancia do noh ao mnoh-raiz) ;; -------------------------------------------------- (save-excursion (beginning-of-line) (setq DISTANCIA (save-excursion (save-match-data (beginning-of-line) (if (looking-at "[=]*") (buffer-substring-no-properties (match-beginning 0) (match-end 0))))))) ;; -------------------------------------------------- ;; obtem a linha atual ;; -------------------------------------------------- (beginning-of-line) (setq LINHA (thing-at-point 'line)) (if (looking-at ".*[\t][A-Za-zà-ýÀ-Ý0-9].*") (setq FOLHA 1)) (if (looking-at "[=]*[.,;?!()\"«»][\n]*") (setq PONTUACAO 1)) ;; -------------------------------------------------- ;; realiza o deslocamento ;; -------------------------------------------------- (if (y-or-n-p (concat "Insere um novo nó? ")) (progn (setq NOVO_NO (read-string (concat "Entre com o nome do novo nó : "))) (save-excursion (if (or (equal PONTUACAO 1) (equal FOLHA 1)) (progn (insert (concat (concat DISTANCIA NOVO_NO) "\n")) (insert "=")) (progn (insert (concat (concat DISTANCIA NOVO_NO) "\n")) (insert "=") (setq DISTANCIA (concat DISTANCIA "=")) (while (and (forward-line) (looking-at DISTANCIA)) (insert "=")))))) (progn ;; -------------------------------------------------- ;; nao insere um novo noh - looking at "folha" ;; -------------------------------------------------- (if (or (equal PONTUACAO 1) (equal FOLHA 1)) (progn (let (DIRECAO) (setq DIRECAO (read-from-minibuffer "Aumenta um nível para : ( ireita ou squerda ) ")) (cond ;; -------------------------------------------------- ;; insercoes aa direita ;; -------------------------------------------------- ((or (equal DIRECAO "d") (equal DIRECAO "D")) (progn (save-excursion (forward-line 1) (if (looking-at ".*[\t][A-Za-zà-ýÀ-Ý0-9].*") (progn (setq PROXIMO "folha")) (progn (if (looking-at "[=]*[.,;?!()\"«»][\n]*") (progn (setq PROXIMO "pontuacao")) (progn (setq PROXIMO "sintagma")))))) (if (equal PROXIMO "sintagma") (progn (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))) (save-excursion (beginning-of-line) (setq PAI (save-excursion (save-match-data (beginning-of-line) (if (looking-at "[=]*") (buffer-substring-no-properties (match-beginning 0) (match-end 0) )))))) (setq AUX (- (length PAI) (length DISTANCIA))) (if (>= (length PAI) (length DISTANCIA)) (progn (if (>= AUX 0) (progn (while (not (equal AUX 0)) (insert "=") (setq AUX (- AUX 1)))) (progn (while (not (equal AUX 0)) (insert "=") (setq AUX (+ AUX 1)))))) (progn (setq LINHA (substring LINHA (+ (- (length LINHA)) (length DISTANCIA)) nil)))) (forward-line 1) (insert (concat "=" LINHA))) (progn (insert "=") )) (message "") )) ;; -------------------------------------------------- ;; insercoes aa esquerda ;; -------------------------------------------------- ((or (equal DIRECAO "e") (equal DIRECAO "E")) (progn (save-excursion (vertical-motion -1) (if (looking-at ".*[\t][A-Za-zà-ýÀ-Ý0-9].*") (progn (setq ANTERIOR "folha")) (progn (if (looking-at "[=]*[.,;?!()\"«»][\n]*") (progn (setq ANTERIOR "pontuacao")) (progn (setq ANTERIOR "sintagma")))))) (if (equal ANTERIOR "sintagma") (progn (setq ANTERIOR "") (save-excursion (vertical-motion -2) (if (looking-at ".*[\t][A-Za-zà-ýÀ-Ý0-9].*") (progn (setq ANTERIOR "folha")) (progn (if (looking-at "[=]*[.,;?!()\"«»][\n]*") (progn (setq ANTERIOR "pontuacao")) (progn (setq ANTERIOR "sintagma"))))) (save-excursion (beginning-of-line) (setq PAI (save-excursion (save-match-data (beginning-of-line) (if (looking-at "[=]*") (buffer-substring-no-properties (match-beginning 0) (match-end 0) ))))))) (if (equal ANTERIOR "folha") (progn (setq AUX (- (length PAI) (length DISTANCIA))) (if (< AUX 0) (progn (message "Operação ilegal ! (favor confirmar ...)")) (progn (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))) (vertical-motion -1) (while (not (equal AUX 0)) (insert "=") (setq AUX (- AUX 1))) (insert LINHA)))) (progn (message "Operação ilegal ! (favor confirmar ...)") )) ) (progn (insert "=") )) (message "")))) )) ;; -------------------------------------------------- ;; nao insere um novo noh - looking at "nao-folha" ;; -------------------------------------------------- (progn (setq DISTANCIA (concat DISTANCIA "=")) (save-excursion (insert "=") (while (and (forward-line) (looking-at DISTANCIA)) (insert "="))) (message "")))))) ;; =========================================================== ;; Desce o nivel dos nohs selecionados ;; =========================================================== (defun aumenta-identacao-selecionado () (interactive) (setq LINHAS 0) (if mark-active (progn (save-excursion (setq LINHAS (- (count-lines (region-beginning) (region-end)) 1)) (goto-char (region-beginning)) (beginning-of-line) (insert "=") (while (and (forward-line) (not (equal LINHAS 0))) (insert "=") (setq LINHAS (- LINHAS 1))))) (progn (message "Para executar essa macro, você precisa selecionar o texto.")))) ;; =========================================================== ;; Sobe o nivel do noh selecionado ;; =========================================================== (defun diminui-identacao () (interactive) (setq DISTANCIA "") (setq ANTERIOR "") (setq PAI "") (setq FOLHA 0) (setq PONTUACAO 0) ;; -------------------------------------------------- ;; obtem a altura (distancia do noh ao mnoh-raiz) ;; -------------------------------------------------- (save-excursion (beginning-of-line) (setq DISTANCIA (save-excursion (save-match-data (beginning-of-line) (if (looking-at "[=]*") (buffer-substring-no-properties (match-beginning 0) (match-end 0))))))) ;; -------------------------------------------------- ;; obtem a linha atual ;; -------------------------------------------------- (beginning-of-line) (setq LINHA (thing-at-point 'line)) (if (looking-at ".*[\t][A-Za-zà-ýÀ-Ý0-9].*") (setq FOLHA 1)) (if (looking-at "[=]*[.,;?!()\"«»][\n]*") (setq PONTUACAO 1)) (if (and (equal (length DISTANCIA) 0) (or (equal PONTUACAO 1) (equal FOLHA 1))) (progn (message "Operação ilegal!")) (progn ;; -------------------------------------------------- ;; verifica o tipo de informacao q precede o noh atual ;; -------------------------------------------------- (save-excursion (vertical-motion -1) (if (looking-at ".*[\t][A-Za-zà-ýÀ-Ý0-9].*") (progn (setq ANTERIOR "folha")) (progn (if (looking-at "[=]*[.,;?!()\"«»][\n]*") (progn (setq ANTERIOR "pontuacao")) (progn (setq ANTERIOR "sintagma") (setq PAI (thing-at-point 'line)))) ))) ;; -------------------------------------------------- ;; realiza o deslocamento ;; -------------------------------------------------- (if (and (equal PONTUACAO 0) (equal FOLHA 0)) (progn ;; -------------------------------------------------- ;; noh NAO-folha ;; -------------------------------------------------- (if (y-or-n-p (concat "Elimina o nó selecionado? ")) ;; -------------------------------------------------- ;; elimina noh selecionado ;; -------------------------------------------------- (progn (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))) (setq DISTANCIA (concat DISTANCIA "=")) (vertical-motion -1) (while (and (forward-line) (looking-at DISTANCIA)) (setq LINHA (thing-at-point 'line)) (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line)) (insert (substring LINHA (+ (- (length LINHA)) 1) nil))) ) ; while (message "")) ;; -------------------------------------------------- ;; NAO elimina noh selecionado ;; -------------------------------------------------- (progn (if (equal (length DISTANCIA) 0) (progn (message "Operação ilegal!")) (progn (if (equal ANTERIOR "sintagma") (progn (vertical-motion -1) (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))))) (save-excursion (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))) (insert (substring LINHA (+ (- (length LINHA)) 1) nil)) (setq DISTANCIA (concat DISTANCIA "=")) (vertical-motion -1) (while (and (forward-line) (looking-at DISTANCIA)) (setq LINHA (thing-at-point 'line)) (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line)) (insert (substring LINHA (+ (- (length LINHA)) 1) nil)))) (insert PAI)) (message "")) )) )) ;; -------------------------------------------------- ;; noh folha ;; -------------------------------------------------- (progn (if (equal ANTERIOR "sintagma") (progn (vertical-motion -1) (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))))) (save-excursion (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))) (insert (substring LINHA (+ (- (length LINHA)) 1) nil))) (if (equal ANTERIOR "sintagma") (progn (forward-line 1) (insert PAI))) (message "")))))) ;; =========================================================== ;; Sobe o nivel dos nohs selecionados ;; =========================================================== (defun diminui-identacao-selecionado () (interactive) (setq LINHAS 0) (if mark-active (progn (save-excursion (setq LINHAS (- (count-lines (region-beginning) (region-end)) 1)) (goto-char (region-beginning)) (beginning-of-line) (if (looking-at "^\=.*") (progn (setq LINHA (thing-at-point 'line)) (save-excursion (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))) (insert (substring LINHA (+ (- (length LINHA)) 1) nil))))) (while (and (forward-line) (not (equal LINHAS 0))) (if (looking-at "^\=.*") (progn (setq LINHA (thing-at-point 'line)) (save-excursion (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))) (insert (substring LINHA (+ (- (length LINHA)) 1) nil)))) (setq LINHAS (- LINHAS 1)))))) (progn (message "Para executar essa macro, você precisa selecionar o texto.") ))) ;; =========================================================== ;; Baixar nível (identação para a direita) com inserção do nó. ;; =========================================================== (defun baixa-nivel-com-insercao () (interactive) (setq DISTANCIA "") (setq PROXIMO "") (setq ANTERIOR "") (setq PAI "") (setq FOLHA 0) (setq PONTUACAO 0) ;; -------------------------------------------------- ;; obtem a altura (distancia do noh ao mnoh-raiz) ;; -------------------------------------------------- (save-excursion (beginning-of-line) (setq DISTANCIA (save-excursion (save-match-data (beginning-of-line) (if (looking-at "[=]*") (buffer-substring-no-properties (match-beginning 0) (match-end 0))))))) ;; -------------------------------------------------- ;; obtem a linha atual ;; -------------------------------------------------- (beginning-of-line) (setq LINHA (thing-at-point 'line)) (if (looking-at ".*[\t][A-Za-zà-ýÀ-Ý0-9].*") (setq FOLHA 1)) (if (looking-at "[=]*[.,;?!()\"«»][\n]*") (setq PONTUACAO 1)) ;; -------------------------------------------------- ;; realiza o deslocamento ;; -------------------------------------------------- (setq NOVO_NO (read-string (concat "Entre com o nome do novo nó : "))) (save-excursion (if (or (equal PONTUACAO 1) (equal FOLHA 1)) (progn (insert (concat (concat DISTANCIA NOVO_NO) "\n")) (insert "=")) (progn (insert (concat (concat DISTANCIA NOVO_NO) "\n")) (insert "=") (setq DISTANCIA (concat DISTANCIA "=")) (while (and (forward-line) (looking-at DISTANCIA)) (insert "="))))) (message "")) ;; =========================================================== ;; Subir nível (identação para a esquerda) com eliminação do nó. ;; =========================================================== (defun subir-nivel-com-eliminacao () (interactive) (setq DISTANCIA "") (setq FOLHA 0) (setq PONTUACAO 0) ;; -------------------------------------------------- ;; obtem a altura (distancia do noh ao mnoh-raiz) ;; -------------------------------------------------- (save-excursion (beginning-of-line) (setq DISTANCIA (save-excursion (save-match-data (beginning-of-line) (if (looking-at "[=]*") (buffer-substring-no-properties (match-beginning 0) (match-end 0))))))) ;; -------------------------------------------------- ;; obtem a linha atual ;; -------------------------------------------------- (beginning-of-line) (setq LINHA (thing-at-point 'line)) (if (looking-at ".*[\t][A-Za-zà-ýÀ-Ý0-9].*") (setq FOLHA 1)) (if (looking-at "[=]*[.,;?!()\"«»][\n]*") (setq PONTUACAO 1)) (if (and (equal (length DISTANCIA) 0) (or (equal PONTUACAO 1) (equal FOLHA 1))) (progn (message "Operação ilegal!")) (progn ;; -------------------------------------------------- ;; realiza o deslocamento ;; -------------------------------------------------- (if (and (equal PONTUACAO 0) (equal FOLHA 0)) (progn (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))) (setq DISTANCIA (concat DISTANCIA "=")) (vertical-motion -1) (while (and (forward-line) (looking-at DISTANCIA)) (setq LINHA (thing-at-point 'line)) (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line)) (insert (substring LINHA (+ (- (length LINHA)) 1) nil))) ) ; while (message "")) (progn (message "Operação ilegal!")))))) ;; =========================================================== ;; Subir nível (identação para a esquerda) sem eliminação do nó. ;; =========================================================== (defun subir-nivel-sem-eliminacao () (interactive) (setq DISTANCIA "") (setq ANTERIOR "") (setq PAI "") (setq FOLHA 0) (setq PONTUACAO 0) ;; -------------------------------------------------- ;; obtem a altura (distancia do noh ao mnoh-raiz) ;; -------------------------------------------------- (save-excursion (beginning-of-line) (setq DISTANCIA (save-excursion (save-match-data (beginning-of-line) (if (looking-at "[=]*") (buffer-substring-no-properties (match-beginning 0) (match-end 0))))))) ;; -------------------------------------------------- ;; obtem a linha atual ;; -------------------------------------------------- (beginning-of-line) (setq LINHA (thing-at-point 'line)) (if (looking-at ".*[\t][A-Za-zà-ýÀ-Ý0-9].*") (setq FOLHA 1)) (if (looking-at "[=]*[.,;?!()\"«»][\n]*") (setq PONTUACAO 1)) (if (and (equal (length DISTANCIA) 0) (or (equal PONTUACAO 1) (equal FOLHA 1))) (progn (message "Operação ilegal!")) (progn ;; -------------------------------------------------- ;; verifica o tipo de informacao q precede o noh atual ;; -------------------------------------------------- (save-excursion (vertical-motion -1) (if (looking-at ".*[\t][A-Za-zà-ýÀ-Ý0-9].*") (progn (setq ANTERIOR "folha")) (progn (if (looking-at "[=]*[.,;?!()\"«»][\n]*") (progn (setq ANTERIOR "pontuacao")) (progn (setq ANTERIOR "sintagma") (setq PAI (thing-at-point 'line)))) ))) ;; -------------------------------------------------- ;; realiza o deslocamento ;; -------------------------------------------------- (if (and (equal PONTUACAO 0) (equal FOLHA 0)) (progn ;; -------------------------------------------------- ;; noh NAO-folha ;; -------------------------------------------------- (if (equal (length DISTANCIA) 0) (progn (message "Operação ilegal!")) (progn (if (equal ANTERIOR "sintagma") (progn (vertical-motion -1) (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))))) (save-excursion (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))) (insert (substring LINHA (+ (- (length LINHA)) 1) nil)) (setq DISTANCIA (concat DISTANCIA "=")) (vertical-motion -1) (while (and (forward-line) (looking-at DISTANCIA)) (setq LINHA (thing-at-point 'line)) (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line)) (insert (substring LINHA (+ (- (length LINHA)) 1) nil)))) (insert PAI)) (message "")))) ;; -------------------------------------------------- ;; noh folha ;; -------------------------------------------------- (progn (if (equal ANTERIOR "sintagma") (progn (vertical-motion -1) (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))))) (save-excursion (save-excursion (end-of-line) (let ((FIM (point))) (beginning-of-line) (widen) (kill-region (point) FIM) (kill-line))) (insert (substring LINHA (+ (- (length LINHA)) 1) nil))) (if (equal ANTERIOR "sintagma") (progn (forward-line 1) (insert PAI))) (message "")) )) )) ;;;;;;;; ;;;;;;;; (global-set-key [f2] 'search-forward) (global-set-key [f3] 'replace-string) (global-set-key [S-f3] 'substitui-todos-buffers) (global-set-key [f11] 'conta-palavras-regiao) (global-set-key [S-f11] 'conta-palavras-buffer) (global-set-key [f12] 'highlight-changes-mode) (global-set-key [(C-right)] 'highlight-changes-next-change) (global-set-key [(C-leftl)] 'highlight-changes-previous-change) (global-set-key [(C-M-up)] 'diminui-identacao) (global-set-key [(C-M-right)] 'aumenta-identacao-selecionado) (global-set-key [(C-M-down)] 'aumenta-identacao) (global-set-key [(C-M-left)] 'diminui-identacao-selecionado) (global-set-key [(C-S-down)] 'baixa-nivel-com-insercao) (global-set-key [(C-S-up)] 'subir-nivel-com-eliminacao) (global-set-key [(C-S-left)] 'subir-nivel-sem-eliminacao) ;;;;;;;; (global-set-key [(alt backspace)] (lambda () (interactive) (delete-region (point) (point-at-bol)))) (define-key global-map [S-right] 's-shift-forward-char) (define-key global-map [S-left] 's-shift-backward-char) (define-key global-map [S-up] 's-shift-previous-line1) (define-key global-map [S-down] 's-shift-next-line1) (define-key global-map [right] 's-forward-char) (define-key global-map [left] 's-backward-char) (define-key global-map [up] 's-previous-line1) (define-key global-map [down] 's-next-line1) (define-key global-map [S-end] 's-shift-end-of-line) (define-key global-map [C-S-end] 's-shift-ctrl-end-of-buffer) (define-key global-map [end] 's-end-of-line) (define-key global-map [C-end] 'end-of-buffer) (define-key global-map [S-home] 's-shift-beginning-of-line) (define-key global-map [C-S-home] 's-shift-ctrl-beginning-of-buffer) (define-key global-map [home] 's-beginning-of-line) (define-key global-map [C-home] 'beginning-of-buffer) ;;;;;;;; (setq debug-on-error nil) (message "Todas as macros da floresta forão carregadas corretamente ...")