Commit Graph

3236 Commits

Author SHA1 Message Date
Eric Schulte c53fc7d246 babel: consolidate execution messaging into ob.el
* lisp/ob.el (org-babel-execute-src-block): consolidate execution
  messaging into ob.el rather than spread out amongst all the language
  files
2010-07-12 22:26:25 -07:00
Eric Schulte e3aaaec91c babel: more informative automatically generated block names in tangled comments
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): more
  informative automatically generated block names in comments
2010-07-12 17:07:23 -07:00
Eric Schulte 5570bef368 babel: adding comments to org-babel-header-arg-names
* lisp/ob.el (org-babel-header-arg-names): adding comments to
  org-babel-header-arg-names
2010-07-12 16:32:24 -07:00
Eric Schulte 9271692869 babel: don't prematurely remove existing results when not caching
* lisp/ob.el (org-babel-where-is-src-block-result): be sure not to
  remove existing results when the there is no cache header arg
2010-07-12 14:38:35 -07:00
Eric Schulte e8033b7f04 org-exp: raise an error when trying to export code blocks w/o languages
* lisp/ob.el (org-babel-get-src-block-info): ensure that we don't
  match (and return info for) source blocks without a language

* lisp/org-exp.el (org-export-replace-src-segments-and-examples):
  updated source code block regexp so that the presence of a language
  can be explicitly checked.  Also now raising an error when a source
  block does not have a language.
2010-07-12 12:33:15 -07:00
Eric Schulte 1e50216854 babel: now always updating hash when inserting results
* lisp/ob.el (org-babel-where-is-src-block-result): now will replace
  the results line when if contains an old hash which is out of date
2010-07-12 12:28:49 -07:00
Nicolas Goaziou 3d69093339 Fix radio list templates
* lisp/org-list.el (org-list-radio-list-templates): Fix templates.
2010-07-12 19:04:48 +02:00
Nicolas Goaziou 94689a04b0 Fix regexp for `org-list-send-list'.
* lisp/org-list.el (org-list-send-list): regexp defining the start of
a radio list is now on par with the one used for radio tables.
2010-07-12 11:48:44 +02:00
Carsten Dominik eeab263cb8 Add headline for user-defined entities to `M-x org-entities-help'
* lisp/org-entities.el (org-entities-help): Add a headline for
the user-defined entities.
2010-07-12 11:37:39 +02:00
Dirk-Jan C. Binnema 18161d0310 Add capture to agenda actions
* lisp/org-agenda.el (org-agenda-action): Document capture key and add it
to the prompt.

TINYCHANGE

A trivial patch to add some documentation for 'capture' to org-agenda (against
HEAD).
2010-07-12 07:56:26 +02:00
Eric Schulte 433b374c10 babel: enhanced code block movement functions
Thanks to Austin Frank for suggesting these features and to Jonathan
  Arkell for an implementation suggestion

This commit
 - adds `org-babel-goto-named-result' for jumping to named results
 - adds TAB-completion to `org-babel-goto-named-src-block'
 - standardizes on "-src-" instead of "-source-" in all babel functions
 - adds `org-babel-[next/previous]-src-block' functions and keybindings
 - documents the above in orgcard.tex

* doc/orgcard.tex: update documentation of babel keybindings

* lisp/ob-exp.el (org-exp-res/src-name-cleanup): standardized on
  "-src-" instead of "-source-"

* lisp/ob-keys.el (org-babel-key-bindings): updating keybindings for
  new movement functions

* lisp/ob-lob.el (org-babel-lob-ingest): standardized on "-src-"
  instead of "-source-"

* lisp/ob-ref.el (org-babel-ref-resolve-reference): standardized on
  "-src-" instead of "-source-"

* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): standardized on
  "-src-" instead of "-source-"

* lisp/ob.el (org-babel-src-name-regexp): standardized on "-src-"
  instead of "-source-"

  (org-babel-src-name-w-name-regexp): adding regexp for matching
  source names along with their names

  (org-babel-get-src-block-info): using new named source block regexp

  (org-babel-result-regexp): adding optional whitespace after result
  regexp

  (org-babel-result-w-name-regexp): adding regexp for matching results
  which have names

  (org-babel-named-src-block-regexp-for-name): standardized on "-src-"
  instead of "-source-"

  (org-babel-map-src-blocks): standardized on "-src-" instead of
  "-source-"

  (org-babel-where-is-src-block-head): standardized on "-src-" instead of
  "-source-"

  (org-babel-goto-named-src-block): standardized on "-src-" instead of
  "-source-", also added completing read

  (org-babel-src-block-names): collects source block names from a file
  or the current buffer

  (org-babel-goto-named-result): function for jumping to a named
  result

  (org-babel-result-names): returns results names from a file or the
  current buffer

  (org-babel-next-src-block): jump to the next source block

  (org-babel-previous-src-block): jump to the previous source block
2010-07-11 21:37:24 -07:00
Carsten Dominik f0c25d8431 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-07-11 18:53:00 +02:00
Carsten Dominik 96e5f293f8 Fix typo 2010-07-11 18:52:47 +02:00
Eric Schulte ef839e1080 added (sqlite "SQL") to org-export-latex-listings-langs
* lisp/org-latex.el (org-export-latex-listings-langs): added (sqlite "SQL")
2010-07-09 17:40:58 -07:00
Eric Schulte 0479242349 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-07-09 17:00:22 -07:00
Eric Schulte c4912669a6 ob-sqlite: now supports preview, tabular data and multi-line code bodies
* lisp/ob-sqlite.el (org-babel-expand-body:sqlite): now this function
  expands variables

  (org-babel-execute:sqlite): support for input of tabular data and
  multiline code bodies

  (org-babel-sqlite-expand-vars): support for tabular data
2010-07-09 17:00:03 -07:00
Carsten Dominik c76eda31ee Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-07-09 20:34:03 +02:00
Carsten Dominik d4781b9d88 Keep BABEL meta lines in tact
* lisp/org-latex.el (org-export-latex-first-lines): Do not mark
meta lines for removal. Do not remove BABEL config lines during export
2010-07-09 20:33:14 +02:00
Eric Schulte 535ea52fff ob-python: allow user choice between python.el and python-mode.el for
* lisp/ob-python.el (org-babel-python-mode): adding configuration
  option to allow users to control whether they use python.el or
  python-mode.el

  (org-babel-python-initiate-session-by-key): updated for use with new
  configuration option
2010-07-09 10:58:12 -07:00
Eric Schulte 0f5a2fb075 ob-tangle: fixed recently introduced issue with org-babel-load-file
* lisp/ob-tangle.el (org-babel-tangle): applying optional target-file
  argument through integration into the default header arguments
  (allowing overwriting through standard header-argument merging), and
  allowing a default setting of (:tangle . "no") to be overwritten
  when a target-file is specified.
2010-07-09 09:43:30 -07:00
Eric Schulte b44ecb51a4 ob-tangle: fixed `declare-function' call to point to correct file or origin
* lisp/ob-tangle.el (with-temp-filebuffer): fixed `declare-function'
  call to point to correct file or origin
2010-07-09 08:46:56 -07:00
David Maus 4c1b83e899 Check if `org-capture-link-is-already-stored' is bound before evaluating.
* org-capture.el (org-capture): Check if
`org-capture-link-is-already-stored' is bound before evaluating.

If `org-protocol-capture' is the first function that calls
`org-capture', this variable is locally bound while it is globally
unbound. I.e. org-capture.el was not loaded before, the defvar not
evaluated.  If `org-protocol-capture' exits, Emacs restores the global
value, which is void.
2010-07-09 10:06:50 +02:00
Eric Schulte 54c5039b8d removing vestigial babel directory load-path manipulation 2010-07-08 21:43:39 -07:00
Eric Schulte b4825f812b babel: marking the safe value of org-export-babel-evaluate
* lisp/ob-exp.el (org-export-babel-evaluate): marking the safe value
  of org-export-babel-evaluate
