From f3a7a7acab2ed973237abd06326c8f8bc3b5506a Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Fri, 31 May 2013 17:09:59 -0700 Subject: [PATCH] update .emacs with new values --- .emacs | 47 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/.emacs b/.emacs index f37d936..36e1adf 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) @@ -431,10 +431,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 +516,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 +530,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") -- 2.39.5