X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=.emacs;h=30f236cdb5f5e404fb5d5cc1ba6e7f5d1f0cd943;hb=e16f281abea7aba06e2e60dd6fef7faafd22c7d2;hp=535c48410a77a4e1784217eedead8e6d2681cb8e;hpb=055d581b10f5811f6b519c2baaeb6b8576501116;p=emacs.git diff --git a/.emacs b/.emacs index 535c484..30f236c 100644 --- a/.emacs +++ b/.emacs @@ -1,15 +1,15 @@ (custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. '(bibtex-user-optional-fields (quote (("annote" "Personal annotation (ignored)") ("abstract" "") ("pmid" "") ("doi" "")))) '(calendar-latitude [33 57 north]) '(calendar-longitude [117 24 west]) '(case-fold-search t) '(confirm-kill-emacs (quote y-or-n-p)) '(cperl-lazy-help-time nil) - '(debian-changelog-mailing-address "don@debian.org") + '(debian-changelog-mailing-address "don@debian.org" t) '(display-time t) '(display-time-24hr-format t) '(display-time-day-and-date t) @@ -48,6 +48,9 @@ '(vc-delete-logbuf-window nil) '(vc-follow-symlinks t)) +;; use git before SVN; use CVS earlier, because I have CVS +;; repositories inside of git directories +(setq vc-handled-backends (quote (CVS Git RCS SVN SCCS Bzr Hg Mtn Arch))) ;; switch back to the old primary selection method (setq x-select-enable-clipboard nil) @@ -94,10 +97,12 @@ "~/projects/origins_of_life/ool.org" "~/projects/sysadmin/sndservers/sndservers.org" "~/projects/chaim/chaim.org" + "~/projects/chaim/papers/gwas_paper_2012/gwas_paper.org" + "~/projects/reviews/reviews.org" "~/projects/fh/fh.org"))) (setq org-global-properties '(("Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00"))) -(setq org-columns-default-format "%40ITEM(Task) %TAGS %PRIORITY %TODO %17Effort(Estimated Effort){:} %CLOCKSUM") +(setq org-columns-default-format "%40ITEM(Task) %TAGS %PRIORITY %TODO %13SCHEDULED %13DEADLINE %6Effort{:} %CLOCKSUM") (setq org-default-notes-file "~/projects/notes/notes.org") (setq org-capture-templates ;; mail-specific note template, identified by "m" @@ -109,6 +114,8 @@ "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n%U\n%a\n" :clock-in t :clock-resume t :immediate-finish t) ("n" "note" entry (file "~/projects/notes/refile.org") "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t) + ("s" "schedule" entry (file "~/projects/notes/refile.org") + "* %? \n%^{scheduled:}t\n%U\n%a\n" :clock-in t :clock-resume t) ("j" "Journal" entry (file+datetree "~/projects/notes/diary.org") "* %?\n%U\n" :clock-in t :clock-resume t) ("w" "org-protocol" entry (file "~/projects/notes/refile.org") @@ -128,7 +135,24 @@ (org-remove-empty-drawer-at "LOGBOOK" (point)))) (add-hook 'org-clock-out-hook 'bh/remove-empty-drawer-on-clock-out 'append) +; add ids on creation of nodes +(add-hook 'org-capture-prepare-finalize-hook 'org-id-get-create) +; create function to create headlines in file. This comes from +; http://stackoverflow.com/questions/13340616/assign-ids-to-every-entry-in-org-mode +(defun my/org-add-ids-to-headlines-in-file () + "Add ID properties to all headlines in the current file which +do not already have one." + (interactive) + (org-map-entries 'org-id-get-create)) +; if we wanted to do this to every buffer, do the following: +; (add-hook 'org-mode-hook +; (lambda () +; (add-hook 'before-save-hook 'my/org-add-ids-to-headlines-in-file nil 'local))) + +; resolve clocks after 10 minutes of idle; use xprintidle +(setq org-clock-idle-time 10) +(setq org-clock-x11idle-program-name "xprintidle") ; this is from http://doc.norang.ca/org-mode.html#Capture ; use C-M-r for org mode capture @@ -171,6 +195,15 @@ "Delete frame at remember finalization" (progn (if my-org-protocol-flag (delete-frame)) (setq my-org-protocol-flag nil))) +(defadvice org-capture-refile (around delete-frame-after-refile activate) + "Delete frame at remember refile" + (if my-org-protocol-flag + (progn + (setq my-org-protocol-flag nil) + ad-do-it + (delete-frame)) + ad-do-it) + ) (defadvice org-capture-kill (after delete-frame-at-end activate) "Delete frame at remember abort" (progn (if my-org-protocol-flag (delete-frame)) @@ -179,6 +212,9 @@ (setq my-org-protocol-flag t)) +;; org modules +(add-to-list 'org-modules 'org-habit) + ; this comes from http://upsilon.cc/~zack/blog/posts/2010/02/integrating_Mutt_with_Org-mode/ (defun open-mail-in-mutt (message) "Open a mail message in Mutt, using an external terminal. @@ -187,7 +223,7 @@ Message can be specified either by a path pointing inside a Maildir, or by Message-ID." (interactive "MPath or Message-ID: ") (shell-command - (format "xterm -e \"%s %s\"" + (format "faf xterm -e \"%s %s\"" (substitute-in-file-name "$HOME/bin/mutt_open") message))) ;; add support for "mutt:ID" links @@ -219,13 +255,42 @@ Maildir, or by Message-ID." (add-to-list 'auto-mode-alist '("mutt-[a-z0-9]+-[0-9]+-" . message-mode)) (add-to-list 'auto-mode-alist '("muttrc" . muttrc-mode)) -(add-hook 'mail-mode-hook - (lambda () - (font-lock-add-keywords nil - '(("^[ \t]*>[ \t]*>[ \t]*>.*$" - (0 'mail-multiply-quoted-text-face)) - ("^[ \t]*>[ \t]*>.*$" - (0 'mail-double-quoted-text-face)))))) +(defun my-message-mode-settings () + (font-lock-add-keywords nil + '(("^[ \t]*>[ \t]*>[ \t]*>.*$" + (0 'message-multiply-quoted-text-face)) + ("^[ \t]*>[ \t]*>.*$" + (0 'message-double-quoted-text-face)))) + (local-set-key (kbd "C-c C-a") 'my-post-attach-file) + ) +(add-hook 'message-mode-hook 'my-message-mode-settings) + +(defun my-post-attach-file () + "Prompt for an attachment." + (interactive) + (let ((file (read-file-name "Attach file: " nil nil t nil)) + (description (string-read "Description: "))) + (my-header-attach-file file description))) + +(symbol-function 'my-post-attach-file) + +(defun my-header-attach-file (file description) + "Attach a FILE to the current message (works with Mutt). +Argument DESCRIPTION MIME description." + (interactive "fAttach file: \nsDescription: ") + (when (> (length file) 0) + (save-excursion + (save-match-data + (save-restriction + (widen) + (goto-char (point-min)) + (search-forward-regexp "^$") + (insert (concat "Attach: " (replace-regexp-in-string "\\([[:space:]\\]\\)" "\\\\\\1" (file-truename file)) " " + description "\n")) + (message (concat "Attached '" file "'.")) + (setq post-has-attachment t)))))) + + (setq mail-yank-prefix "> ") @@ -247,12 +312,15 @@ Maildir, or by Message-ID." cperl-auto-newline nil cperl-auto-newline-after-colon nil cperl-continued-statement-offset 4 - cperl-brace-offset -4 + cperl-brace-offset -1 + cperl-continued-brace-offset 0 cperl-label-offset -4 cperl-highlight-variables-indiscriminately t cperl-electric-lbrace-space nil - ) -(add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle"))) + cperl-indent-parens-as-block nil + cperl-close-paren-offset -1 + cperl-tab-always-indent t) +;(add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle"))) @@ -286,6 +354,11 @@ Maildir, or by Message-ID." (add-hook 'LaTeX-mode-hook 'outline-minor-mode) ; with AUCTeX LaTeX mode (add-hook 'latex-mode-hook 'outline-minor-mode) ; with Emacs latex mode +; use smart quotes by default instead of `` and '' +; taken from http://kieranhealy.org/esk/kjhealy.html +(setq TeX-open-quote "“") +(setq TeX-close-quote "”") + ;; (TeX-add-style-hook ;; "latex" ;; (lambda () @@ -299,30 +372,47 @@ Maildir, or by Message-ID." ;; ) (require 'font-latex) -(add-to-list 'font-latex-match-reference-keywords "fref") -(add-to-list 'font-latex-match-reference-keywords "Fref") -(add-to-list 'font-latex-match-reference-keywords "citep") -(add-to-list 'font-latex-match-reference-keywords "citet") -(font-latex-match-reference-make) -(add-to-list 'font-latex-match-function-keywords "DLA") -(add-to-list 'font-latex-match-function-keywords "RZ") -(add-to-list 'font-latex-match-function-keywords "OM") -(add-to-list 'font-latex-match-function-keywords "DL") -(add-to-list 'font-latex-match-function-keywords "fixme") -(add-to-list 'font-latex-match-function-keywords "acs") -(add-to-list 'font-latex-match-function-keywords "acsp") -(add-to-list 'font-latex-match-function-keywords "ac") -(add-to-list 'font-latex-match-function-keywords "acp") -(add-to-list 'font-latex-match-function-keywords "acl") -(add-to-list 'font-latex-match-function-keywords "aclp") -(add-to-list 'font-latex-match-function-keywords "acsu") -(add-to-list 'font-latex-match-function-keywords "aclu") -(add-to-list 'font-latex-match-function-keywords "acused") -(font-latex-match-function-make) +(setq font-latex-match-reference-keywords + '( + ("fref" "{") + ("Fref" "{") + ("citep" "{") + ("citet" "{") + ("acs" "{") + ("acsp" "{") + ("ac" "{") + ("acp" "{") + ("acl" "{") + ("aclp" "{") + ("acsu" "{") + ("aclu" "{") + ("acused" "{") +; )) +; (setq font-latex-match-warning-keywords +; '( + ("DLA" "{") + ("RZ" "{") + ("OM" "{") + ("DL" "{") + ("fixme" "{"))) + (setq-default TeX-parse-self t) (setq-default TeX-auto-save t) (setq-default TeX-master nil) +;; this doesn't seem to work; not currently sure why +; (setq font-latex-user-keyword-classes +; '(("my-warning-commands" +; (("DLA" "{") +; ("RZ" "{") +; ("OM" "{") +; ("DL" "{") +; ("fixme" "{") +; ) +; (:foreground "red" :weight bold :underline (:color foreground-color :style line))) +; )) + + (defun insert-date () "Insert date at point." (interactive) @@ -369,6 +459,18 @@ Maildir, or by Message-ID." (add-hook 'post-mode-hook (auto-fill-mode nil) ) +; abbrev mode settings +; load abbreviations from +(setq abbrev-file-name + "~/.emacs_abbrev_def") + +; read the abbrev file if it exists +(if (file-exists-p abbrev-file-name) + (quietly-read-abbrev-file)) + +; for now, use abbrev mode everywhere +(setq default-abbrev-mode t) + (defun insert-function-documentation () "Insert function documentation" @@ -387,10 +489,10 @@ Maildir, or by Message-ID." (desktop-read) '(iswitchb-mode on) (custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. '(menu ((((type x-toolkit)) (:background "black" :foreground "grey90"))))) (defun ess-change-directory (path) @@ -464,27 +566,179 @@ Maildir, or by Message-ID." (global-set-key "\M-o" cm-map) (defun my-org-mode-setup () - (when (and (buffer-file-name) - (file-exists-p (buffer-file-name))) (load-library "reftex") (and (buffer-file-name) - (file-exists-p (buffer-file-name)) - (reftex-parse-all)) - (reftex-set-cite-format - '((?b . "[[bib::%l]]") - (?n . "[[note::%l]]")))) - (define-key org-mode-map "\C-c\C-g" 'reftex-citation) -) + (file-exists-p (buffer-file-name)) + (progn + (reftex-parse-all) + (reftex-set-cite-format + '((?b . "[[bib::%l][%l-bib]]") + (?n . "[[note::%l][%l-notes]]") + (?c . "\\cite{%l}") + (?h . "*** %t\n:PROPERTIES:\n:Custom_ID: %l\n:END:\n[[papers:%l][%l paper]]"))) + )) + (define-key org-mode-map (kbd "C-c )") 'reftex-citation) + (define-key org-mode-map (kbd "C-c [") 'reftex-citation) + (define-key org-mode-map (kbd "C-c (") 'org-mode-reftex-search) + (define-key org-mode-map (kbd "C-c 0") 'reftex-view-crossref) + ) (add-hook 'org-mode-hook 'my-org-mode-setup) +(defun org-mode-reftex-search () + (interactive) + (org-open-link-from-string (format "[[notes:%s]]" (reftex-citation t)))) + +(defun open-research-paper (bibtexkey) + "Open a paper by bibtex key" + (interactive "bibtex key: ") + (shell-command + (format "%s %s" + (substitute-in-file-name "$HOME/bin/bibtex_to_paper") bibtexkey))) +(org-add-link-type "papers" 'open-research-paper) + +; I pretty much always want hiearchical checkboxes +(setq org-hierachical-checkbox-statistics nil) + +;; stolen from +;; http://www-public.it-sudparis.eu/~berger_o/weblog/2012/03/23/how-to-manage-and-export-bibliographic-notesrefs-in-org-mode/ +(defun my-rtcite-export-handler (path desc format) + (message "my-rtcite-export-handler is called : path = %s, desc = %s, format = %s" path desc format) + (let* ((search (when (string-match "::#?\\(.+\\)\\'" path) + (match-string 1 path))) + (path (substring path 0 (match-beginning 0)))) + (cond ((eq format 'latex) + (if (or (not desc) + (equal 0 (search "rtcite:" desc))) + (format "\\cite{%s}" search) + (format "\\cite[%s]{%s}" desc search)))))) + +(org-add-link-type "rtcite" + 'org-bibtex-open + 'my-rtcite-export-handler) + + (setq-default org-mobile-directory "/rzlab.ucr.edu:/sites/dav.donarmstrong.com/root/org/") (setq-default org-directory "/home/don/org-mode/") (setq-default org-mobile-inbox-for-pull "/home/don/org-mode/from-mobile.org") +;; org mode ical export +(setq org-icalendar-timezone "America/Los_Angeles") +(setq org-icalendar-use-scheduled '(todo-start event-if-todo)) +(setq org-icalendar-store-UID t) + +;; org babel support +(org-babel-do-load-languages + 'org-babel-load-languages + '((emacs-lisp . t ) + (R . t) + (latex . t))) +;; org-babel-by-backend +(defmacro org-babel-by-backend (&rest body) + `(case (if (boundp 'backend) + (org-export-backend-name backend) + nil) ,@body)) + + + +;; org latex +;; stolen from http://kieranhealy.org/esk/kjhealy.html +(require 'org-latex) +;; Choose either listings or minted for exporting source code blocks. +;; Using minted (as here) requires pygments be installed. To use the +;; default listings package instead, use +;; (setq org-latex-listings t) +;; and change references to "minted" below to "listings" +; (setq org-latex-listings 'minted) + +;; default settings for minted code blocks +(setq org-latex-minted-options + '(;("frame" "single") + ("bgcolor" "bg") ; bg will need to be defined in the preamble of your document. It's defined in org-preamble-pdflatex.sty and org-preamble-xelatex.sty below. + ("fontsize" "\\small") + )) +;; turn off the default toc behavior; deal with it properly in headers to files. +(defun org-latex-no-toc (depth) + (when depth + (format "%% Org-mode is exporting headings to %s levels.\n" + depth))) +(setq org-latex-format-toc-function 'org-latex-no-toc) + +(require 'ox-latex) +(add-to-list 'org-latex-classes + '("memarticle" + "\\documentclass[11pt,oneside,article]{memoir}\n" + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) + +(add-to-list 'org-latex-classes + '("membook" + "\\documentclass[11pt,oneside]{memoir}\n" + ("\\chapter{%s}" . "\\chapter*{%s}") + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) + +(add-to-list 'org-latex-classes + '("letter" + "\\documentclass[11pt]{letter}" + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) + +;; Originally taken from Bruno Tavernier: http://thread.gmane.org/gmane.emacs.orgmode/31150/focus=31432 +;; but adapted to use latexmk 4.22 or higher. +(setq org-latex-pdf-process '("latexmk -pdflatex=xelatex -bibtex -use-make -pdf %f")) + +;; Default packages included in /every/ tex file, latex, pdflatex or xelatex +(setq org-latex-default-packages-alist + '()) +(setq org-latex-packages-alist + '(("" "graphicx" t) + ("" "fontspec" t) + ("" "xunicode" t) + ("" "hyperref" t) + ("" "url" t) + ("" "rotating" t) + ("" "longtable" nil) + ("" "float" ))) + +(defun org-create-formula--latex-header () + "Return LaTeX header appropriate for previewing a LaTeX snippet." + (let ((info (org-combine-plists (org-export--get-global-options + (org-export-get-backend 'latex)) + (org-export--get-inbuffer-options + (org-export-get-backend 'latex))))) + (org-latex-guess-babel-language + (org-latex-guess-inputenc + (org-splice-latex-header + org-format-latex-header + org-latex-default-packages-alist + nil t + (plist-get info :latex-header))) + info))) + + +; support ignoring headers in org mode export to latex +; from http://article.gmane.org/gmane.emacs.orgmode/67692 +(defadvice org-latex-headline (around my-latex-skip-headlines + (headline contents info) activate) + (if (member "ignoreheading" (org-element-property :tags headline)) + (setq ad-return-value contents) + ad-do-it)) + ; debian stuff (setq-default debian-changelog-mailing-address "don@debian.org") (setq-default debian-changelog-full-name "Don Armstrong") +; ediff configuration +; don't use the multi-window configuration +(setq ediff-window-setup-function 'ediff-setup-windows-plain) + ; use iedit (require 'iedit) (define-key global-map (kbd "C-;") 'iedit-mode) @@ -561,6 +815,101 @@ want to use in the modeline *in lieu of* the original.") (setq flymake-mode-line mode-line) (force-mode-line-update))) +; load sql-indent when sql is loaded +(eval-after-load "sql" + '(load-library "sql-indent")) + +; fix up tmux xterm keys +; stolen from http://unix.stackexchange.com/questions/24414/shift-arrow-not-working-in-emacs-within-tmux +(if (getenv "TMUX") + (progn + (let ((x 2) (tkey "")) + (while (<= x 8) + ;; shift + (if (= x 2) + (setq tkey "S-")) + ;; alt + (if (= x 3) + (setq tkey "M-")) + ;; alt + shift + (if (= x 4) + (setq tkey "M-S-")) + ;; ctrl + (if (= x 5) + (setq tkey "C-")) + ;; ctrl + shift + (if (= x 6) + (setq tkey "C-S-")) + ;; ctrl + alt + (if (= x 7) + (setq tkey "C-M-")) + ;; ctrl + alt + shift + (if (= x 8) + (setq tkey "C-M-S-")) + + ;; arrows + (define-key key-translation-map (kbd (format "M-[ 1 ; %d A" x)) (kbd (format "%s" tkey))) + (define-key key-translation-map (kbd (format "M-[ 1 ; %d B" x)) (kbd (format "%s" tkey))) + (define-key key-translation-map (kbd (format "M-[ 1 ; %d C" x)) (kbd (format "%s" tkey))) + (define-key key-translation-map (kbd (format "M-[ 1 ; %d D" x)) (kbd (format "%s" tkey))) + ;; home + (define-key key-translation-map (kbd (format "M-[ 1 ; %d H" x)) (kbd (format "%s" tkey))) + ;; end + (define-key key-translation-map (kbd (format "M-[ 1 ; %d F" x)) (kbd (format "%s" tkey))) + ;; page up + (define-key key-translation-map (kbd (format "M-[ 5 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; page down + (define-key key-translation-map (kbd (format "M-[ 6 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; insert + (define-key key-translation-map (kbd (format "M-[ 2 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; delete + (define-key key-translation-map (kbd (format "M-[ 3 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f1 + (define-key key-translation-map (kbd (format "M-[ 1 ; %d P" x)) (kbd (format "%s" tkey))) + ;; f2 + (define-key key-translation-map (kbd (format "M-[ 1 ; %d Q" x)) (kbd (format "%s" tkey))) + ;; f3 + (define-key key-translation-map (kbd (format "M-[ 1 ; %d R" x)) (kbd (format "%s" tkey))) + ;; f4 + (define-key key-translation-map (kbd (format "M-[ 1 ; %d S" x)) (kbd (format "%s" tkey))) + ;; f5 + (define-key key-translation-map (kbd (format "M-[ 15 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f6 + (define-key key-translation-map (kbd (format "M-[ 17 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f7 + (define-key key-translation-map (kbd (format "M-[ 18 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f8 + (define-key key-translation-map (kbd (format "M-[ 19 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f9 + (define-key key-translation-map (kbd (format "M-[ 20 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f10 + (define-key key-translation-map (kbd (format "M-[ 21 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f11 + (define-key key-translation-map (kbd (format "M-[ 23 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f12 + (define-key key-translation-map (kbd (format "M-[ 24 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f13 + (define-key key-translation-map (kbd (format "M-[ 25 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f14 + (define-key key-translation-map (kbd (format "M-[ 26 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f15 + (define-key key-translation-map (kbd (format "M-[ 28 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f16 + (define-key key-translation-map (kbd (format "M-[ 29 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f17 + (define-key key-translation-map (kbd (format "M-[ 31 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f18 + (define-key key-translation-map (kbd (format "M-[ 32 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f19 + (define-key key-translation-map (kbd (format "M-[ 33 ; %d ~" x)) (kbd (format "%s" tkey))) + ;; f20 + (define-key key-translation-map (kbd (format "M-[ 34 ; %d ~" x)) (kbd (format "%s" tkey))) + + (setq x (+ x 1)) + )) + ) + ) + ; apparently things like to step on C-;, so we'll use a hack from ; http://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs/5340797#5340797 to fix this