2010-07-08 15:11:38 -07:00
Eric Schulte 07b34e7a6b babel: declaring function to inhibit compiler warning
* lisp/ob-tangle.el (with-temp-filebuffer): declaring function to
  inhibit compiler warning
2010-07-08 13:40:08 -07:00
Eric Schulte 8944a309a4 adding defgroup for org-babel
* lisp/ob.el (org-babel): adding defgroup for org-babel
2010-07-08 13:38:59 -07:00
Eric Schulte abcb76891b org-babel-post-tangle-hook run in code files tangled by `org-babel-tangle'
* lisp/ob-tangle.el (org-babel-post-tangle-hook): adding hook which
  can be used to call functions from inside of code files tangled by
  org-babel-tangle

  (org-babel-tangle): added call to org-babel-post-tangle-hook
2010-07-08 11:58:20 -07:00
Eric Schulte d585521b55 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-07-08 10:29:54 -07:00
Eric Schulte 815b724486 ob-exp: org-export-babel-evaluate can inhibit code block eval on export
* lisp/ob-exp.el (org-export-babel-evaluate): customization variable
  which can be used to inhibit the evaluation of code blocks on export

  (org-babel-exp-results): code block evaluation is now contingent on
  the value of org-export-babel-evaluate
2010-07-08 10:28:47 -07:00
Carsten Dominik e644a76dfb Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-07-08 11:43:06 +02:00
Eric Schulte ec22856978 ob-exp: now returns an empty string when the language can't be evaluated
* lisp/ob-exp.el (org-babel-exp-results): now returns an empty string
  when the language can't be evaluated
2010-07-07 23:01:43 -07:00
Eric Schulte 4b2721d428 added autoload for org-babel-do-load-languages
* lisp/org.el: added autoload for org-babel-do-load-languages
2010-07-07 22:41:14 -07:00
Philip Rooke 7add6fd51d The docstring of org-capture-templates
A few minor corrections and suggestions for the org-capture-templates
docstring
2010-07-08 06:41:53 +02:00
Eric Schulte 10600c55ee Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-07-07 15:46:35 -07:00
Eric Schulte fabf73b060 babel: Added (:tangle . "no") to the default header arguments
* lisp/ob.el (org-babel-default-header-args): Added (:tangle . "no")
  to the default header arguments.  This is already the intended
  behavior, but it's better to be more explicit about such things.
2010-07-07 15:46:24 -07:00
Carsten Dominik b9aee58af3 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-07-07 23:43:53 +02:00
Carsten Dominik df248db7d9 Check if defvaralias is defined 2010-07-07 23:43:39 +02:00
Eric Schulte 869082e5fd added sqlite -> sql-mode mapping to org-src-lang-modes
* lisp/org-src.el (org-src-lang-modes): added sqlite to sql-mode
2010-07-07 12:40:43 -07:00
David Maus 60bbc07a11 Change indentation to match coding style guideline.
* org-feed.el: Change indentation to match coding style
guideline.

Cosmetic changes.
2010-07-07 08:47:46 +02:00
David Maus 66eadedab3 Load XML library if necessary.
* org-feed.el (org-feed-unescape, org-feed-parse-atom-feed): Load XML
library if necessary.

Function that use xml.el must require 'xml to make sure it is loaded
at runtime.
2010-07-07 08:46:44 +02:00
Eric Schulte 33b19178fc ob-sh: bug fix, return the results *not* the contents of the user's buffer
Thanks to Bernt Hansen for pointing this out

* lisp/ob-sh.el (org-babel-sh-evaluate): return the results *not* the
  contents of the user's buffer
2010-07-06 19:53:34 -07:00
Eric Schulte c32d773919 babel: code cleaning -- `error' and `with-current-buffer' usage for Emacs inclusion 2010-07-06 10:30:58 -07:00
Eric Schulte f34f0b9b39 ob-latex: fix compiler warnings 2010-07-06 09:47:25 -07:00
Eric Schulte 804d08b119 babel: don't ask twice for confirmation with :eval query
Thanks to Carsten for the Patch

