emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] trouble exporting just one subtree while using babel and R code


From: Christopher W. Ryan
Subject: Re: [O] trouble exporting just one subtree while using babel and R code blocks--spoke too soon
Date: Mon, 11 Mar 2013 09:47:04 -0400
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0.1) Gecko/20111121 Firefox/8.0.1 SeaMonkey/2.5

OK< back at the office computer . . .

In org version 7.9.3f on Windows XP, my C-c C-e is bound to org-export.
I guess that's the old exporter.

The org-related parts of my  .eamcs are below. Clearly not the most
elegant .emacs file--I'm still pretty new at this!

----------------------------------------------

;; Load org-mode
(add-to-list 'load-path "c:/Org/org-7.9.3f/lisp")
(add-to-list 'load-path "c:/Org/org-7.9.3f/contrib/lisp")
(require 'org)

;; The following lines are always needed.  Choose your own keys.
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(add-hook 'org-mode-hook 'turn-on-font-lock) ; not needed when
global-font-lock-mode is on
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)


;; Capture
(global-set-key (kbd "C-c r") 'org-capture)
 (setq org-default-notes-file (concat org-directory "/junknotes.org"))
 (setq org-capture-templates
      '(("t" "Agenda Todo" entry
         (file+headline "c:/Org/junk1.org" "Agenda")
         "\n\n** TODO %?\n%T\n\n%i\n%a\n\n\n"
         :empty-lines 1)

        ("n" "Agenda Notes" entry
         (file "c:/Org/junk1.org")
         "\n\n** %?\n%T\n%i\n%a\n\n\n"
         :empty-lines 1)

       ("a" "admission" entry
        (file "c:/DATA/MedicalShelterAdmissions.org")
        "\n\n* IN  %^{LAST NAME, first name}
         %^{IDnumber}p %^{Birthdate}p %^{Age}p %^{Doctor1}p
         %^{Adress1}p %^{Address2}p %^{City}p
         %U"
         :empty-lines 1)
))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; set-up for use as a medical shelter record
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; I've attempted to remove redundancies with capture settings that
appear above this point

'(org-agenda-files (quote ("~/Shelter/ShelterAdmissions.org"
"~/DATA/BookIdeas.org" "~/orgjunk.org")))

(setq org-default-notes-file (concat  "~/notes.org"))

(defun prompt-for-lastname-and-upcase ()
 (upcase (read-string "Last name: ")))

(defun prompt-and-upcase (prompt-str)
  (upcase (read-string prompt-str)))

 (setq org-capture-templates
      '(("a" "Admit" entry
        (file "~/Shelter/ShelterAdmissions.org")
         "* admit  %(prompt-for-lastname-and-upcase),  %^{firstname}      %U
          :PROPERTIES:
          %^{IDnumber}p
          %^{Birthdate}p
          %^{Age}p
          %^{Sex}p
          %^{Address1}p
          %^{Address2}p
          %^{City}p
          %^{State}p
          %^{Zipcode}p
          %^{Doctor1}p
          %^{Doctor2}p
          %^{Pharmacy1}p
          %^{Pharmacy2}p"
          :empty-lines: 1)
          )
)


;; Insert immediate timestamp
(setq org-agenda-skip-additional-timestamps nil)
(define-key global-map (kbd "<f8>")
  '(lambda () (interactive)
              (when (eq major-mode 'org-mode)
                    (org-insert-time-stamp nil t t)
                    (insert "\n"))))



;;; This was installed by package-install.el.
;;; This provides support for the package system and
;;; interfacing with ELPA, the package archive.
;;; Move this code earlier if you want to reference
;;; packages in your .emacs.
(when
    (load
     (expand-file-name "~/.emacs.d/elpa/package.el"))
  (package-initialize))



(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.
 '(load-home-init-file t t)
 '(org-agenda-files (quote ("c:/DATA/MedicalShelterAdmissions.org"
"c:/DATA/SCHOLAR/HeatWaves/HeatWaves1.org")))
 '(org-inlinetask-export nil)
 '(sentence-end-double-space nil)
 '(show-paren-mode t)
 '(text-mode-hook (quote (text-mode-hook-identify)))
 '(transient-mark-mode t))
(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.
 )


;;;;; bunch of cosmetic stuff in here: font, background color, etc


;; make ESS use the correct version of R
;; (setq inferior-R-program-name "c:/progra~1/R/R-2.14.1/bin/Rterm.exe")

;; active Babel languages
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)
   (python . t)
   (perl . t)
   ))

;; turn off auto-fill-mode
(auto-fill-mode 0)
(global-visual-line-mode -1)

(cd "C:/DATA/")

