0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-22 23:10:43 +00:00
Commit graph

2261 commits

Author SHA1 Message Date
Abdó Roig-Maranges 149cc04782 org.el: Option to get LaTeX preview in the same color as text face
* org.el (org-format-latex-options): Add `auto' to docstring.
(org-format-latex): Get face colors at point and put them inside opt.
(org-create-formula-image-with-dvipng): Fix bug when colors are not
`default'.
(org-create-formula-image-with-imagemagick): Fix bug when handling
"Transparent" bg color.
(org-dvipng-color-format): Same as `org-latex-color-format' for
dvipng-style color specification.

If `auto' is used for the :foreground or :background value in
org-format-latex-options, the the appropriate color is chosen
from the face in which the formula is displayed.
2012-09-12 12:45:44 +02:00
Eric Schulte 27101a3e0e resurrect org-create-formula-image
This commit resurrects the `org-create-formula-image' function which was
removed in commit a9d3ce.  This function is still called elsewhere, and
provides a simpler interface to the two backend-specific image creation
functions.

This also simplifies `org-format-latex', which still has some serious
problems such as optional arguments such as PROCESSING-TYPE which are
never assigned a default value, and extraneous variables.

At some point the `org-create-formula-image-with-imagemagick' and
`org-create-formula-image-with-dvipng' functions should be combined as a
great deal of code and logic is duplicated between the two functions.

* lisp/org.el (org-format-latex): Simplified and now makes use of the
  new `org-create-formula-image' function.
  (org-create-formula-image): Provides a simpler interface to the two
  backend-specific functions.
2012-09-09 13:30:32 -06:00
Nicolas Goaziou 8e44533339 Merge branch 'maint' 2012-09-09 14:14:54 +02:00
Nicolas Goaziou 9d334897e3 Don't consider tags as a replacement for a missing title in an headline
* lisp/org.el (org-set-regexps-and-options): Don't consider tags as
  a replacement for a missing title in an headline.
2012-09-09 14:03:36 +02:00
Bastien Guerry cf98ded2d4 Merge branch 'maint' 2012-09-06 19:41:51 +02:00
Bastien Guerry 12f46c9d00 org.el (org-version): New constant
* org.el (org-version): New constant.
2012-09-06 19:41:26 +02:00
Nicolas Goaziou eeb5b92342 Merge branch 'maint' 2012-09-04 16:14:45 +02:00
Nicolas Goaziou dd28223042 Remove duplicate code
* lisp/org.el (org-setup-filling): Remove duplicate code.
2012-09-04 16:14:08 +02:00
Jambunathan K b9270bf46f * lisp/org.el (org-open-file): Print shell command used to open file 2012-09-03 19:19:23 +05:30
Bastien Guerry 0fa4255eab Merge branch 'maint' 2012-09-03 11:19:28 +02:00
Nicolas Goaziou 8d599a4eb2 Make sure fill prefix is computed from beginning of line
* lisp/org.el (org-adaptive-fill-function): Make sure fill prefix is
  computed from beginning of line.
2012-09-02 15:01:00 +02:00
Bastien Guerry f43c8c8100 Merge branch 'maint' 2012-09-02 13:45:18 +02:00
Bastien Guerry 727c558c0f org.el (org-read-date): Docstring fix
* org.el (org-read-date): Docstring fix.
2012-09-02 11:22:04 +02:00
Nicolas Goaziou ef3706ba92 Merge branch 'maint' 2012-09-01 21:39:08 +02:00
Nicolas Goaziou 4026f2e3ad Remove occasional spurious space character when auto-filling
* lisp/org.el (org-adaptive-fill-function): Remove occasional spurious
  space character when auto-filling.
2012-09-01 21:38:18 +02:00
Nicolas Goaziou 06bffa9120 Small refactoring
* lisp/org.el (org-macro-initialize-templates): Small refactoring.
2012-09-01 11:50:51 +02:00
Nicolas Goaziou 4a2f3c2093 Implement a basic API around macros
* lisp/org.el (org-mode): Initialize macros templates.
(org-macro-templates): New variable.
(org-macro-expand, org-macro-replace-all,
org-macro-initialize-templates): New functions.
* testing/lisp/test-org.el: Add tests.
2012-09-01 10:56:00 +02:00
Bastien Guerry cdbc2d4799 Allow using S-<left/right> to update CLOCKSUM from the column view
* org-colview.el (org-columns-next-allowed-value): Add the
CLOCKSUM property to the list of properties that can be
changed interactively from the column view.

* org.el (org-entry-put): Allow to set the CLOCKSUM property
by updating the most recent clock.  This is useful in the
column view when you want to use S-<left/right> to update the
last clock of the entry at point.

Thanks to Rainer Stengele who suggested something along those
lines.
2012-08-30 16:42:13 +02:00
Bastien Guerry 152ad3362e org.el: Refine `org-image-actual-width' again
* org.el (org-image-actual-width): New choice: use #+ATTR* or
fall back on a number.
(org-display-inline-images): Implement the new choice.
2012-08-30 15:47:34 +02:00
Bastien Guerry 928bb90861 org.el: Rename org-image-fixed-width' to org-image-actual-width' and refine
* org.el (org-image-actual-width): Rename from
`org-image-fixed-width'.  Update the docstring.  Give more
choice.
(org-display-inline-images): Use the option new choices.
2012-08-30 15:02:58 +02:00
Bastien Guerry 2e8543f5d9 org.el: New option to set a fixed width for inline images
* org.el (org-image-fixed-width): New option to set a fixed
width for inline images.
(org-display-inline-images): Use the new option.

This option only takes effect for Emacs >=24.1, build with
imagemagick support.

Thanks to Alexander Willand who requested a similar feature.
2012-08-30 14:22:48 +02:00
Bastien Guerry 5d16834906 Merge branch 'maint' 2012-08-30 10:33:33 +02:00
Mike Sperber 1e678d8cba XEmacs: Make call to `fill-paragraph' work on XEmacs.
2012-08-25  Michael Sperber  <mike@xemacs.org>

