]> git.donarmstrong.com Git - emacs.git/blobdiff - .emacs
add tab always indent
[emacs.git] / .emacs
diff --git a/.emacs b/.emacs
index f37d936892081ae7023327f571051168e121091a..a6a9ff94701508cc88f3e1ae67b4e556ef566b78 100644 (file)
--- 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)
@@ -97,6 +97,7 @@
              "~/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/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")))
@@ -283,7 +284,8 @@ Argument DESCRIPTION MIME description."
       cperl-label-offset -4
       cperl-highlight-variables-indiscriminately t
       cperl-electric-lbrace-space nil
-      )
+      cperl-indent-parens-as-block t
+      cperl-tab-always-indent t)
 (add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle")))
 
 
@@ -331,30 +333,47 @@ Argument DESCRIPTION MIME description."
 ;; ) 
 
 (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)
@@ -431,10 +450,10 @@ Argument DESCRIPTION MIME description."
 (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)
@@ -516,10 +535,12 @@ Argument DESCRIPTION MIME description."
          (reftex-set-cite-format
           '((?b . "[[bib::%l][%l-bib]]")
             (?n . "[[note::%l][%l-notes]]")
-            (?h . "** %t\n:PROPERTIES:\n:Custom_ID: %l\n:END:\n[[papers:%l][%l-paper]]")))
+            (?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 (") '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)
 
@@ -528,6 +549,31 @@ Argument DESCRIPTION MIME description."
   (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)))
+
+;; 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")