emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Christopher W. Ryan" <cryan@binghamton.edu>
To: emacs-orgmode@gnu.org
Subject: Re: trouble exporting just one subtree while using babel and R code blocks--spoke too soon
Date: Mon, 11 Mar 2013 09:47:04 -0400	[thread overview]
Message-ID: <513DE058.1090505@binghamton.edu> (raw)
In-Reply-To: <87k3pjgttj.fsf@ucl.ac.uk>

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 <cryan@binghamton.edu> 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.

  parent reply	other threads:[~2013-03-11 13:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18 21:10 trouble exporting just one subtree while using babel and R code blocks Christopher W. Ryan
2013-02-18 21:22 ` John Hendy
2013-03-06 19:33   ` Christopher W. Ryan
2013-03-06 21:28     ` John Hendy
2013-03-06 19:51   ` trouble exporting just one subtree while using babel and R code blocks--spoke too soon Christopher W. Ryan
2013-03-07  8:42     ` Eric S Fraga
2013-03-07 13:13       ` Christopher W Ryan
2013-03-07 14:36         ` Eric S Fraga
2013-03-07 17:55           ` Achim Gratz
2013-03-08  7:54             ` Bastien
2013-03-08 16:51               ` Achim Gratz
2013-03-08 17:25                 ` Bastien
2013-03-08 19:48                   ` Achim Gratz
2013-03-09  9:26                     ` Bastien
2013-03-11 13:47           ` Christopher W. Ryan [this message]
2013-03-07 15:00         ` John Hendy
2013-03-07 15:54           ` Christopher W Ryan
2013-03-07 16:12             ` John Hendy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=513DE058.1090505@binghamton.edu \
    --to=cryan@binghamton.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).