* org.el (org-fill-paragraph): Pass optional argument to
`fill-paragraph' to fix compatibility with XEmacs.
2012-08-30 10:32:54 +02:00
Bastien Guerry 383806e5ef Merge branch 'maint' 2012-08-30 10:13:59 +02:00
Mike Sperber 501db42c8c XEmacs: Default `org-self-insert-cluster-for-undo' also on XEmacs.
2012-08-25  Michael Sperber  <mike@xemacs.org>

	* org.el (org-self-insert-cluster-for-undo): Default
	`org-self-insert-cluster-for-undo' also on XEmacs.
2012-08-30 10:13:52 +02:00
Bastien Guerry b00a355adb org.el (org-mode): Set the syntax of the " character to "string quote"
* org.el (org-mode): Set the syntax of the " character to
"string quote".

Thanks to Samuel Wales for asking a related question and to Nick Dokos
for suggesting this solution.
2012-08-30 07:03:36 +02:00
Bastien Guerry d2b807b1a6 Merge branch 'maint' of orgmode.org:org-mode into maint 2012-08-28 13:39:09 +02:00
Nicolas Goaziou d58d40f0c8 Externalize filling and comments initializers
* lisp/org.el (org-mode): Call external initalizers.  Now both filling
  code and comments code have their own independant part in org.el.
(org-setup-filling): Renamed from `org-set-autofill-regexps'.
(org-setup-comments-handling): New function.
2012-08-28 13:27:58 +02:00
Nicolas Goaziou 11f119776a Improve filling
* lisp/org.el (org-fill-paragraph): Refine filling in comments and in
  paragraphs.  Allow commented blank lines.  Take into consideration
  the indentation of the second line of the paragraph being filled.
(org-comment-or-uncomment-region): Rewrite function.  Now comment
region at a fixed column: the minimal indentation of the region.
(org-fill-context-prefix): Rename function into
`org-adaptive-fill-function'. Also, In a paragraph, choose the same
prefix as the current line.
2012-08-28 13:12:09 +02:00
Bastien Guerry a9b8778b0c Code clean-up: rename some agenda internals.
* org.el (org-agenda-prepare-buffers): Rename from
`org-prepare-agenda-buffers'.
(org-match-sparse-tree, org-map-entries): Use the new names.

