Skip to content

Latest commit

 

History

History
executable file
·
1823 lines (1302 loc) · 46.1 KB

init.org

File metadata and controls

executable file
·
1823 lines (1302 loc) · 46.1 KB

My Emacs Configurations

C-k to kill whole line

(setq kill-whole-line t)

Mark (select) all on S-C-SPC

(define-key global-map (kbd "S-C-SPC") 'mark-whole-buffer)

Map M-l to goto-line

(global-unset-key "\M-l")
(global-set-key "\M-l" 'goto-line)

Remap M-j, M-l to navigation

; (global-set-key "\M-i" 'previous-line)
(global-set-key "\M-j" 'backward-char)
; (global-set-key "\M-k" 'forward-line)
(global-set-key "\M-l" 'forward-char)

don’t kill my window setup

(setq org-agenda-window-setup 'current-window)

Changes all yes/no questions to y/n type

(fset 'yes-or-no-p 'y-or-n-p)

CScope

(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/cscope"))
(require 'cscope)
 (setq cscope-do-not-update-database t)

Confirm on exit

(setq confirm-kill-emacs 'y-or-n-p)

Key mappings for F1 key

  • State “TODO” from “” [2011-03-15 Tue 15:03]
(global-set-key [C-f1] 'help-for-help-internal)
(global-set-key [S-C-f1] 'mj-cycle-helps)
(global-set-key [f1] 'mj-cycle-helps)

Emacs default command modifications

(put 'upcase-region 'disabled nil)

Setup bbdb Contact Database

(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/bbdb-2.35/lisp"))
(require 'bbdb)
(bbdb-initialize)
(setq bbdb-north-american-phone-numbers-p nil
)

Visual config

Disable visible bell (for removing white square on OSX

Since I don’t like either the beep or the flashing white square (visible bell) the following is required to silence both (from here)

;; (setq visible-bell nil)
;; (setq ring-bell-function nil)

(defun my-bell-function ()
;; (unless (memq this-command
;;   	'(isearch-abort abort-recursive-edit exit-minibuffer
;;             keyboard-quit mwheel-scroll down up next-line previous-line
;;             backward-char forward-char next prior))
;;   (ding))
)
(setq ring-bell-function 'my-bell-function)

Smooth Scrolling

web

link

initialisation

(add-to-list 'load-path
             (concat dotfiles-dir "martyn/smooth-scrolling"))
(require 'smooth-scrolling)

adjust margin to 3 lines

(setq smooth-scroll-margin 3)

Color theme initialisation

Configure color-theme

(add-to-list 'load-path
             (concat dotfiles-dir "martyn/color-theme-6.6.0"))
(add-to-list 'load-path
             (concat dotfiles-dir "martyn/color-theme-6.6.0/themes"))
(require 'color-theme)
(eval-after-load "color-theme"
  '(progn
      (color-theme-initialize)))
;;     (color-theme-hober)))
;;     (color-theme-tangotango)))

web

github]]

configuration

Theme Faves

configuration

(add-to-list 'load-path
             (concat dotfiles-dir "martyn/martyn/theme-faves"))
(require 'theme-faves)
(add-hook 'window-setup-hook 'theme-faves-init)

(global-set-key [C-f7] 'theme-faves-audition-cycle-up)
(global-set-key [S-C-f7] 'theme-faves-audition-cycle-down)
(global-set-key [f7] 'theme-faves-cycle-up)
(global-set-key [S-f7] 'theme-faves-cycle-down)

Maximise frame at startup (hook)

;;(add-to-list 'load-path
;;             (concat dotfiles-dir "martyn/maxframe"))
;;  (require 'maxframe)
;;  (add-hook 'window-setup-hook 'maximize-frame t)
;;  (maximize-frame)

(defun toggle-fullscreen ()
  (interactive)
  (if (string= system-name "martyn-laptop")
    (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
  	    		 '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
    (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
  	    		 '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
    (add-hook 'window-setup-hook 'toggle-fullscreen)))

Inhibit scratch message

(setq initial-scratch-message nil)

Remove Paredit default from emacs-lisp mode hook

(turned on by emacs starter kit)

(remove-hook 'emacs-lisp-mode-hook 'turn-on-paredit nil)
hs-minor-modeert–activate-font-lock-keywordsac-emacs-lisp-mode-setuprun-coding-hookesk-remove-elc-on-saveturn-on-eldoc-mode

Add .emacs.d/martyn/martyn to load-path

(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/martyn"))

my-load-init-files function

(require 'my-load-init-files)

my-load-drill-files function

(require 'my-load-drill-files)

my-load-org-files function

(require 'my-load-org-files)

Emacs Customisation destination files

These are already defined in Starter Kit but are re-adjusted here to keep under my revision control…

loaddefs

(setq autoload-file (concat dotfiles-dir "martyn/loaddefs.el"))

custom

Customisations made using emacs Customizations go here…

(setq custom-file (concat dotfiles-dir "martyn/custom.el"))

Notification (todochiku / growl)

(when (string= "darwin" system-type)
 (add-to-list 'load-path
  (concat dotfiles-dir  "martyn/todochiku"))
 (require 'todochiku)
 (setq todochiku-icons-directory
  (concat dotfiles-dir  "martyn/todochiku/todochiku-icons"))
 (defun mj-notify-pomodoro-done ()
  (todochiku-message "Pomodoro"
"
  This Pomodoro Session is Complete

        Release Concentration

           Take a Break

" (todochiku-icon 'bell)))
  (add-hook 'org-timer-done-hook  'mj-notify-pomodoro-done))

Follow links with return

(setq org-return-follows-link t)

Add org-mode contrib/lisp files to load path

(add-to-list 'load-path "~/org-mode/contrib/lisp")

org-mode directory

(setq org-directory "~/.emacs-config/OrgData")

Org Agenda

Org Agenda Files

(setq org-agenda-files (quote (
   "~/.emacs-config/OrgData/diary.org"
   "~/ngpod/dev/ngpod.dev")))

org-drill

(require 'org-drill)
(setq org-learn-always-reschedule t)
(setq org-drill-use-visible-cloze-face-p t)
(setq org-drill-add-random-noise-to-intervals-p t)
(put 'scroll-left 'disabled nil)

\TODO keywords global setup

~/.emacs-config/OrgData/Images/TODO.png

(setq org-todo-keywords (quote ((sequence "TODO(t!)" "|" "DONE(d!/!)")
                                (sequence "WAITING(w@/!)"
                                "SOMEDAY(s!)"
                                "IGNORED"
                                "FAIL"
                                "PASS"
                                "MISSING"
                                "DEPRECATED"
                                "|" "CANCELLED(c@/!)"))))

(setq org-todo-keyword-faces
      (quote (("TODO"      :foreground "red"          :weight bold)
              ("DONE"      :foreground "forest green" :weight bold)
              ("WAITING"   :foreground "yellow"       :weight bold)
              ("SOMEDAY"   :foreground "goldenrod"    :weight bold)
              ("CANCELLED" :foreground "orangered"    :weight bold)
              ("EXPIRED"   :foreground "olivedrab1"   :weight bold)
              ("IGNORED"   :foreground "yellow"       :weight bold)
              ("FAIL"      :foreground "red"          :weight bold)
              ("MISSING"   :foreground "olivedrab1"   :weight bold)
              ("PASS"      :foreground "forest green" :weight bold)
              ("DEPRECATED":foreground "orangered"    :weight bold))))

Lilypond mode

 (add-to-list 'load-path
              (concat dotfiles-dir  "martyn/lilypond"))
(autoload 'LilyPond-mode "lilypond-mode" "LilyPond Editing Mode" t)
(add-to-list 'auto-mode-alist '("\\.ly$" . LilyPond-mode))
(add-to-list 'auto-mode-alist '("\\.ily$" . LilyPond-mode))

Setup org-mode (development)

(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
(global-font-lock-mode 1)                     ; for all buffers
(setq load-path (cons "~/org-mode" load-path))

Configure Babel languages

For Test

(org-babel-do-load-languages
 'org-babel-load-languages
   '((sh . t)(org . t)))

For production

Configured for…

  • Org
  • Ruby
  • Python
  • C
  • emacs-lisp
  • shell
  • graphviz
  • clojure
  • ditaa
  • lilypond
(org-babel-do-load-languages
 'org-babel-load-languages
 '((org . t)
   (ruby . t)
   (python . t)
   (R . t)
   (C . t)
   (emacs-lisp . t)
   (sh . t)
   (dot . t)
   (clojure . t)
   (ditaa . t)
   (lilypond . t)
   (plantuml . t)
   ))

(setq org-src-fontify-natively t) ;; color blocks

org-confirm-babel-evaluate

(setq org-confirm-babel-evaluate nil)

Display images in org mode

  ;; display images
  (local-set-key "\M-I" 'org-toggle-iimage-in-org)

;; -- Display images in org mode
;; enable image mode first
(iimage-mode)
;; add the org file link format to the iimage mode regex
(add-to-list 'iimage-mode-image-regex-alist
  (cons (concat "\\[\\[file:\\(~?" iimage-mode-image-filename-regex "\\)\\]")  1))
;;  add a hook so we can display images on load
(add-hook 'org-mode-hook '(lambda () (org-turn-on-iimage-in-org)))
;; function to setup images for display on load
(defun org-turn-on-iimage-in-org ()
  "display images in your org file"
  (interactive)
  (turn-on-iimage-mode)
  (set-face-underline-p 'org-link nil))
;; function to toggle images in a org bugger
(defun org-toggle-iimage-in-org ()
  "display images in your org file"
  (interactive)
  (if (face-underline-p 'org-link)
      (set-face-underline-p 'org-link nil)
      (set-face-underline-p 'org-link t))
  (call-interactively 'iimage-mode))

Org Attach Directory

(setq org-attach-directory "~/.emacs-config/OrgData/attach-directory")

Don’t insert blank lines on org heading generation

(setq org-blank-before-new-entry nil)

Auto-Complete

To load

M-x load-file RET file to load: ~/.emacs.d/martyn/auto-complete/etc/install.el destination: ~/.emacs.d/martyn/auto-complete/installation

Add to init

(add-to-list 'load-path "~/.emacs.d/martyn/auto-complete/installation")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/martyn/auto-complete/installation/ac-dict")
(ac-config-default)

Screencast

YouTube

Redo+

This appears to be an upgrade of redo (although I never had any problems with redo). I shall monitor this!

web

emacswiki older-redo

configuration

(add-to-list 'load-path (concat dotfiles-dir "martyn/redoplus"))
(require 'redo+)

Make C-z undo, and M-z redo

(define-key global-map (kbd "M-z") 'redo)
(define-key global-map (kbd "C-z") 'undo)

Yasnippet

(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/yasnippet-read-only"))
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)

(setq yas/root-directory
      '(
     ;; "~/.emacs.d/martyn/martyn/unity-mode/snippets"
        "~/.emacs.d/martyn/martyn/snippets"
        "~/.emacs.d/martyn/martyn/snippets/yasnippet-org-mode-fork/snippets"
     ;; "~/.emacs.d/martyn/yasnippets-rails/rails-snippets"
        "~/.emacs.d/martyn/yasnippet-read-only/snippets"))

;; Load the snippets (NOTE: the mapc required for multiple directories)
;; (Map `yas/load-directory' to every element)

(mapc 'yas/load-directory yas/root-directory)

HideShow

Website

emacsWiki/hideshow

HideShow Configuration

(add-hook 'c-mode-common-hook   'hs-minor-mode)
    (add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)
    (add-hook 'java-mode-hook       'hs-minor-mode)
    (add-hook 'lisp-mode-hook       'hs-minor-mode)
    (add-hook 'perl-mode-hook       'hs-minor-mode)
    (add-hook 'sh-mode-hook         'hs-minor-mode)

  (defun me-toggle-hiding-all()
  "Fast cycling of all folded all unfolded utilising
   hideshow minor mode hs-minor-mode"
  (interactive)
  (defvar me-hideshow-active nil)
  (setq me-hideshow-active
    (if me-hideshow-active
        (progn (hs-show-all) nil)
      (progn (hs-hide-all) t))))

  ; add hook for hideshow minor mode
  (add-hook 'lisp-mode-hook 'hs-minor-mode)
  (global-set-key [f3] 'hs-toggle-hiding)
  (global-set-key [C-f3] 'me-toggle-hiding-all)

hideshow.org

Website

github/hideshow-org

Configuration

(add-to-list 'load-path (concat dotfiles-dir "martyn/hideshow-org"))
(require 'hideshow-org)

To byte-compile-file

Lusty Explorer

emacswiki

emacswiki

Github

lusty-emacs

Config

(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/lusty-emacs"))
(require 'lusty-explorer)
(define-key global-map (kbd "C-x C-d") 'lusty-file-explorer)

To byte-compile-file

NOTE: lusty-explorer.el doesn’t want to compile

Map C-x C-o to other window (as C-x o)

(global-set-key [C-x-o] 'other-window)

lua-mode

(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/lua-mode/testing/lisp"))
(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/lua-mode/lisp"))
(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/lua-mode/testing/examples"))
(autoload 'lua-mode "lua-mode" "Lua editing mode." t)
(add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
(add-to-list 'interpreter-mode-alist '("lua" . lua-mode))
(setq lua-default-application "/opt/local/bin/lua")

Setup generic browser

(if (string= "darwin" system-type)
    (setq browse-url-browser-function 'browse-url-generic
      browse-url-generic-program "open")
  (setq browse-url-browser-function 'browse-url-generic
    browse-url-generic-program "conkeror"))

Setup MacGPG2 (for gpg) on mac OSX

(when (string= "darwin" system-type)
  (setq epg-gpg-program "/usr/local/MacGPG2/bin/gpg2")
  (message "MacGPG2 set up"))

Make Password

(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/make-password"))

(require 'make-password)
(defalias 'mj-generate-password 'make-password)
(defalias 'generate-password 'make-password)

mj-versions

(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/martyn/mj-versions"))
(require 'mj-versions)

my-org-test-setup

(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/martyn/my-org-test-setup"))
(require 'my-org-test-setup)

my-header-arguments

(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/martyn/my-header-arguments"))
(require 'my-header-arguments)

help-page

(add-to-list 'load-path
             (concat dotfiles-dir  "martyn/martyn/help-page"))
(require 'help-page)
  (defalias 'hp 'help-page)

Setup IRC user info and channels

(setq erc-header-line-format nil)
(setq erc-hide-list '("JOIN" "PART" "QUIT"))

(setq erc-log-channels-directory t)
(setq erc-log-file-name-function "~/erc")
(setq erc-truncate-buffer-on-save t)
(setq erc-nick "mjago")

Boxquote

(add-to-list 'load-path
 (concat dotfiles-dir "martyn/boxquote"))
(require 'boxquote)

lorem-ipsum

(add-to-list 'load-path
 (concat dotfiles-dir "martyn/lorem-ipsum"))
(require 'lorem-ipsum)

magit-hide-diffs

(setq magit-hide-diffs t)

ispell

(setq ispell-program-name "/opt/local/bin/ispell")
(require 'ispell)

ess

(add-to-list
 'load-path
  (concat dotfiles-dir "martyn/ess-5.14/lisp/"))
(require 'ess-site)

Message buffer size

(setq message-log-max 2000)

MPC

(setq mpc-mode-map
  (let ((map (make-keymap)))
    (suppress-keymap map)
    ;; (define-key map "\e" 'mpc-stop)
    (define-key map "q" 'mpc-quit)
    (define-key map "\r" 'mpc-select)
    (define-key map [(shift return)] 'mpc-select-toggle)
    (define-key map [mouse-2] 'mpc-select)
    (define-key map [S-mouse-2] 'mpc-select-extend)
    (define-key map [C-mouse-2] 'mpc-select-toggle)
    (define-key map [drag-mouse-2] 'mpc-drag-n-drop)
    ;; We use `always' because a binding to t is like a binding to nil.
    (define-key map [follow-link] 'always)
    ;; Doesn't work because the first click changes the buffer, so the second
    ;; is applied elsewhere :-(
    ;; (define-key map [(double mouse-2)] 'mpc-play-at-point)
    (define-key map "x" 'mpc-play)
    (define-key map "X" 'mpc-play-at-point)
    (define-key map "s" 'mpc-pause)
    (define-key map "S" 'mpc-stop)
    (define-key map "n" 'mpc-next)
    (define-key map "p" 'mpc-prev)
    (define-key map "f" 'mpc-ffwd)
    (define-key map "b" 'mpc-rewind)
    map))
  (defalias 'music 'mpc)

Under Test

Split frame four ways

  (defun mj-split-four-ways ()
    (interactive)
    (delete-other-windows)
    (split-window-horizontally)
    (split-window-vertically 15)
    (other-window 2)
    (split-window-vertically 15)
    (other-window -1))
;; key defined in `map C-t to my configs'

map C-t to my configs

Unset default \C-t (transpose-chars)

(global-unset-key "\C-t")

Org TODO list (\C-t t)

(defun mj-org-todo-list   ()
  (interactive)
  (when (boundp 'org-agenda-sticky)
    (setq org-agenda-sticky t))
  (org-todo-list 0))
 (global-set-key "\C-tt" 'mj-org-todo-list)
 (global-set-key "\C-t\C-t" 'mj-org-todo-list)
  

Touch /ngpod/test/touch.c (\C-t z)

   
(defun mj-touch ()
(interactive)
  (shell-command "touch ~/ngpod/test/touch.c"))
  (global-set-key "\C-tz" 'mj-touch)

(mj-touch)

Map mj-split-four-ways

  
(global-set-key "\C-ts" 'mj-split-four-ways)

Other window (make \C-co duplicate of \C-xo)

(defun mj-other-window ()
(interactive)
  (other-window 1 nil))
(global-set-key "\C-co" 'mj-other-window)

gnus windows

(setq gnus-use-full-window nil)

auto-revert-interval

(global-auto-revert-mode 1)
(setq auto-revert-interval 1)

wdired (aliased to dired-edit)

(defalias 'dired-edit 'wdired-change-to-wdired-mode)

plantuml

(setq org-plantuml-jar-path "~/plantuml/plantuml.jar")

ansi-color

(add-to-list
 'load-path
  (concat dotfiles-dir "martyn/ansi-color"))
(require 'ansi-color)

grep-scroll-output

(setq grep-scroll-output t)

mj-date-time

(defun mj-date-time()
  (interactive)
  (message "%S" (shell-command "date" t )))

Sha1 Generate

Generate sha1 of selected region

(load-file (concat dotfiles-dir "martyn/martyn/sha1/sha1.el"))

debug python html export bug

(setq org-babel-python-command "python2.6")

org-export investigation

(require 'org-export)

lower-case keywords in orgmode

ref: Bernt Hansen (Re: Capitalisation and good taste ?)

(setq org-babel-results-keyword "results")

(setq org-structure-template-alist
      (quote (("s" "#+begin_src ?\n\n#+end_src" "<src lang=\"?\">\n\n</src>")
              ("e" "#+begin_example\n?\n#+end_example" "<example>\n?\n</example>")
              ("q" "#+begin_quote\n?\n#+end_quote" "<quote>\n?\n</quote>")
              ("v" "#+begin_verse\n?\n#+end_verse" "<verse>\n?\n/verse>")
              ("c" "#+begin_center\n?\n#+end_center" "<center>\n?\n/center>")
              ("l" "#+begin_latex\n?\n#+end_latex" "<literal style=\"latex\">\n?\n</literal>")
              ("L" "#+latex: " "<literal style=\"latex\">?</literal>")
              ("h" "#+begin_html\n?\n#+end_html" "<literal style=\"html\">\n?\n</literal>")
              ("H" "#+html: " "<literal style=\"html\">?</literal>")
              ("a" "#+begin_ascii\n?\n#+end_ascii")
              ("A" "#+ascii: ")
              ("i" "#+index: ?" "#+index: ?")
              ("I" "#+include %file ?" "<include file=%file markup=\"?\">"))))

continuous-testing

  • State “TODO” from “” [2011-12-17 Sat 15:24]
(load-file (concat dotfiles-dir "martyn/martyn/continuous-testing/lib/continuous-testing.el"))

shen-mode

(add-to-list
 'load-path
  (concat dotfiles-dir "martyn/shen-mode"))

disable org-use-speed-commands (default)

(setq org-use-speed-commands nil)

Make windmove work in org-mode

(add-hook 'org-shiftup-final-hook 'windmove-up)
(add-hook 'org-shiftleft-final-hook 'windmove-left)
(add-hook 'org-shiftdown-final-hook 'windmove-down)
(add-hook 'org-shiftright-final-hook 'windmove-right)

; Targets complete in steps so we start with filename, TAB shows the next level of targets etc (setq org-outline-path-complete-in-steps t)

; Allow refile to create parent tasks with confirmation (setq org-refile-allow-creating-parent-nodes (quote confirm))

; Use IDO only for buffers ; set ido-mode to buffer and ido-everywhere to t via the customize interface ; ‘(ido-mode (quote both) nil (ido)) ; ‘(ido-everywhere t)

Fix tab in org mode

Not sure this is of any benefit anymore!

;; fix tab
(local-set-key "\C-y" 'yank)

One-touch timestamps

Fast TODO key selection

(setq org-treat-S-cursor-todo-selection-as-state-change nil)

Configure org-mobile

(setq org-mobile-directory "~/.emacs-config/MobileOrg")
(setq org-mobile-files org-agenda-files)
(setq org-mobile-inbox-for-pull "~/.emacs-config/OrgData/inbox.org")

my-run-drills function (doesn’t work yet)

(defun my-run-drills ()
"Function to run all drills that exist in agenda files"
 (interactive)
 (org-drill 'agenda))

(provide 'my-run-drills)

Setup org-capture

Setup capture location and key

(setq org-default-notes-file "~/.emacs-config/OrgData/capture.org")
(define-key global-map "\C-cc" 'org-capture)

(setq org-capture-templates
      '(("t" "Agenda Todo" entry
         (file+datetree+prompt "~/.emacs-config/OrgData/diary.org")
;;	 "\n\n** TODO %?\n%T\n\n%i\n%a\n\n\n"
	 "\n\n** TODO %?\n%t\n\n"
	 :empty-lines 1)))

;;	("n" "Agenda Notes" entry
;;	 (file+headline "~/.emacs-config/OrgData/diary.org" "Agenda")
;;	 "\n\n** %?\n%T\n%i\n%a\n\n\n"
;;	 :empty-lines 1))

Setup capture templates

Setup refile targets

; Use IDO for target completion
(setq org-completion-use-ido t)

; Targets include this file and any file contributing to the agenda - up to 5 levels deep
(setq org-refile-targets (quote ((org-agenda-files :maxlevel . 5) (nil :maxlevel . 5))))

; Targets start with the file name - allows creating level 1 tasks
;; TESTING (setq org-refile-use-outline-path (quote file))

Org Agenda Custom Commands

(defun run-todo-unscheduled ()
"agenda of unscheduled todos"
(interactive)
(setq org-agenda-todo-ignore-scheduled t)
(org-todo-list '("t"))
(setq org-agenda-todo-ignore-scheduled nil))

(provide 'run-todo-unscheduled)

 (setq org-agenda-custom-commands
           '(("e" todo "-SCHEDULED")
             ("W" todo-tree "WAITING")
             ("u" tags "+boss-urgent")
             ("v" tags-todo "+boss-urgent")
             ("U" tags-tree "+boss-urgent")
             ("f" occur-tree "\\<FIXME\\>")
             ("hl" tags "+home+Lisa")
             ("hp" tags "+home+Peter")
             ("hk" tags "+home+Kim")))
(setq org-agenda-custom-commands
      (quote (("w" "Tasks waiting on something" tags "WAITING/!"
               ((org-use-tag-inheritance nil)
                (org-agenda-todo-ignore-scheduled nil)
                (org-agenda-todo-ignore-deadlines nil)
                (org-agenda-todo-ignore-with-date nil)
                (org-agenda-overriding-header "Waiting Tasks")))
              ("r" "Refile New Notes and Tasks" tags "LEVEL=1+REFILE"
               ((org-agenda-todo-ignore-with-date nil)
                (org-agenda-todo-ignore-deadlines nil)
                (org-agenda-todo-ignore-scheduled nil)
                (org-agenda-overriding-header "Tasks to Refile")))
              ("N" "Notes" tags "NOTE"
               ((org-agenda-overriding-header "Notes")))
              ("p" "Projects" tags-todo "LEVEL=2-REFILE|LEVEL=1+REFILE/!-DONE-CANCELLED"
               ((org-agenda-skip-function 'bh/skip-non-projects)
                (org-agenda-overriding-header "Projects")))
              ("o" "Other (Non-Project) tasks" tags-todo "LEVEL=2-REFILE|LEVEL=1+REFILE/!-DONE-CANCELLED"
               ((org-agenda-skip-function 'bh/skip-projects)
                (org-agenda-overriding-header "Other Non-Project Tasks")))
              ("A" "Tasks to be Archived" tags "LEVEL=2-REFILE/DONE|CANCELLED"
               ((org-agenda-overriding-header "Tasks to Archive")))
              ("h" "Habits" tags "STYLE=\"habit\""
               ((org-agenda-todo-ignore-with-date nil)
                (org-agenda-todo-ignore-scheduled nil)
                (org-agenda-todo-ignore-deadlines nil)
                (org-agenda-overriding-header "Habits")))
              ("#" "Stuck Projects" tags-todo "LEVEL=2-REFILE|LEVEL=1+REFILE/!-DONE-CANCELLED"
               ((org-agenda-skip-function 'bh/skip-non-stuck-projects)
                (org-agenda-overriding-header "Stuck Projects")))
              ("c" "Select default clocking task" tags "LEVEL=2-REFILE"
               ((org-agenda-skip-function
                 '(org-agenda-skip-subtree-if 'notregexp "^\\*\\* Organization"))
                (org-agenda-overriding-header "Set default clocking task with C-u C-u I"))))))

Unity Mode

load path and speed keys

 (add-to-list
  'load-path
   (concat dotfiles-dir "martyn/martyn/unity-mode"))
 (require 'unity-mode)
 ;(add-hook 'c-mode-hook 'unity-mode)

(global-set-key [f5] 'unity-find-and-open-a-primative-match-forward)
(global-set-key [S-f5] 'unity-find-and-open-a-primative-match-reverse)
(global-set-key [C-f5] 'unity-cycle-MCH-buffer)
(global-set-key [f6] 'unity-cycle-alpha-ascending)
(global-set-key [S-f6] 'unity-cycle-alpha-descending)

unity-project ()

  (defun unity-project ()
    (interactive)
    (find-file "~/.emacs.d/martyn/martyn/unity-mode/unity-parse-project-file.el")
    (find-file "~/.emacs.d/martyn/martyn/unity-mode/unity-auto-config.el")
    (delete-other-windows)
    (split-window-horizontally)
    (windmove-right)
    (find-file "~/.emacs.d/martyn/martyn/unity-mode/unity-mode.el")
    (windmove-left)
;;    (find-file "~/.emacs.d/martyn/martyn/unity-mode/unity-mode-tests.el")
    (switch-to-buffer "#emacs")
    (split-window-vertically)
    (switch-to-buffer "*ert*")
    (windmove-down)
    (switch-to-buffer "#emacs"))

unity-eval-src-and-tests ()

(defun unity-eval-src-and-tests ()
  (interactive)
  (let ((original-buffer buffer-file-name)
        (original-window (selected-window)))

    (if(string-match "^unity-" (file-name-nondirectory original-buffer))
        (progn
          (eval-buffer "unity-mode-tests.el")
          (eval-buffer "unity-mode.el")
          (ert t)))
    (select-window original-window)))
;; (error "%s" (windmove-find-other-window 'right))
;;     (if(equal original-buffer (windmove-find-other-window 'right))
;;         (windmove-right)
;;       (windmove-down))))

unity-project-org()

Moved to unity-mode.el

;   (global-set-key [f4] 'unity-eval-src-and-tests)
;   (global-set-key [C-f4] 'unity-switch-src-control-file)
;   (global-set-key [C-c C-v] 'eval-region)

Develop group agenda to show unscheduled TODO items

Suggestions

Setup for latex / pdf export of org-mode

  1. NOTE: remember ubuntu requires texlive-latex-extra for this
  2. NOTE: also required ttf-marvosym
  3. For missing packages try searching here and apt-get install package
  4. Useful latex prettifying link
;; remember ubuntu requires texlive-latex-extra for this

(require 'org-latex)
(setq org-export-latex-listings t)
(add-to-list 'org-export-latex-packages-alist '("" "listings"))
(add-to-list 'org-export-latex-packages-alist '("" "color"))

Setup for Auctex (ongoing)

;; Setup gleaned from here ;; #+begin_src emacs-lisp :results silent ;; ;; ;; AUCTeX ;; (setq TeX-auto-save t) ;; (setq TeX-parse-self t) ;; ;set up AUCTeX to deal with multiple file documents. ;; (setq-default TeX-master nil) ;; ;turn on pdf-mode. AUCTeX will call pdflatex to compile instead of latex. ;; (add-hook ‘LaTeX-mode-hook ‘TeX-PDF-mode) ;; ;turn on flyspell mode - this will automatically spell check the document in LaTex-mode ;; (add-hook ‘LaTeX-mode-hook ‘flyspell-mode) ;; ;; ; allow for export=>beamer by placing ;; ;; #+LaTeX_CLASS: beamer in org files ;; (unless (boundp ‘org-export-latex-classes) ;; (setq org-export-latex-classes nil)) ;; (add-to-list ‘org-export-latex-classes ;; ;; beamer class, for presentations ;; ‘(“beamer” ;; “\documentclass[11pt]{beamer}\n ;; \mode<{{{beamermode}}}>\n ;; \usetheme{{{{beamertheme}}}}\n ;; \usecolortheme{{{{beamercolortheme}}}}\n ;; \beamertemplateballitem\n ;; \setbeameroption{show notes} ;; \usepackage[utf8]{inputenc}\n ;; \usepackage[T1]{fontenc}\n ;; \usepackage{hyperref}\n ;; \usepackage{color} ;; \usepackage{listings} ;; \lstset{numbers=none,language=[ISO]C++,tabsize=4, ;; frame=single, ;; basicstyle=\small, ;; showspaces=false,showstringspaces=false, ;; showtabs=false, ;; keywordstyle=\color{blue}\bfseries, ;; commentstyle=\color{red}, ;; }\n ;; \usepackage{verbatim}\n ;; \institute{{{{beamerinstitute}}}}\n ;; \subject{{{{beamersubject}}}}\n” ;; org-beamer-sectioning ;; (“\section{%s}” . “\section*{%s}”) ;; (“\begin{frame}[fragile]\frametitle{%s}” ;; “\end{frame}” ;; “\begin{frame}[fragile]\frametitle{%s}” ;; “\end{frame}”) ;; )) ;; ;; ;; Set up skeletons (see below) in a menu in ORG MODE mode ;; (defvar org-org-menu) ;; (add-hook ‘org-mode-hook ;; (lambda () (easy-menu-add-item org-org-menu nil [“Skeletons” nil t]) ;; (easy-menu-add-item org-org-menu ‘(“Skeletons”) [“Beamer Theme” orgmode-beamer-my-skeleton t]))) ;; (define-skeleton orgmode-beamer-my-skeleton ;; “inserts a simple orgmode-beamer template skeleton - use C-c C-e d to build the pdf” ;; nil ;; “#+LaTeX_CLASS: beamer\n” ;; “#+MACRO: BEAMERMODE presentation\n” ;; “#+MACRO: BEAMERCOLORTHEME dove\n” ;; “#+MACRO: BEAMERSUBJECT RMRF\n” ;; “#+BEAMER_FRAME_LEVEL: 2\n” ;; “#+COLUMNS: %35ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)\n” ;; “#+OPTIONS: tags:nil\n” ;; “#+MACRO: BEAMERINSTITUTE My Affiliation\n” ;; “#+AUTHOR: Tudor-Ioan Salomie\n” ;; “\n” ;; “#+TITLE: Presentation title\n” ;; “\n” ;; “\n” ;; “* My Section\n” ;; “\n” ;; “** Frame 1 \\ with a subtitle\n” ;; “\n” ;; “*** Idea\n” ;; “\n” ;; “#+begin_LaTeX\n” ;; “\n” ;; “#+end_LaTeX\n” ;; “\n\n\n” ;; ) ;; ;; ;; #+end_src ;; ;; #+results: ;; : orgmode-beamer-my-skeleton ;;

Setup Clocking work time

(setq org-clock-persist 'history)
     (org-clock-persistence-insinuate)

Function mj-diary-org opens diary.org

(defun mj-diary-org()
  "Fast route to diary.org"
  (interactive)
  (find-file "~/.emacs-config/OrgData/diary.org"))

Function mj-ng-pod-dev opens ng-pod.dev

(defun mj-ng-pod-dev()
  "Fast route to ng-pod.dev"
  (interactive)
  (find-file "~/ngpod/dev/ng-pod.dev"))
(defun mj-init-org()
  "Fast route to init.org"
  (interactive)
  (find-file "~/.emacs.d/martyn/init.org"))
(defun mj-org-agenda ()
  (interactive)
  (org-agenda nil "a"))

Function mj-cycle-helps opens mj-helps

(defun mj-cycle-helps()
  (interactive)
  (unless (boundp 'mj-current-help)
    (setq mj-current-help nil))
(cond
      ((equal (buffer-name) "diary.org")
       (bury-buffer "diary.org")
       (setq mj-current-help 'mj-ng-pod-dev))
      ((equal (buffer-name) "ng-pod.dev")
       (bury-buffer "ng-pod.dev")
       (setq mj-current-help 'mj-org-agenda))
      ((equal (buffer-name) "*Org Agenda*")
       (org-agenda-quit)
       (setq mj-current-help 'help-page))
      ((equal (buffer-name) "help.org")
       (bury-buffer "help.org")
       (setq mj-current-help 'mj-init-org))
      (t (setq mj-current-help 'mj-diary-org)))
  (message "%S" mj-current-help)
(funcall mj-current-help))

Flyspell mode error avoidance

web discussion

stackoverflow launchpad

configuration

;; (require ‘ispell) ;; (setq-default ispell-program-name “/usr/local/lib/aspell-0.60.6/aspell”) ;; (setq ispell-really-aspell t) ;; (setq ispell-dictionary “/usr/local/lib/aspell6-en-7.1-0/english”) ;; ;;# sudo rm /usr/share/emacs/site-lisp/dictionaries-common/debian-ispell.el ;;# sudo rm /usr/share/emacs/site-lisp/dictionaries-common/flyspell.el ;;# sudo rm /usr/share/emacs/site-lisp/dictionaries-common/ispell.el ;;# cd /usr/share/emacs23/site-lisp/dictionaries-common ;;# sudo rm *.el *.elc ;; the above didn’t work for me so…

(unload-feature ‘flyspell-mode) ;;neither did this! (not loaded)

##+end_src

DEPRECATED ERT setup

#

#

Graphviz-dot-mode

(load-file  (concat dotfiles-dir  "martyn/graphviz-dot-mode/graphviz-dot-mode.el"))

Graphviz in babel doesn’t appear to be implemented

org-contacts

(require 'org-contacts)

 (custom-set-variables
 '(org-contacts-files '("~/.emacs-config/OrgData/contacts.org")))

;; ("c" "Contacts" entry (file "~/Org/contacts.org")
;;  "* %(org-contacts-template-name)
;; :PROPERTIES:
;; :EMAIL: %(org-contacts-template-email)
;; :END:")

Yasnippet for rails

;; (add-to-list 'load-path
;;    (concat dotfiles-dir "/martyn/yasnippets-rails"))

;; (add-hook 'ruby-mode-hook ; or rails-minor-mode-hook ?
;;           '(lambda ()
;;              (make-variable-buffer-local 'yas/trigger-key)
;;              (setq yas/trigger-key [tab])))

;; (require 'yasnippet)
;; ;;(add-to-list 'yas/extra-mode-hooks
;; ;;             'ruby-mode-hook)

;; (yas/initialize)
;; (setq yas/window-system-popup-function 'yas/x-popup-menu-for-template)

;; ;;(yas/load-directory
;; ;;   (concat
;; ;;      dotfiles-dir "/martyn/snippets/yasnippets-rails/rails-snippets/"))
;; ;;(make-variable-buffer-local 'yas/trigger-key)

;; ;; yasnippet-org-mode
;; (yas/load-directory
;;    (concat
;;       dotfiles-dir "/martyn/snippets/yasnippet-org-mode/"))

   ;; yasnippet (allow yasnippet to do it's thing in org files)
;;   (make-variable-buffer-local 'yas/trigger-key)
;;   (setq yas/trigger-key [tab])
;;   (define-key yas/keymap [tab] 'yas/next-field-group)))

Highlight Parantheses

Site

site

Setup

(add-to-list 'load-path (concat dotfiles-dir
  "martyn/highlight-parentheses"))
(require 'highlight-parentheses)

S-C-d to backward-delete-char() - doesn’t work!!

(global-set-key [C-S-d] 'backward-delete-char)

backward-kill-line (SHIFT CTRL K)

(defun mj-backward-kill-line ()
  (interactive)
  (if (bolp)
      (progn (previous-line)
             (org-kill-line))
    (let ((here (point)))
      (beginning-of-line)
      (kill-region (point) here))))

(global-set-key (kbd "C-M-k") 'mj-backward-kill-line)

doremi-frm

Comment or uncomment region with M-k

(global-set-key "\M-k" 'comment-or-uncomment-region)

column-number-mode

Re: emacs and gnome-terminal (Anonymous) 2008-05-20 04:51 am UTC (link) Not a bug fix, but this seems to make the problem go away.

Turn on column-number-mode.

You can put the following into your ~/.emacs to have it on on loading

(setq-default column-number-mode t)
(setq cursor-type 'hbar)
(set-cursor-color  "white")

Remap C-j to my custom goto-next-line function

;; function here

elpa

;;#+begin_src emacs-lisp :results silent ;;(setq package-user-dir (concat dotfiles-dir “martyn/elpa”)) ;;#+end_src

Mode-compile

Setup Mode-compile (emacs-wiki)

  ;;mode-compile
  (autoload 'mode-compile "mode-compile"
    "Command to compile current buffer file based on the major mode" t)
;;  (global-set-key "\C-cc" 'mode-compile)
  (autoload 'mode-compile-kill "mode-compile"
    "Command to kill a compilation launched by `mode-compile'" t)
;;  (global-set-key "\C-ck" 'mode-compile-kill)

Ruby

(needs sorting) need to run rvm-autodetect-ruby to get ruby to work in babel

(add-to-list 'load-path (concat dotfiles-dir "martyn/rvm/rvm.el/"))
(require 'rvm)
(rvm-activate-corresponding-ruby)
(rvm-autodetect-ruby)
(rvm-use "1.9.2" "default")

Setup rspec-mode (development)

(add-to-list 'load-path (concat dotfiles-dir "martyn/rspec-mode"))

Kill to start of line

(defun mj-kill-to-start-of-line ()
"kill from point to start of line"
(interactive)
(kill-line 0)
)
(global-set-key [C-j]  'mj-kill-to-start-of-line)

Environment Path additions

; sane path
(setq path "/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/mysql/bin:/usr/texbin/")
(setenv "PATH" path)

Initial display

Display diary org and agenda

“martyn-laptop” system specific…

  • NOTE: Currently loads ALL org files - might consider just “tracked” org files
  • Switch to diary.org
  • Bring up schedule agenda in other window
(defun me-startup-in-agenda ()
  (if (string= system-name "martyn-laptop")
      (progn
        (split-window-horizontally)
        (my-load-org-files)
        (switch-to-buffer "diary.org")
        (org-agenda-list))))

(add-hook 'window-setup-hook 'me-startup-in-agenda)

Delete temp file martyn/init.el

(delete-file "~/.emacs.d/martyn/init.el")
(setq org-export-directory "~/.emacs-config/OrgData/html")