;;;;;;;;; EDITAR!!!!!!!!!!!!!! ;;; Esta linha deve ser editada pelo instalador, colocando o diretorio ;;; do ime-emacs na frente do diretorio padrao do lisp (setq load-path (append (list "/n/gnu/emacs-19-mandel-lisp") load-path)) ;;; Estes eu ponho no site-load, ficam ja' embutidos no emacs ;;; Pode ser sacal carregar toda hora. O primeiro bloco e' mais ;;; opcional que o segundo (load "dired") (garbage-collect) (load "complete") (garbage-collect) (load "execcmd") (garbage-collect) ;;; Recomendo esta parte fortemente - torna o sistema de help ;;; bem mais decente. (load "electric") (garbage-collect) (load "echistory") (garbage-collect) (load "ehelp") (garbage-collect) (load "utilities") (garbage-collect) ;;;;; (defun electric-apropos () "Electric version of apropos." (interactive) (electric-helpify 'apropos)) (defun electric-super-apropos () "Electric version of super-apropos." (interactive) (electric-helpify 'super-apropos)) ;(define-key help-map "a" 'fast-command-apropos) ;(define-key help-map "p" 'fast-apropos) (define-key ehelp-map "p" 'electric-super-apropos) (define-key ehelp-map "a" 'electric-apropos) ;; Make meta-shift a default help (let ((k ?A)) (while (<= k ?Z) (define-key esc-map (char-to-string k) (or (lookup-key esc-map (char-to-string k)) (lookup-key ehelp-map (char-to-string (downcase k))))) (setq k (1+ k)))) (fset 'help-command ehelp-map) ;;; Make the VM reader available (autoload 'vm "vm" "*Read mail under Emacs. Optional first arg FOLDER specifies the folder to visit. It defaults to the value of vm-primary-inbox. The folder buffer is put into VM mode, a major mode for reading mail. Visiting the primary inbox causes any contents of the system mailbox to be moved and appended to the resulting buffer. All the messages can be read by repeatedly pressing SPC. Messages are marked for deletion with `d', and saved to a folder with `s'. Quitting VM with `q' expunges messages marked for deletion and saves the buffered folder to disk. See the documentation for vm-mode for more information." t) (autoload 'vm-visit-folder "vm" "*Visit a mail file. VM will parse and present its messages to you in the usual way." t) (define-key ctl-x-map "R" 'vm) (define-key ctl-x-map "V" 'vm-visit-folder) (defun revert-this-buffer () "Replace the buffer text with the text of the visited file on disk." (interactive) (revert-buffer nil t)) (defun kill-this-buffer () "Get rid of the current buffer, no questions asked." (interactive) (kill-buffer (buffer-name))) (defun dired-default-directory (&optional arg) ;;; (am) "Does dired on the current directory. With an argument, the output goes to another window." (interactive "P") (if arg (switch-to-buffer-other-window (dired-noselect default-directory)) (switch-to-buffer (dired-noselect default-directory)))) (autoload 'zcat-buffer "zcat") (autoload 'zcat-insert-file "zcat") (autoload 'live-find-file "live-find" "View a file with \"tail -f\"" t) (fmakunbound 'load-library) (autoload 'load-library "lib-complete" nil t) (autoload 'locate-file "lib-complete" nil t) (autoload 'library-all-completions "lib-complete") (autoload 'read-library "lib-complete") ;;; Isto e' muito amarrado em Suns (setq man-command "(tbl -TX %s | neqn | nroff -h -man | col)") ;;; Este e' mais geral (setq man-command "(nroff -h -man %s | col)") (setq lpr-switches (list "-h")) ;;------------- GNUS stuff ;;;;;;;;; EDITAR!!!!!!!!!!!!!! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;; DEVE SER CONFIGURADO LOCALMENTE ;(defvar gnus-nntp-server "mafalda.ime.usp.br") ;(defvar gnus-nntp-service nil) ;(setq gnus-local-domain "ime.usp.br") ;(setq gnus-local-organization ; "Math. Institute, Univ. of Sao Paulo, Brazil") ;(setq gnus-use-generic-from t) ;(setq gnus-use-generic-path "ime.usp.br") ;(setq gnus-news-system "Cnews") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (autoload 'gnus "gnus-speedups" "Read network news." t) (autoload 'gnus-post-news "gnuspost" "Post a new news." t) ;(defvar gnus-nntp-server (system-name)) (setq gnus-use-long-file-name t) (setq gnus-mail-save-name (function gnus-plain-save-name)) (setq gnus-default-article-saver (function gnus-summary-save-in-mail)) (defvar gnus-novice-user t) (defvar gnus-interactive-post t) ;=;(setq gnus-Startup-hook ;=; (add-hook ;=; 'gnus-Startup-hook ;=; (function (lambda () ;=; (if (eq window-system 'x) ;=; (load "gnus-x" t t) ;=; ))))) (load "complete" t t) (load "dired-support" t t) (fset 'PaTeX-mode 'patex-mode) ; Nao vale `a pena esperar que lusers descubram isso (add-hook 'mail-setup-hook 'mail-abbrevs-setup) (defvar want-auctex nil "If not nil, use AUC TeX, instead of GNU's tex-mode.") (if want-auctex (progn (load "tex-site" t t) (defun patex-mode () "Major mode for editing files of input for PaTeX. Makes $ and } display the characters they match. Makes \" insert `` when it seems to be the beginning of a quotation, and '' when it appears to be the end; it inserts \" only after a \\. LFD and TAB indent lines as with programming modes. See under AUC TeX for full documentation. Special commands: \\{LaTeX-mode-map} Entering PaTeX mode calls the value of text-mode-hook, then the value of TeX-mode-hook, then the value of LaTeX-mode-hook. and then the value of PaTeX-mode-hook." (interactive) (require 'tex-init) (VirTeX-mode "PATEX"))) ) (autoload 'gopher "gopher" "Start a gopher session. With C-u, prompt for a gopher server." t) (autoload 'gopher-atpoint "gopher" "Try to interpret the text around point as a gopher bookmark, and dispatch to that object." t) (setq gopher-support-bookmarks t) (autoload 'Portug-mode "iso") (autoload 'Portug "iso" "Toggles Portug-mode. In Portug mode, the keys '`\"~^ work as accents toward the following letter; one gets c-cedilla with 'c. A double accent inserts itself. Case fold searches also fold accents. " t) (fset 'portug 'Portug) (add-hook 'text-mode-hook (function (lambda () (Portug-mode nil)))) (defvar mouse-left-down t "If not nil, mouse-1 on the scroll-bar will scroll-down the buffer (moving the scroll-bar up), and mouse-3 is the reverse. If nil, the roles of the mouses is exchanged.") (if (eq window-system 'x) (progn (load "xwinkeys" t t) (load "mouse-extra" t t) (set-mouse-shape 'x-pointer-left-ptr) (if (x-display-color-p) nil (invert-face 'modeline)) (setq baud-rate 153600) (if mouse-left-down (progn (global-set-key [vertical-scroll-bar mouse-1] 'scroll-bar-scroll-down) (global-set-key [vertical-scroll-bar drag-mouse-1] 'scroll-bar-scroll-down) (global-set-key [vertical-scroll-bar mouse-3] 'scroll-bar-scroll-up) (global-set-key [vertical-scroll-bar drag-mouse-3] 'scroll-bar-scroll-up) )) )) ;;; Until the polls come out: (defun mouse-drag-region (start-event) "Set the region to the text that the mouse is dragged over. Highlight the drag area as the user moves the mouse. This must be bound to a button-down mouse event." (interactive "e") (let* ((start-posn (event-start start-event)) (start-point (posn-point start-posn)) (start-window (posn-window start-posn)) (start-frame (window-frame start-window)) (bounds (window-edges start-window)) (top (nth 1 bounds)) (bottom (if (window-minibuffer-p start-window) (nth 3 bounds) ;; Don't count the mode line. (1- (nth 3 bounds))))) (select-window start-window) (goto-char start-point) (move-overlay mouse-drag-overlay start-point start-point (window-buffer start-window)) (deactivate-mark) (let (event end end-point) (track-mouse (while (progn (setq event (read-event)) (or (mouse-movement-p event) (eq (car-safe event) 'switch-frame))) (if (eq (car-safe event) 'switch-frame) nil (setq end (event-end event) end-point (posn-point end)) (cond ;; Ignore switch-frame events. ((eq (car-safe event) 'switch-frame)) ;; Are we moving within the original window? ((and (eq (posn-window end) start-window) (integer-or-marker-p end-point)) (goto-char end-point) (move-overlay mouse-drag-overlay start-point (point))) ;; Are we moving on a different window on the same frame? ((and (windowp (posn-window end)) (eq (window-frame (posn-window end)) start-frame)) (let ((mouse-row (+ (nth 1 (window-edges (posn-window end))) (cdr (posn-col-row end))))) (cond ((< mouse-row top) (mouse-scroll-subr (- mouse-row top) mouse-drag-overlay start-point)) ((and (not (eobp)) (>= mouse-row bottom)) (mouse-scroll-subr (1+ (- mouse-row bottom)) mouse-drag-overlay start-point))))) ;; Otherwise, we have no idea where the mouse is. (t))))) (if (and (eq (get (event-basic-type event) 'event-kind) 'mouse-click) (eq (posn-window (event-end event)) start-window) (numberp (posn-point (event-end event)))) (goto-char (posn-point (event-end event)))) (if (= (point) start-point) (deactivate-mark) (set-mark start-point) (kill-new (buffer-substring (point) (mark)))) (delete-overlay mouse-drag-overlay))))