* org-agenda.el (org-agenda-prepare-window): Rename from
`org-prepare-agenda-window'.
(org-agenda-prepare): Rename from `org-prepare-agenda'.
(org-agenda-run-series, org-agenda-prepare, org-timeline)
(org-agenda-list, org-search-view, org-todo-list)
(org-tags-view, org-agenda-list-stuck-projects, org-diary)
(org-agenda-to-appt): Use the new names.

* org-mobile.el (org-mobile-create-index-file): Ditto.

* org-icalendar.el (org-export-icalendar): Ditto.

* org-clock.el (org-dblock-write:clocktable)
(org-dblock-write:clocktable): Ditto.

* org2rem.el (org2rem): Ditto.
2012-08-28 13:11:12 +02:00
Nicolas Goaziou 805a9f019d Add missing colon to #+INCLUDE in structure template
* lisp/org.el (org-structure-template-alist): Add missing colon to
  #+INCLUDE.
2012-08-27 09:11:01 +02:00
Nicolas Goaziou 664132667b Fix org-backward-element with point on first element in section
* lisp/org.el (org-backward-element): When called at the beginning of
  first element in section, the function shouldn't return an error but
  move point to headline or point-min instead.
* testing/lisp/test-org.el: Add test.
2012-08-26 23:44:51 +02:00
Bastien Guerry 290a035bfc Fix compiler warning. 2012-08-26 23:43:30 +02:00
Nicolas Goaziou 90f6324dbf Add missing part from commit b4604d2833
* lisp/org.el (org-fill-context-prefix): Fix incorrect output when
  called at the beginning of a plain list with an affiliated keyword.
(org-fill-paragraph): Remove useless variable.
2012-08-25 15:41:01 +02:00
Nicolas Goaziou 53334042b5 Fix bug in comment-dwin when at a keyword
* lisp/org.el (org-mode): Set back comment-start-skip so comment-dwin
  can tell a keyword from a comment.
* testing/lisp/test-org.el: Add test.
2012-08-24 21:58:48 +02:00
Nicolas Goaziou 82007c40da Fix comment auto-filling
* lisp/org.el (org-set-autofill-regexps): Install new comment line
  break function.
(org-comment-line-break-function): New function.
(org-mode): Remove unnecessary line.
2012-08-24 14:57:00 +02:00
Bastien Guerry 5e7ffbe1d4 Merge branch 'master' of orgmode.org:org-mode 2012-08-24 14:23:07 +02:00
Bastien Guerry bfe3e2102f org.el: Fix the contextual check against a function
* org.el (org-contextualize-validate-key): Fix the check
against a function.
2012-08-24 14:22:45 +02:00
Nicolas Goaziou 8a97c601a1 Do not fill verse blocks contents
* lisp/org.el (org-fill-context-prefix, org-fill-paragraph): Do not
  fill verse blocks contents.  Verse blocks can be used to format
  free-form poetry, so filling has to be done manually.
* testing/lisp/test-org.el: Remove unnecessary tests.
2012-08-24 12:58:43 +02:00
Nicolas Goaziou b1223be34d Auto-filling must not break current paragraph
* lisp/org.el (org-fill-paragraph-separate-nobreak-p): New function.
(org-set-autofill-regexps): Introduce new predicate.
(org-fill-item-nobreak-p): Remove function.
2012-08-24 12:58:42 +02:00
Bastien Guerry 10dbdf5fc2 Update the handling of agenda/capture keys contextualization.
* org.el (org-contextualize-keys): Rename from
`org-contextualize-agenda-or-capture'.  Fix normalization to
handle empty key replacement string.
(org-contextualize-validate-key): Rename from
`org-contexts-validate'.  Allow checking against a custom
function.