* lisp/ob.el (org-babel-confirm-evaluate): don't ask twice for
  confirmation with :eval query
2010-07-06 09:39:07 -07:00
Carsten Dominik 2cc4c0d564 BEAMER: Standardize the header cookie for the beamer extra stuff
* lisp/org-beamer.el (org-beamer-amend-header): Standardize the
header cookie for the beamer extra stuff.
2010-07-06 15:04:00 +02:00
Carsten Dominik b7157cc666 Beamer: Put extra header last in header
* lisp/org-beamer.el (org-beamer-amend-header): Put extra header
last in header.

Tassilo Horn writes:

> I'm doing a LaTeX beamer presentation with org.  The org doc starts with
> these lines:
>
> --8<---------------cut here---------------start------------->8---
> #+STARTUP: beamer
> #+LaTeX_CLASS: beamer
> #+TITLE: Implementieren, Integrieren, Installieren
> #+AUTHOR: Tassilo Horn
> #+EMAIL: horn@uni-koblenz.de
> #+LANGUAGE: de
> #+BEAMER_FRAME_LEVEL: 2
> #+LaTeX_CLASS_OPTIONS: [presentation]
> #+BEAMER_HEADER_EXTRA: \usetheme[secheader]{Boadilla} \institute{Universitt Koblenz, IST}
> --8<---------------cut here---------------end--------------->8---
>
> In the presentation, the  in Universitt is printed as an A with a ~ on
> top, followed by a d'.  The reason is that the BEAMER_HEADER_EXTRA is
> put before the input encoding declaration.  To be clear, org produces a
> TeX file that starts with
>
> --8<---------------cut here---------------start------------->8---
> % Created 2010-07-06 Tue 08:57
> \documentclass[presentation]{beamer}
> \usetheme[secheader]{Boadilla} \institute{Universitt Koblenz, IST}
> \usepackage[utf8]{inputenc}
> \usepackage[T1]{fontenc}
> --8<---------------cut here---------------end--------------->8---
>
> but it should be at least:
>
> --8<---------------cut here---------------start------------->8---
> % Created 2010-07-06 Tue 08:57
> \documentclass[presentation]{beamer}
> \usepackage[utf8]{inputenc}
> \usetheme[secheader]{Boadilla} \institute{Universitt Koblenz, IST}
> \usepackage[T1]{fontenc}
> --8<---------------cut here---------------end--------------->8---
>
> In general, I'd say that it would be even more safe to put the extra
> headers below all default headers.
2010-07-06 14:55:47 +02:00
Daniel Clemente b324bdca5c default base-extension .org for org-publish
Org-publish: correctly find files in projects which didn't define a base-extension.
Previously, (org-publish-get-project-from-filename "~/org/file.org") would return nil because the constructed regular expression "^/home/dc/org/.+\\.\\(\\)$" required a dot at the end.

#+BEGIN_QUOTE

#+END_QUOTE
2010-07-06 12:56:47 +02:00
Carsten Dominik b6305c713c Make sure going to last capture also works after refile 2010-07-06 12:49:41 +02:00
Carsten Dominik 2235ecb422 Fix bug in getting template from file or function 2010-07-06 12:49:35 +02:00
David Maus d044ad3f1c Remove text properties of body before calculating cache hash.
* org-exp-blocks.el (org-export-blocks-format-ditaa)
(org-export-blocks-format-dot): Remove text properties of body before
calculating cache hash.

Otherwise one and the same ditta/graphviz image has a different hash
depending on the text properties of the body.
E.g. `org-export-region-as-html' with target buffer 'string passed the
body of the block without possible indentation property `wrap-prefix'
while `org-export-as-html' does.
2010-07-06 10:42:33 +02:00
Carsten Dominik e1262e57d2 LaTeX export: Allow to customize the tabular environment
* lisp/org-latex.el (org-export-latex-tabular-environment): New option.
(org-export-latex-tables): Use `org-export-latex-tabular-environment'.
2010-07-06 10:39:35 +02:00
Carsten Dominik 85c90e96fd Allow org-indent-mode only on Emacsen that do support it
* lisp/org-compat.el (org-version-check): New function.
* lisp/org-indent.el (org-indent-mode): Check for exact emacs version.
2010-07-06 10:23:41 +02:00
Carsten Dominik c80d5b9c27 Capture: Expand template file name 2010-07-06 09:44:31 +02:00
Carsten Dominik 75192f263e Allow capture template to come from a file or from a function call
* lisp/org-capture.el (org-capture-templates): Allow the template
to come from a file or function call.
(org-capture-place-entry): Get the template from file or function.
2010-07-06 09:41:01 +02:00
David Maus dfd0c7ad2e Fix typo in docstring.
* babel/ob-exp.el (org-babel-exp-inline-src-blocks): Fix typo
in docstring.
2010-07-06 09:14:01 +02:00
Carsten Dominik 0e30108330 Fix typo 2010-07-06 09:12:50 +02:00
David Maus 4273e50ab7 Don't create marker if target is entire file.
* org-agenda.el (org-agenda-bulk-action): Don't create marker for
position if target is entire file.