;; activate RefTex mode with org-mode
;; insert a citation with "C-c )"
(defun org-mode-reftex-setup ()
  (load-library "reftex")
  (and (buffer-file-name)
       (file-exists-p (buffer-file-name))
       (reftex-parse-all))
  (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
(add-hook 'org-mode-hook 'org-mode-reftex-setup)

;; in org-mode, by default, long lines disappear into the right window
edge. If you prefer them wrapped, you can add this to your init file:

(add-hook 'org-mode-hook 'soft-wrap-lines)

(defun soft-wrap-lines ()
"Make lines wrap at window edge and on word boundary,
in current buffer."
(interactive)
(setq truncate-lines nil)
(setq word-wrap t)
)

;; show all todos in the current buffer with one key press
(global-set-key (kbd "<f9>") (lambda ()
                               (interactive)
                               (org-agenda nil "t" 'file)))

;; activate inline tasks
(require 'org-inlinetask)

;; override out-of-the-box ESS setting that makes
;; texi2pdf the default latex command
(setq ess-swv-pdflatex-commands '("pdflatex" "make"))
(put 'narrow-to-region 'disabled nil)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; vvvvvv  custom code to make workflow for meeting minutes, agendas,
and action items vvvvvvvv
;; as in
;; http://orgmode.org/worg/org-tutorials/org-meeting-tasks.html
;;

(defcustom org-mactions-numbered-action-format "TODO Action #%d "
  "Default structure of the headling of a new action.
    %d will become the number of the action."
  :group 'org-edit-structure
  :type 'string)

(defcustom org-mactions-change-id-on-copy t
  "Non-nil means make new IDs in copied actions.
If an action copied with the command `org-mactions-collect-todos-in-subtree'
contains an ID, that ID will be replaced with a new one."
  :group 'org-edit-structure
  :type 'string)

(defun org-mactions-new-numbered-action (&optional inline)
  "Insert a new numbered action, using
`org-mactions-numbered-action-format'.
    With prefix argument, insert an inline task."
  (interactive "P")
  (let* ((num (let ((re "\\`#\\([0-9]+\\)\\'"))
                (1+ (apply 'max 0
                           (mapcar
                            (lambda (e)
                              (if (string-match re (car e))
                                  (string-to-number (match-string 1 (car
e)))
                                0))
                            (org-get-buffer-tags))))))
         (tag (concat "#" (number-to-string num))))
    (if inline
        (org-inlinetask-insert-task)
      (org-insert-heading 'force))
    (unless (eql (char-before) ?\ ) (insert " "))
    (insert (format org-mactions-numbered-action-format num))
    (org-toggle-tag tag 'on)
    (if (= (point-max) (point-at-bol))
        (save-excursion (goto-char (point-at-eol)) (insert "\n")))
    (unless (eql (char-before) ?\ ) (insert " "))))

(defun org-mactions-collect-todos-in-subtree ()
  "Collect all TODO items in the current subtree into a flat list."
  (interactive)
  (let ((buf (get-buffer-create "Org TODO Collect"))
        (cnt 0) beg end string s)
    (with-current-buffer buf (erase-buffer) (org-mode))
    (org-map-entries
     (lambda ()
       (setq beg (point) end (org-end-of-subtree t t) cnt (1+ cnt)
             string (buffer-substring beg end)
             s 0)
       (when org-mactions-change-id-on-copy
         (while (string-match "^\\([ \t]*:ID:\\)[ \t\n]+\\([^ \t\n]+\\)[
\t]*$"
                              string s)
           (setq s (match-end 1)
                 string (replace-match (concat "\\1 "
                                               (save-match-data
(org-id-new)))
                                       t nil string))))
       (with-current-buffer buf (org-paste-subtree 1 string)
                            (goto-char (point-max))))
     (format "TODO={%s}" (regexp-opt org-not-done-keywords))
     'tree)
    (if (= cnt 0)
        (message "No TODO items in subtree")
      (message "%d TODO entries copied to kill ring" cnt)
      (prog1 (with-current-buffer buf
               (kill-new (buffer-string)))
        (kill-buffer buf)))))
;;
;;
;;
;;
;; ^^^ end of custom code for workflow for meeting minutes, etc ^^^^

----------------------------------------------------

Christopher W. Ryan, MD, MS
SUNY Upstate Medical University Clinical Campus at Binghamton
425 Robinson Street, Binghamton, NY  13904
cryanatbinghamtondotedu

"Once we recognize that we do not err out of laziness, stupidity, or
evil intent, we can liberate ourselves from the impossible burden of
trying to be permanently right. We can take seriously the proposition
that we could be in error, without deeming ourselves idiotic or
unworthy." [Karen Schulz, in Being Wrong: Adventures in the Margin of Error]


Eric S Fraga wrote:
> Christopher W Ryan <address@hidden> writes:
> 
>> I have to admit I'm not yet experienced enough with org mode to know
>> about the new exporter versus the old. I've been trying to ignore the
>> conversations on the list about the new exporter, since, at least
>> until now, whatever org mode was doing was what I needed it to do.
>>
>> I have org mode 7.9.3f. Does that mean I am using any particular
>> exporter?  How do I tell which exporter I am using with C-c C-e d ?
> 
> I believe that, if you are using 7.9.3f, you should be using the new
> exporter.  However, the key bindings you mentioned in the previous
> posting indicated that you were accessing the old exporter.  This may
> mean that you have a confused configuration (easy to do at the moment
> due to the transition taking place between old and new exporters).
> 
> One way to find out what you are using is to check what C-c C-e is bound
> to: C-h c C-c C-e.  If this says org-export-dispatch, it is the new
> one.  The old one, I believe, was bound to org-export alone.  The former
> gives a two level selection mechanism (e.g. you choose l for LaTeX first
> and then another letter for actual target for the export, e.g. tex vs
> pdf).  The latter uses only one letter to accomplish both selections.
> 
> I hope this makes sense.



reply via email to

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