* org-agenda.el (org-agenda-custom-commands-contexts): Update.
(org-agenda): Use `org-contextualize-keys'.

* org-capture.el (org-capture-templates-contexts): Ditto.

* org.texi (Templates in contexts, Setting Options): Update to
reflect changes in how contexts options are processed.
2012-08-24 12:18:05 +02:00
Bastien Guerry 9d73d6d680 org.el (org-contextualize-agenda-or-capture): Normalize contexts
* org.el (org-contextualize-agenda-or-capture): Normalize
contexts.
2012-08-24 12:18:02 +02:00
Bastien Guerry 6c94ea0518 Implement key replacement depending on the contexts.
* org.el (org-contextualize-agenda-or-capture): Handle key
replacement depending on the contexts.

* org-capture.el (org-capture-templates-contexts): Allow to
use the context as a way to replace one capture template by
another one.

* org-agenda.el (org-agenda-custom-commands-contexts): Allow
to use the context as a way to replace one agenda custom
command by another one.

* org.texi (Templates in contexts): Document the new structure
of the variables `org-agenda-custom-commands-contexts' and
`org-capture-templates-contexts'.

In the setup below, X is not a real capture template, it is just
an alias to templates A and B in .txt and .el files.  A and B are
deactivated by default in all files.

(setq org-capture-templates
      '(("X" "Nothing but an alias")
	("A" "AAAA" entry (file+headline [...]))
	("B" "BBBB" entry (file+headline [...]))))

(setq org-capture-templates-contexts
      '(("A" "A" ((not-in-file . ".*")))
	("B" "B" ((not-in-file . ".*")))
	("X" "A" ((in-file . "\\.txt")))
	("X" "B" ((in-file . "\\.el")))))

Thanks to Carsten for suggesting this "key-replacement" idea!
2012-08-24 12:17:58 +02:00
Bastien Guerry d378c7b41b Implement context filtering for agenda commands and capture templates.
* org.el (org-contextualize-agenda-or-capture)
(org-rule-validate): New functions, implement context
filtering for agenda commands and capture templates.

* org-agenda.el (org-agenda-custom-commands-contexts): New
option.
(org-agenda): Use it.

* org-capture.el (org-capture-templates-contexts): New option.
(org-capture-select-template): Use it.

* org.texi (Templates in contexts): Document the new option
`org-capture-templates-contexts'.
(Storing searches): Document the new option
`org-agenda-custom-commands-contexts'.

This idea comes from Sylvain Rousseau, who implemented a similar
feature with org-context.el: https://github.com/thisirs/org-context

This implementation is a bit simpler and more general.  Simpler
because it relies on existing templates, no need to define other
contextual ones.  More general because contexts can be defined
wrt files and modes.

Thanks *very much* to Sylvain for paving the way -- certainly a
great addition to Org.
2012-08-23 11:08:47 +02:00
Bastien Guerry 841d949d9c org.el: Delete org-beginning-of-defun' and org-end-of-defun'
* org.el (org-beginning-of-defun, org-end-of-defun): Delete.
(org-mode): Set `beginning-of-defun-function' and
`end-of-defun-function' directly.
2012-08-22 19:02:39 +02:00
Bastien Guerry 53c230a9f6 org.el: Fix bug: include links abbreviations when completing
* org.el (org-insert-link): Fix bug: include links
abbreviations when completing.
2012-08-22 12:24:14 +02:00
Bastien Guerry 655c7fb360 org.el: Small docstring clean-up
* org.el (org-ds-keyword-length, org-make-tags-matcher):
Docstring clean-up.
2012-08-22 02:39:18 +02:00
Bastien Guerry 0782bea46e org.el: Add "#+MATHJAX" and "#+INFOJS_OPT" to the list of keywords for completion
* org.el (org-options-keywords): Add "#+MATHJAX" and
"#+INFOJS_OPT" to the list of keywords for completion.
2012-08-21 12:34:02 +02:00
Bastien Guerry 4eb8b05a5b org.el (org-src-prevent-auto-filling): Remove unused and useless option
* org.el (org-src-prevent-auto-filling): Remove unused and
useless option.
2012-08-20 19:22:26 +02:00
Bastien Guerry d6db2566d9 org.el: Autoload `org-element-at-point' instead of requiring org-element it in some commands
* org.el (org-element-at-point): Autoload.
(org-element-up): Remove useless declaration.
(org-fill-context-prefix, org-fill-paragraph)
(org-mark-element, org-narrow-to-element)
(org-transpose-element, org-unindent-buffer): Do not require
org-element.
2012-08-20 13:31:22 +02:00