If the target of a bulk refile operation is the entire file,
`org-refile-get-location' returns nil for the refile position.
Creating a marker for the target file's buffer at position nil returns
a marker that points nowhere (Cf. GNU Emacs Lisp Reference Manual,
31.6).  `org-refile' adds headings to level 1 if the target position
for the target file is nil -- and hence a marker that points nowhere
is not nil, tries to jump to nowhere.
2010-07-06 08:55:02 +02:00
Carsten Dominik 6d889cc363 Escape parenthesis at bol in docstring 2010-07-06 08:51:23 +02:00
Carsten Dominik f3d72b13f4 Implement comment standards in org-ctags.el 2010-07-06 08:25:48 +02:00
Carsten Dominik 44d56dfa2d Autoload more org-table-functions
* lisp/org.el (org-autoload): Autoload a few more org-table functions.
2010-07-06 07:39:57 +02:00
Eric Schulte c87b6a90b0 ob-latex: shouldn't require org-latex as that results in a recursive require
Thanks to Juan Pechiar for pointing this out

* lisp/ob-latex.el (org-latex): don't require org-latex as that
  results in a recursive require loop
2010-07-05 20:17:40 -07:00
Eric Schulte ae44ae853d babel: adding ob-mscgen to org-babel-load-languages
* lisp/org.el (org-babel-load-languages): adding ob-mscgen
2010-07-05 19:08:50 -07:00
Eric Schulte 2538e687da babel: updating ob-dot.el and ob-mscgen.el to use ob-eval 2010-07-05 19:03:45 -07:00
Eric Schulte 07b8908903 ob-mscgen: support for mscgen code blocks by Juan Pechiar
from the comments of the new file

This software provides EMACS org-babel export support for message
sequence charts. The mscgen utility is used for processing the
sequence definition, and must therefore be installed in the system.

Mscgen is available and documented at
http://www.mcternan.me.uk/mscgen/index.html

This code is directly inspired by Eric Schulte's ob-dot.el

Example:

msc {
 A,B;
 A -> B [ label = "send message" ];
 A <- B [ label = "get answer" ];
}

Header for alternative file type:

This differs from most standard languages in that

1) there is no such thing as a "session" in mscgen
2) we are generally only going to return results of type "file"
3) we are adding the "file" and "filetype" header arguments
4) there are no variables
2010-07-05 18:48:47 -07:00
Eric Schulte e4cfd468a0 babel: :eval header argument takes arguments "never" and "query" to limit evaluation
* lisp/ob.el (org-babel-confirm-evaluate): adding a new :eval header
  argument which can be used to control evaluation

* doc/org.texi (eval): adding documentation for the new :eval header
  argument
2010-07-05 15:51:36 -07:00
Carsten Dominik 0dec8ac617 Revert "Fix agenda display for late scheduled and deadline tasks"
This reverts commit 516640aff9.
2010-07-05 23:18:34 +02:00
Eric Schulte 4406aa5a34 org-latex: fixed last remaining elisp compilation warning
* lisp/org-latex.el (org-export-latex-tables): format string now
  matches options
2010-07-05 13:29:33 -07:00
Eric Schulte 5ded079a1a Merge branch 'safety-babel' 2010-07-05 11:31:03 -07:00
Eric Schulte 0deb72c068 babel: removed `org-babel-tangle-w-comments', now just use the :comments header arg
* lisp/ob-tangle.el (org-babel-spec-to-string): removed
  `org-babel-tangle-w-comments', now just use the :comments header arg
  to control the insertion of comments on tangling
2010-07-05 11:14:51 -07:00
Eric Schulte 0a109680ee fixed list nesting error in ob-R.el 2010-07-05 11:14:51 -07:00
Eric Schulte baa6e1d3d7 babel: absolutely no babel related compiler warnings
had to nest an argument in a trivial `or' to trick the compiler in
  the large ob-comint macro.
2010-07-05 11:14:51 -07:00
Eric Schulte 3416a0e323 babel: clean compile 2010-07-05 11:14:51 -07:00
Eric Schulte 9be0990ae1 babel: clojure is now using ob-eval 2010-07-05 11:14:51 -07:00
Eric Schulte 1e43fa0413 babel: updated ob-octave.el to work with the new ob-eval.el functions
Note, the session based evaluation has *not* be updated, mainly
  because I don't have a working octave install with which to test the
  changes.
2010-07-05 11:14:50 -07:00
Eric Schulte 1956026332 babel: ob-perl is now using the new ob-eval functionality 2010-07-05 11:14:50 -07:00
Eric Schulte d1ba364572 babel: cleaned up R code 2010-07-05 11:14:50 -07:00
Eric Schulte 7b3077dcd4 babel: cleaned up ruby (now using ob-eval) 2010-07-05 11:14:50 -07:00
Eric Schulte 0a6a5b4fae babel: fixed small input error related to empty tables 2010-07-05 11:14:50 -07:00
Eric Schulte fd9bf71265 babel: fixed sessions in python, extracted external eval into ob-eval 2010-07-05 11:14:50 -07:00
Eric Schulte 15b36e2380 ext: prefix on external file names 2010-07-05 11:14:50 -07:00
Eric Schulte 9de1e9c6cc babel: greatly enhanced support for sqlite 2010-07-05 11:14:50 -07:00
Eric Schulte 6c2e35003f babel: all languages compiling cleanly (but R has a small problem)
For some reason ob-R refuses to compile when it requires ob-comint.

  When (require 'ob-comint) is not included in  ob-R.el everything
  compiles without error, but warnings are thrown because the
  arguments to a macro defined in ob-comint are mis-interpreted as
  functions.

  When (require 'ob-comint) is added to ob-R.el then it throws errors
  complaining that the last argument to a function is nil and should
  be a string.  I don't understand this error at all and can't fix it.
2010-07-05 11:14:50 -07:00
Eric Schulte d7b7025eac flattening out lisp directory structure
all babel and babel/langs files now live in the base of the lisp directory.
2010-07-05 11:14:49 -07:00
Eric Schulte 6e469f4afb babel: `org-babel-load-languages' activates code blocks by language
* lisp/org.el (org-babel-load-languages): this variable controls which
  languages will be loaded by org-babel.  It is customizable through
  the customize interface.

  (org-babel-do-load-languages): load those languages in
  org-babel-load-languages and disable those with nil cdr's
