help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

.emacs help


From: Benjamin Badgley
Subject: .emacs help
Date: Fri, 05 Jun 2009 00:10:33 -0400
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)


Keep running into an error about wrong number of key command. Not versed enough yet to comprehend the backtrace. Also not yet able to effectively use rmail or gnus. Pointers to doc helpful. Can someone help?

--
Ben


; begin .emacs
   ; === Load Requires ===
   ; Get all the required load ups into one place, at the head of the file.
   (require 'cl) ; load Common Lisp
   (require 'emacs-goodies-el) ; load emacs goodies
   (require 'advice) ; needed for framepop
   (require 'w3m-load) ; load Emacs own internal web browser
   (require 'recentf) ; load recent file menu
   (require 'diff-mode "diff-mode" t) ; use diff mode
   (require 'calendar) ; load the calender up
   (require 'rmail) ; use rmail
   (require 'gnus) ; load gnus
   (require 'clipper) ; add a clipper
   (require 'saveplace) ; keep your place
   (require 'keywiz) ; game for knowing Emacs key bindings
   (require 'remember) ; toss in a memory agent
   ;(require 'tex-suite) ; use AcuTex
   (require 'filladapt); use filladapt
; === Main Emacs Preferences ===
   ; This is the vanilla of my emacs file, welcome.
; "Abandon hope all ye who enter." ;) ; === Core Vanilla ===
   ; Basic stuff I like having Emacs handle in house
(setq emacs-load-start-time (current-time)) ; load current time at start up
   (enable-flow-control) ; enable flow control to address issue with gnus
   (setq auto-save-timeout 600)
   ; autosave timeout in seconds - 300 is five minutes
   (setq line-number-mode t) ; enable line numbers
   (setq column-number-mode t) ; enable col numbers
   (setq frame-title-format "%b" ) ; enable filename in buffer titles
   (transient-mark-mode t) ; enable marked region to hilight
   (delete-selection-mode 1) ; enable typing to replace hilighted region
   (setq case-fold-search t)   ; make searches case insensitive
(add-hook 'text-mode-hook 'turn-on-auto-fill) ; hook auto fill on in text mode
   (setq load-path (cons "~/emacs/" load-path))
   ; add usr home emacs directory to load path
   (show-paren-mode 1) ; display parenths
   (setq default-tab-width 5) ; set tabs
   (global-font-lock-mode 1) ; set font lock global on
   (setq font-lock-medium-decoration t) ; use medium font lock
   (setq sentence-end-double-space nil) ; single space sentences
   (setq-default filladapt-mode t) ; fill adapt enabled
   (df "/" ) ; display disk use in the modeline
   (add-hook 'text-mode-hook 'table-recognize) ; set emacs to manipulate tables
   (setq initial-frame-alist '((cursor-type . (bar . 2))))
   ; set cursor to 2 pixel bar
   (setq mouse-yank-at-point t) ; mouse pastes at the point
   (defalias 'yes-or-no-p 'y-or-n-p) ; use y or n instead of yes or no
(setq-default save-place t) ; handy for editing large files, cursor place saved
   (add-hook 'text-mode-hook 'longlines-mode)
    ; enable text mode to use longline mode
   (auto-compression-mode 1) ; use auto decompression, edit compressed files
; === More Advanced 'Nilla
   ; Here is a section of more advanced options for in house
; === recentf === (recentf-mode 1)
     (setq recentf-max-saved-items 500)
     (setq recentf-max-menu-items 60)
     (setq recentf-exclude (append recentf-exclude '(".ftp:.*" ".sudo:.*" )))
     (setq recentf-keep '(file-remote-p file-readable-p))
; === diff-mode === (setq diff-switches "-u" ) ; Use -u for plain diff also
   (setq diff-default-read-only t)
; === Calendar === (setq calendar-latitude "38.63N")
     (setq calendar-longitude "78.78W")
      (setq calendar-location-name "Timberville, VA  U.S.A.")
      (setq mark-holidays-in-calendar t)
     (setq calendar-time-display-form
'(24-hours ":" minutes (if time-zone " (") time-zone (if time-zone ")")))
    (setq calendar-date-display-form
       '((if dayname (concat dayname ", ")) day " " monthname " " year))
;(require 'astronomy "astronomy" t) (setq solar-holidays t)
   (setq hebrew-holidays t)
   (setq islamic-holidays t)
   (setq oriental-holidays t)
   (setq christian-holidays t)
;; Display ISO week, available since 27.06.2008
   (setq calendar-intermonth-header (propertize "WK" 'font-lock-face
   'font-lock-function-name-face))
   (setq calendar-intermonth-text
         '(propertize
           (format "%2d" (car (calendar-iso-from-absolute
   (calendar-absolute-from-gregorian (list month day year)))))
           'font-lock-face 'font-lock-function-name-face))
(setq calendar-daylight-savings-starts '(calendar-nth-named-day -1 0 3 year))
   (setq calendar-daylight-savings-ends '(calendar-nth-named-day -1 0 9 year))
   (setq calendar-week-start-day 1)
; === Backups ===
   ; Sends bacup files to a centeral directory ~/backups/
(defun make-backup-file-name(file)
     (concat "~/backups/" (file-name-nondirectory file) "~"))
; === Undoc ===
   ; Kill MS Word documents dead.
   ;http://www.ccs.neu.edu/home/guttman/undoc.el
(autoload 'undoc "~/.emacs.d/undoc.el" "A minor mode which kills MS
   Word files dead." t)
   (autoload 'undoc-current-buffer "undoc" "" t)
   (autoload 'undoc-region-after-mime-decode "undoc" "" t)
; === Remember ===
   ; Sends rembmer to ~/.notes file
(setq remember-handler-functions
       '(remember-append-to-file))
; === Setnu ===
   ; Automagical line numbering for text mode
(autoload 'setnu-mode "~/.emacs.d/setnu+.el" "Minor mode for
    numbering lines for text." t)
   (add-hook 'text-mode-hook 'setnu-mode)
; === Browse Kill Ring === (autoload 'browse-kill-ring "~/.emacs.d/browse-kill-ring.el" "Enables
   opening up of kill-ring in a buffer" t)
; === Flyspell === (require 'flyspell) (defun turn-on-flyspell-mode () (flyspell-mode 1))
   (defun turn-off-flyspell-mode () (flyspell-mode 0))
   (setq flyspell-highlight-properties t
       flyspell-multi-language-p nil
       flyspell-issue-welcome-flag nil)
(defun turn-on-flyspell-prog-mode () (interactive)
     (if (fboundp 'flyspell-prog-mode)
       (flyspell-prog-mode)
       (setq p-flyspell-restricted-checking t)
       (flyspell-mode 1)))
(when (and (>= emacs-major-version 20) window-system)
     (add-hook 'mail-send-hook 'turn-off-flyspell-mode)
     (add-hook 'text-mode-hook 'turn-on-flyspell-mode)
     (add-hook 'tex-mode-hook 'turn-on-flyspell-mode t)
     (add-hook 'mail-setup-hook 'turn-on-flyspell-mode)
     (add-hook 'fundamenal-mode-hook 'turn-on-flyspell-mode t)
     (add-hook 'log-mode-hook 'turn-on-flyspell-mode t)
     (add-hook 'math-edit-mode-hook 'turn-on-flyspell-prog-mode t)
     (add-hook 'verilog-mode-hook 'turn-on-flyspell-prog-mode t)
     (add-hook 'perl-mode-hook 'turn-on-flyspell-prog-mode t)
     (add-hook 'tcl-mode-hook 'turn-on-flyspell-prog-mode t)
     (add-hook 'c-mode-hook 'turn-on-flyspell-prog-mode t)
     (add-hook 'postscript-mode-hook 'turn-on-flyspell-prog-mode t)
     (add-hook 'c++-mode-hook 'turn-on-flyspell-prog-mode t)
     (add-hook 'sh-mode-hook 'turn-on-flyspell-prog-mode t)
     (add-hook 'emacs-lisp-mode-hook 'turn-on-flyspell-prog-mode t))
(defvar p-flyspell-restricted-checking nil
     "If not nil, flyspell only checks spelling in comments and strings.")
   (make-variable-buffer-local 'p-flyspell-restricted-checking)
(defadvice flyspell-get-word
     (after checkable first activate)
     "Return nil instead of word if checking restricted and not in comment
   or string.
Spell check is restricted if p-flyspell-restricted-checking non-nil.
   Word considered to be in comment or string if face property is set
   to font-lock-comment-face or font-lock-string-face."
     (setq ad-return-value
       (if (and p-flyspell-restricted-checking
       ad-return-value
      (not (member (get-text-property (car (cdr ad-return-value))
     `face)
       (list 'font-lock-comment-face
       'font-lock-string-face))))
       nil
      ad-return-value)))
(if (fboundp 'flyspell-prog-mode)
     (ad-deactivate 'flyspell-get-word));
(dolist (hook '(text-mode-hook))
     (add-hook hook (lambda () (flyspell-mode 1))))
   (dolist (hook '(change-log-mode-hook log-edit-mode-hook))
   (add-hook hook (lambda () (flyspell-mode -1))))
; === Accidental Closure Avoidance ===
   ; Saves you from exiting Emacs accidentally, prompts you to be sure.
   ;http://www.dotemacs.de/dotfiles/KilianAFoth.emacs.html
(global-set-key [(control x) (control c)]
     (function
      (lambda () (interactive)
      (cond ((y-or-n-p "Quit? ")
       (save-buffers-kill-emacs)))))
; === Cursor Color Modes ===
   ; Changes the cursor color to indicate which mode you're in.
(setq hcz-set-cursor-color-color "")
   (setq hcz-set-cursor-color-buffer "")
   (defun hcz-set-cursor-color-according-to-mode ()
     "change cursor color according to some minor modes."
     ;;set-cursor-color is somewhat costly, so we only call it when
     ;;needed:
     (let ((color
        (if buffer-read-only "black"
          (if overwrite-mode "red"
            "blue"))))
       (unless (and
            (string= color hcz-set-cursor-color-color)
            (string= (buffer-name) hcz-set-cursor-color-buffer))
         (set-cursor-color (setq hcz-set-cursor-color-color color))
         (setq hcz-set-cursor-color-buffer (buffer-name)))))
   (add-hook 'post-command-hook 'hcz-set-cursor-color-according-to-mode)
; === Clipper ===
   ; Creates a buffer for keeping frequently used bits of code, text in.
   ; A similar feature akin to a Windows editor NoteTab.
(global-set-key "\C-cci" 'clipper-insert) ; insert text clip at point
   (global-set-key "\C-ccc" 'clipper-create) ; create text clip
; === Framepop === (setq framepop-frame-parameters
        '((name . nil)      ; use buffer name
          (unsplittable . t)      ; always include this
          (menu-bar-lines . 0)      ; no menu bar
          (minibuffer . nil)       ;    or minubuffer
          (left . -1)       ; top left corner of screen,
          (top . 30)       ;    away from my main frame
          (width . 71)      ; narrower, so it fits nicely
          (background-color . "wheat")   ; buffer background color
          (foreground-color . "cornsilk")
          (font . "-*-courier-bold-o-*-*-12-*-*-*-m-*-*-*")))
(setq special-display-function 'framepop-special-display) (setq special-display-buffer-names
         '("*Shell Command Output*"  "*grep*" "*compilation*"))
; === Ibuffer === (setq ibuffer-formats '((mark modified read-only " " (name 16 16) " "
         (size 6 -1 :right) " " (mode 16 16 :center)
         " " (process 8 -1) " " filename)
          (mark " " (name 16 -1) " " filename))
         ibuffer-elide-long-columns t
         ibuffer-eliding-string "&")
; === Whitespace Nuke === (autoload 'nuke-trailing-whitespace "nuke-trailing-whitespace" nil t)
       (add-hook 'mail-send-hook 'nuke-trailing-whitespace)
       (add-hook 'write-file-hooks 'nuke-trailing-whitespace)
; === Silly Mail === (autoload 'sm-add-random-header "silly-mail" nil t)
      (add-hook 'mail-setup-hook 'sm-add-random-header)
      (add-hook 'mh-letter-mode-hook 'sm-add-random-header)
; === Load Abbrevs === (condition-case ()
         (quietly-read-abbrev-file)
          (file-error nil))
(add-hook 'MYMODE-mode-hook
          (lambda ()
          (setq abbrev-mode t)))
; === C, C++, Java Indentation === (defun my-c-mode-common-hook ()
          (c-set-offset +)))
        (add-hook 'c-mode-hook 'my-c-mode-common-hook)
; === Mode Alist === ; Line below is template for adding to atlist
   ; (setq auto-mode-alist (cons '("\\.BAR\\'" . FOO-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.txt\\'" . text-mode) auto-mode-alist))
   (setq auto-mode-alist (cons '("\\.c\\'" . cc-mode) auto-mode-alist))
   (setq auto-mode-alist (cons '("\\.pl\\'" . perl-mode) auto-mode-alist))
   (setq auto-mode-alist (cons '("\\.el\\'" . lisp-mode) auto-mode-alist))
   (setq auto-mode-alist (cons '("\\.html\\'" . html-helper-mode)
   auto-mode-alist))
(setq auto-mode-alist (cons '("\\.htm\\'" . html-helper-mode) auto-mode-alist))
   (setq auto-mode-alist (cons '("\\.m$" . matlab-mode) auto-mode-alist))
; === Odd Files ===
   ; Load all these odd files as text.
(setq auto-mode-alist (cons '("\\README\\' \\NOTES\\' \\INSTALL\\'
   \\COPYING\\' \\AUTHORS\\' \\CREDITS\\' \\CHANGELOG\\' " . text-mode)
   auto-mode-alist))
; === Encryption === Mail & News Settings === (load-library "mailcrypt")
   (mc-setversion "gpg")
   (setq mc-gpg-user-id "Benjamin Badgley")
(autoload 'mc-install-write-mode "mailcrypt" nil t)
        (autoload 'mc-install-read-mode "mailcrypt" nil t)
        (add-hook 'mail-mode-hook 'mc-install-write-mode)
; === Rmail === (add-hook 'rmail-show-message-hook 'mc-install-read-mode)
   (add-hook 'rmail-summary-mode-hook 'mc-install-read-mode)
(setq user-mail-address "mortecanine@peoplepc.com")
   (setq mail-host-address "pop3.peoplepc.com")
(setq mail-signature t) ; defaults to ~/.signature
   (setq user-mail-address "mortecanine@peoplepc.com")
   (setq smtpmail-default-smtp-server "smtpauth.peoplepc.com")
   (setq smtpmail-local-domain nil)
   (setq user-full-name "Ben Badgley")
   (setq send-mail-function 'smtpmail-send-it)
   (load-library "smtpmail")
   (load-library "supercite")
   (setq sc-nested-citation-p t)
(setenv "MAILHOST" "pop3.peoplepc.com")
   (setq rmail-pop-password-required t)
(setq rmail-primary-inbox-list
         '("po:mortecanine@peoplepc.com"
          "po:benbadge72@gmail.com" ))
; === rmail reply function (defun rmail-reply-t ()
          "Reply only to the sender of the current message. (See rmail-reply.)"
          (interactive)
          (rmail-reply t))
(add-hook 'rmail-mode-hook
          (lambda ()
          (define-key rmail-mode-map "r" 'rmail-reply-t)
          (define-key rmail-mode-map "R" 'rmail-reply)))
; === Gnus === (add-hook 'gnus-summary-mode-hook 'mc-install-read-mode)
   (add-hook 'message-mode-hook 'mc-install-write-mode)
   (add-hook 'news-reply-mode-hook 'mc-install-write-mode)
   (setq nntp-maximum-request 1)
   (setq gnus-nntp-server "news.peoplepc.com")
   (setq gnus-cache-directory "~/news/cache/")
   (setq gnus-home-directory "~/news/")
   (setq gnus-startup-file "~/news/.newsrc")
   (setq gnus-default-nntp-server "news.peoplepc.com")
   (setq gnus-user-full-name "Ben Badgley")
   (setq gnus-user-from-line "mortecanine@peoplepc.com")
   (setq message-default-news-headers
          "From: Ben Badgley <mortecanine@peoplepc.com>\nReply-To: Ben Badgley
    <mortecanine@peoplepc.com>\n")
   (setq gnus-use-generic-from "Ben Badgley")
   (setq mail-host-address "pop3.peoplepc.com")
   (setq gnus-local-organization "Don't need any")
   (setq gnus-secondary-select-methods '((nnml "")))
   (setq nnmail-pop-password-required t)(setq gnus-use-cache t)
   (setq message-yank-prefix ">")
; === Color Theme === (require 'color-theme)
   (color-theme-wheat) ; change color themes here
; === Time ===
   (setq display-time-24hr-format t)
   (setq display-time-day-and-date t)
   (display-time)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]