2010-07-05 11:14:49 -07:00
Eric Schulte 0ea1432d31 babel: evaluation of code blocks now requires confirmation
* lisp/babel/ob.el (org-confirm-babel-evaluate): variable used to
  control evaluation of code blocks, default value it t, meaning all
  code block evaluation requires confirmation

  (org-babel-confirm-evaluate): function used to request confirmation
  of code block evaluation from the user

  (org-babel-execute-src-block): this function is the single point of
  entry for evaluation of code blocks (whether initiated through lob
  call, through direct code block evaluation, or as part of file
  exportation).  Every time this function is called it will now
  request confirmation from the user.  The newly added
  `org-confirm-babel-evaluate' variable can be used to configure this
  behavior.

  (org-babel-no-eval-on-ctrl-c-ctrl-c): This variable can be used to
  inhibit evaluation of code blocks with C-c C-c.

* lisp/org.el (org-ctrl-c-ctrl-c): added documentation of code block
  evaluation behavior

* lisp/babel/ob-keys.el (org-babel-key-bindings): adding keybindings
  for executing code blocks and for opening their results
2010-07-05 11:14:49 -07:00
Carsten Dominik 1217e02e56 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-07-05 19:01:13 +02:00
Eric Schulte 6d4cf4db84 org-latex: org-export-latex-format-image now accepts optional shortname
* lisp/org-latex.el (org-export-latex-format-image): updated number of
  arguments to allow for an optional short-name
2010-07-05 09:56:20 -07:00
Carsten Dominik 040b2aa6b2 Indent-mode: Disable in Emacs 21 and earlier
* lisp/org-indent.el (org-indent-mode): Refuse to turn on prior to Emacs 23.2
2010-07-05 17:46:19 +02:00
Stephen Eglen 27a4e48b0a Small doc fixes to org-feed.el and org-capture.el 2010-07-05 15:07:53 +02:00
Carsten Dominik 9e9bc16476 Capture: fix the function target 2010-07-05 08:53:48 +02:00
Carsten Dominik 8b7c742750 Capture: Put final touched to file+regexp & file+function targets
* lisp/org-capture.el (org-capture-set-target-location): Store
exact positions for file+regexp and file+function targets.
(org-capture-place-entry, org-capture-place-item)
(org-capture-place-table-line, org-capture-place-plain-text): Respect
exact positions.
(org-capture-finalize): Make sure we are at the beginning of a line
when fixing the empty lines after the entry.
2010-07-05 08:25:51 +02:00
Carsten Dominik 3f259819d6 Merge branch 'change-gnus-frame-default' 2010-07-02 16:27:27 +02:00
Carsten Dominik 57a5ef69b8 Repair the working of a LOGGING property value `nil'
* lisp/org.el (org-entry-get-with-inheritance): New argument LITERAL-NIL.
(org-entry-get): Pass `literal-nil' into
`org-entry-get-with-inheritance'.
(org-todo): React to nil values of the LOGGING property.
2010-07-02 15:49:40 +02:00
Carsten Dominik 8da31057eb Update docstring or `org-default-notes-file'
* lisp/org.el (org-default-notes-file): Update docstring
2010-07-02 10:54:12 +02:00
Carsten Dominik 708266eedd New default for the gnus frame setup
* lisp/org.el (org-link-frame-setup): Use `org-gnus-no-new-news' as default.
2010-07-02 10:32:51 +02:00
Eric Schulte 5edefbba26 a better way with babel
Of course, an updated patch is attached.

Best -- Eric
Carsten Dominik <carsten.dominik@gmail.com> writes:

> Hi Eric,
>
> I tried to apply the patch, but it does not apply cleanly, maybe due
> to other changes.  Can I ask you to update and resubmit?
>
> Thanks!
>
> - Carsten
>
> On Jun 21, 2010, at 6:37 PM, Eric Schulte wrote:
>
>> Hi Robert,
>>
>> Thanks for the thoughtful message.
>>
>> I present a couple of solutions below.
>>
>> Robert Cunningham <robut@iinet.net.au> writes:
>>
>>> G'day All,
>>>
>>> I wonder if I've missed something and there is a better way.
>>>
>>> Essentially I'm trying to use org babel with R and LaTeX to create
>>> figures
>>> with both long and short captions (for contents)
>>>
>>> I'd started with:
>>>
>>> #+CAPTION: Nice data (filled points indicate less nice data)
>>> #+LABEL:   fig:nicedata
>>> #+ATTR_LaTeX: width=0.98\textwidth
>>> #+begin_src R :file ndata.pdf :width 1000 :height 617 :exports
>>> results
>>>  dotchart(data$ndata)
>>> #+end_src
>>>
>>> which pointed to the need for long/short captions...
>>>
>>> feeling hopeful I tried:
>>>
>>> #+CAPTION: Nice data [Nice data (filled points indicate less nice
>>> data)]
>>> #+LABEL:   fig:nicedata
>>> #+ATTR_LaTeX: width=0.98\textwidth
>>> #+begin_src R :file ndata.pdf :width 1000 :height 617 :exports
>>> results
>>>  dotchart(data$ndata)
>>> #+end_src
>>>
>>
>> I'm attaching a patch [1] which adds shortname support for captions.
>> Once
>> applied, the following syntax will result in a caption with a
>> shortname
>> and a longname.
>>
>> --8<---------------cut here---------------start------------->8---
>> some pre-table text
>>
>> #+source: g-nicedata
>> #+begin_src gnuplot :file graph.png :exports results
>>  plot sin(x)
>> #+end_src
>>
>> #+Caption: [nice data]{a longer description of the niceness of the
>> data}
>> #+results: g-nicedata
>> [[file:graph.png]]
>>
>> some post-table text
>> --8<---------------cut here---------------end--------------->8---
>>
>> however, while this patch is still pending there is an Org-babel
>> solution below which should work immediately.
>>
>>>
>>>
>>> but no luck there.
>>>
>>> Next effort was to try to use R and LaTex more directly with
>>> noweb. I tried
>>> this:
>>>
>>>
>>>
>>> #+srcname: r-nicedata
>>> #+begin_src R :session :file ndata.pdf :results output :exports
>>> results
>>>  dotchart(data$ndata)
>>> #+end_src
>>>
>>>
>>> #+begin_src latex :noweb yes
>>>  \begin{figure}[htb!]
>>>    \centering
>>>    \includegraphics[width=0.98\textwidth]{<<r-nicedata()>>}
>>>    \caption[Nice data]{Nice data (filled points indicate less nice
>>> data)}
>>>    \label{fig:nicedata}
>>>  \end{figure}
>>> #+end_src
>>>
>>>
>>>
>>> This does produce the figure and long/short contents BUT ALSO
>>> produces this:
>>>
>>> #+results: r-nicedata
>>> [[file:ndata.pdf]]
>>>
>>> which upon export results in a link and consequently the plot
>>> appearing both
>>> in the figure and elsewhere. This second plot is unwelcome.
>>>
>>> I've tried assorted :results and :output options but have not found
>>> how to
>>> suppress the #+results: but still obtain the figure. I've always used
>>> the :session option.
>>>
>>> I've also tried twigging an org-export option to suppress pdf
>>> export but the
>>> link is still exported so that is not a solution.
>>>
>>> The current "working" solution is to use the noweb approach and
>>> then use sed
>>> to clean out the links to the second image-ugly to say the least!
>>>
>>
>> You were very close with the noweb approach.  The following
>> combination
>> should work -- notice the ":results silent" header argument to the
>> source block.
>>
>> --8<---------------cut here---------------start------------->8---
>> some pre-table text
>>
>> #+source: g-nicedata
>> #+begin_src gnuplot :file graph.png :results silent :exports none
>>  plot sin(x)
>> #+end_src
>>
>> #+begin_src latex :noweb yes
>>  \begin{figure}[htb!]
>>    \centering
>>    \includegraphics[width=0.98\textwidth]{<<g-nicedata()>>}
>>    \caption[Nice data]{some nice data -- filled points indicate less
>> nice data}
>>    \label{fig:nicedata}
>>  \end{figure}
>> #+end_src
>>
>> some post-table text
>> --8<---------------cut here---------------end--------------->8---
>>
>> is exported to the following latex,
>>
>> --8<---------------cut here---------------start------------->8---
>> some pre-table text
>>
>>
>>
>> \begin{figure}[htb!]
>>  \centering
>>  \includegraphics[width=0.98\textwidth]{graph.png}
>>  \caption[Nice data]{some nice data -- filled points indicate less
>> nice data}
>>  \label{fig:nicedata}
>> \end{figure}
>>
>> some post-table text
>> --8<---------------cut here---------------end--------------->8---
>>
>> Hope this helps,
>>
>> Best -- Eric
>>
>>>
>>>
>>>
>>> All this with org version 6.36c
>>>
>>>
>>> What have I missed? What is the best way to do this?
>>>
>>>
>>> Cheers,
>>>
>>> Robert Cunningham
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Please use `Reply All' to send replies to the list.
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>> Footnotes:
>> [1]  From 6a55dcab99bbd7840117b8390ab5db347d2573ef Mon Sep 17
>> 00:00:00 2001
>> From: Eric Schulte <schulte.eric@gmail.com>
>> Date: Mon, 21 Jun 2010 09:02:37 -0700
>> Subject: [PATCH] add short-names to #+captions with support for
>> latex export
>>
>>  captions specified with the following syntax
>>    #+CAPTION: [shortname]{longname}
>>  will have their short and longnames handled appropriately.
>>
>>  Thanks to Robert Cunningham for suggesting this feature.
>>
>> * lisp/org-exp.el (org-export-attach-captions-and-attributes): adding
>>  a shortname attribute to caption strings under the symbol name
>>  org-caption-shortn.
>>
>> * lisp/org-latex.el (org-export-latex-tables): handling caption short
>>  names on table export
>>
>>  (org-export-latex-convert-table.el-table): handling caption short
>>  names on table.el type table export
>>
>>  (org-export-latex-links): handling caption short names on link/image
>>  export
>>
>>  (org-export-latex-format-image): now takes an optional argument
>>  specifying a caption short name
>> ---
>> lisp/org-exp.el   |   14 +++++++++-----
>> lisp/org-latex.el |   21 ++++++++++++++-------
>> 2 files changed, 23 insertions(+), 12 deletions(-)
>>
>> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
>> index 029e4d7..466d7da 100644
>> --- a/lisp/org-exp.el
>> +++ b/lisp/org-exp.el
>> @@ -1256,7 +1256,7 @@ the current file."
>>   (goto-char (point-min))
>>   (while (re-search-forward org-bracket-link-regexp nil t)
>>     (org-if-unprotected-at (1+ (match-beginning 0))
>> -     (let* ((md (match-data))
>> +      (let* ((md (match-data))
>> 	    (desc (match-end 2))
>> 	    (link (org-link-unescape (match-string 1)))
>> 	    (slink (org-solidify-link-text link))
>> @@ -1381,8 +1381,8 @@ removed as well."
>> 					   select-tags "\\|")
>> 			 "\\):"))
>> 	 (re-excl (concat ":\\(" (mapconcat 'regexp-quote
>> -					   exclude-tags "\\|")
>> -			"\\):"))
>> +					    exclude-tags "\\|")
>> +			  "\\):"))
>> 	 beg end cont)
>>     (goto-char (point-min))
>>     (when (and select-tags
>> @@ -1593,11 +1593,14 @@ table line.  If it is a link, add it to the
>> line containing the link."
>> 		    "^[ \t]*\\(|[^-]\\)"
>> 		    "\\|"
>> 		    "^[ \t]*\\[\\[.*\\]\\][ \t]*$"))
>> -	cap attr label end)
>> +	cap shortn attr label end)
>>     (while (re-search-forward re nil t)
>>       (cond
>>        ((match-end 1)
>> -	(setq cap (concat cap (if cap " " "") (org-trim (match-string 1)))))
>> +	(setq cap (concat cap (if cap " " "") (org-trim (match-string 1))))
>> +	(when (string-match "\\[\\(.*\\)\\]{\\(.*\\)}" cap)
>> +	  (setq shortn (match-string 1 cap)
>> +		cap (match-string 2 cap))))
>>        ((match-end 2)
>> 	(setq attr (concat attr (if attr " " "") (org-trim
>> (match-string 2)))))
>>        ((match-end 3)
>> @@ -1609,6 +1612,7 @@ table line.  If it is a link, add it to the
>> line containing the link."
>> 		    (point-at-eol)))
>> 	(add-text-properties (point-at-bol) end
>> 			     (list 'org-caption cap
>> +				   'org-caption-shortn shortn
>> 				   'org-attributes attr
>> 				   'org-label label))
>> 	(if label (push (cons label label) target-alist))
>> diff --git a/lisp/org-latex.el b/lisp/org-latex.el
>> index 01a4b05..6c2aab2 100644
>> --- a/lisp/org-latex.el
>> +++ b/lisp/org-latex.el
>> @@ -1576,7 +1576,7 @@ The conversion is made depending of STRING-
>> BEFORE and STRING-AFTER."
>>              (org-table-last-column-widths (copy-sequence
>>                                             org-table-last-column-
>> widths))
>>              fnum fields line lines olines gr colgropen line-fmt align
>> -             caption label attr floatp longtblp)
>> +             caption shortn label attr floatp longtblp)
>>         (if org-export-latex-tables-verbatim
>>             (let* ((tbl (concat "\\begin{verbatim}\n" raw-table
>>                                 "\\end{verbatim}\n")))
>> @@ -1585,6 +1585,8 @@ The conversion is made depending of STRING-
>> BEFORE and STRING-AFTER."
>>           (progn
>>             (setq caption (org-find-text-property-in-string
>>                            'org-caption raw-table)
>> +		  shortn (org-find-text-property-in-string
>> +			  'org-caption-shortn raw-table)
>>                   attr (org-find-text-property-in-string
>>                         'org-attributes raw-table)
>>                   label (org-find-text-property-in-string
>> @@ -1652,7 +1654,8 @@ The conversion is made depending of STRING-
>> BEFORE and STRING-AFTER."
>>                           (if floatp "\\begin{table}[htb]\n"))
>>                         (if floatp
>>                             (format
>> -                             "\\caption{%s%s}"
>> +                             "\\caption%s{%s%s}"
>> +			     (if shortn (concat "[" shortn "]") "")
>>                              (if label (concat "\\\label{" label
>> "}") "")
>>                              (or caption "")))
>>                         (if (and longtblp caption) "\\\\\n" "\n")
>> @@ -1680,10 +1683,11 @@ The conversion is made depending of STRING-
>> BEFORE and STRING-AFTER."
>>
>> (defun org-export-latex-convert-table.el-table ()
>>   "Replace table.el table at point with LaTeX code."
>> -  (let (tbl caption label line floatp attr align rmlines)
>> +  (let (tbl caption shortn label line floatp attr align rmlines)
>>     (setq line (buffer-substring (point-at-bol) (point-at-eol))
>> 	  label (org-get-text-property-any 0 'org-label line)
>> 	  caption (org-get-text-property-any 0 'org-caption line)
>> +	  shortn (org-get-text-property-any 0 'org-caption-shortn line)
>> 	  attr (org-get-text-property-any 0 'org-attributes line)
>> 	  align (and attr (stringp attr)
>> 		     (string-match "\\<align=\\([^ \t\n\r,]+\\)" attr)
>> @@ -1721,7 +1725,8 @@ The conversion is made depending of STRING-
>> BEFORE and STRING-AFTER."
>>       (setq tbl (concat "\\begin{center}\n" tbl "\\end{center}")))
>>     (when floatp
>>       (setq tbl (concat "\\begin{table}\n"
>> -			(format "\\caption{%s%s}\n"
>> +			(format "\\caption%s{%s%s}\n"
>> +				(if shortn (format "[%s]" shortn) "")
>> 				(if label (format "\\label{%s}" label) "")
>> 				(or caption ""))
>> 			tbl
>> @@ -1822,6 +1827,7 @@ The conversion is made depending of STRING-
>> BEFORE and STRING-AFTER."
>> 			  "file")))
>> 	    (coderefp (equal type "coderef"))
>> 	    (caption (org-find-text-property-in-string 'org-caption
>> raw-
>> path))
>> +	    (shortn (org-find-text-property-in-string
>> org-caption-shortn raw-path))
>> 	    (attr (or (org-find-text-property-in-string
>> org-attributes raw-
>> path)
>> 		      (plist-get org-export-latex-options-plist
>> :latex-image-
>> options)))
>> 	    (label (org-find-text-property-in-string 'org-label raw-path))
>> @@ -1859,7 +1865,7 @@ The conversion is made depending of STRING-
>> BEFORE and STRING-AFTER."
>> 		   (plist-get org-export-latex-options-plist :inline-images))
>> 	      ;; OK, we need to inline an image
>> 	      (insert
>> -	       (org-export-latex-format-image raw-path caption label attr)))
>> +	       (org-export-latex-format-image raw-path caption label
>> attr shortn)))
>> 	     (coderefp
>> 	      (insert (format
>> 		       (org-export-get-coderef-format path desc)
>> @@ -1889,7 +1895,7 @@ The conversion is made depending of STRING-
>> BEFORE and STRING-AFTER."
>> 	     (t (insert "\\texttt{" desc "}")))))))
>>
>>
>> -(defun org-export-latex-format-image (path caption label attr)
>> +(defun org-export-latex-format-image (path caption label attr
>> &optional shortn)
>>   "Format the image element, depending on user settings."
>>   (let (ind floatp wrapp multicolumnp placement figenv)
>>     (setq floatp (or caption label))
>> @@ -1932,7 +1938,7 @@ The conversion is made depending of STRING-
>> BEFORE and STRING-AFTER."
>> 	   (floatp "\\begin{figure}%placement
>> \\centering
>> \\includegraphics[%attr]{%path}
>> -\\caption{%labelcmd%caption}
>> +\\caption%shortn{%labelcmd%caption}
>> \\end{figure}")
>> 	   (t "\\includegraphics[%attr]{%path}")))
>>
>> @@ -1953,6 +1959,7 @@ The conversion is made depending of STRING-
>> BEFORE and STRING-AFTER."
>> 			 (expand-file-name path)
>> 		       path))
>> 	       (cons "attr" attr)
>> +	       (cons "shortn" (if shortn (format "[%s]" shortn) ""))
>> 	       (cons "labelcmd" (if label (format "\\label{%s}"
>> 						  label)""))
>> 	       (cons "caption" (or caption ""))
>> --
>> 1.7.0.4
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
> - Carsten

>From 5cbb38e25a2d2eae7c3c688d347f80619ecb8463 Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@gmail.com>
Date: Thu, 1 Jul 2010 08:07:17 -0700
Subject: [PATCH] add short-names to #+captions with support for latex export

  captions specified with the following syntax
    #+CAPTION: [shortname]{longname}
  will have their short and longnames handled appropriately.

  Thanks to Robert Cunningham for suggesting this feature.

* lisp/org-exp.el (org-export-attach-captions-and-attributes): adding
  a shortname attribute to caption strings under the symbol name
  org-caption-shortn.

* lisp/org-latex.el (org-export-latex-tables): handling caption short
  names on table export

  (org-export-latex-convert-table.el-table): handling caption short
  names on table.el type table export

  (org-export-latex-links): handling caption short names on link/image
  export

  (org-export-latex-format-image): now takes an optional argument
  specifying a caption short name
2010-07-02 10:14:12 +02:00
Carsten Dominik f693238dfe Fix naming and docstring issues in `org-iswitchb'
* lisp/org.el (org-switchb): Renamed from `org-iswitchb'.  Improve
docstring.
(org-iswitchb): New alias.
(org-ido-switchb): Make alias point to `org-switchb'.
2010-07-02 09:20:15 +02:00
Carsten Dominik d0fa608267 Capture: Respect time-of-day preference in interactive template prompt.
* lisp/org-capture.el (org-capture-fill-template): Respect
time-of-day preference in template prompt.

In an interactive time prompt in a capture template, the users
preference of getting a stamp with time was not respected.

Reported by Markus Heller
2010-07-02 09:08:29 +02:00
David Maus dc9222e066 Remove superfluous lambda.
* org-feed.el (org-feed-unescape): Remove superfluous lambda.
2010-07-02 00:48:59 -04:00
Eric Schulte 7fdfd13e96 babel: cleaner initialization of org-babel-python-buffers
* lisp/babel/langs/ob-python.el (org-babel-python-buffers):
  technically this should be initialized as an alist, although in
  practice this doesn't really make any functional difference because
  whenever this variable is used it has new values properly assigned
  to it, and it is supposed to start basically empty.
2010-07-01 15:09:34 -07:00