Commit graph

320 commits

Author SHA1 Message Date
Bastien Guerry 58f1dbccf8 Remove the "Version" header in Org libraries (leave it in org.el).
Also remove blank lines before the ";;; org*el ends here" declarations.

Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.

Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
2011-08-17 14:42:34 +02:00
Bastien Guerry 7a18799e25 Remove arch-tag at the bottom of files. 2011-08-15 20:04:38 +02:00
Bastien Guerry 904ed18bc2 Fix copyright years for elisp files in core and contrib.
Also add "This file is not part of GNU Emacs." when this is the case.
2011-08-15 15:23:11 +02:00
David Maus 545bfddeea Provide edebug specifications for macros
* org-macs.el (org-with-gensyms, org-called-interactively-p)
(with-silent-modifications, org-bound-and-true-p)
(org-unmodified, org-re, org-preserve-lc)
(org-without-partial-completion, org-with-point-at)
(org-no-warnings, org-if-unprotected, org-if-unprotected-1)
(org-if-unprotected-at, org-with-remote-undo)
(org-no-read-only, org-save-outline-visibility)
(org-with-wide-buffer, org-with-limited-levels)
(org-eval-in-environment): Provide edebug specifications.
* org-src.el (org-src-do-at-code-block): Dto.
* org-publish.el (org-publish-with-aux-preprocess-maybe): Dto.
* org-compat.el (org-xemacs-without-invisibility): Dto.
* org-clock.el (org-with-clock-position, org-with-clock): Dto.
* org-agenda.el (org-agenda-with-point-at-orig-entry)
(org-batch-agenda, org-batch-agenda-csv)
(org-batch-store-agenda-views): Dto.
* ob.el (org-babel-do-in-edit-buffer)
(org-babel-map-src-blocks, org-babel-map-inline-src-blocks): Dto.
* ob-tangle.el (org-babel-with-temp-filebuffer): Dto.
* ob-table.el (sbe): Dto.
* ob-exp.el (org-babel-exp-in-export-file): Dto.
* ob-comint.el (org-babel-comint-in-buffer)
(org-babel-comint-with-output): Dto.
2011-08-12 08:38:59 +02:00
emacs 7340cee33a Update website to show 7.7 as current release 2011-07-28 10:33:35 +00:00
Bastien Guerry f0d7acfb78 Hide .orgx files and use theindex.org directly.
Deleting .orgx files is an error -- thanks to Carsten for pointing
at this.  Instead, we "hide" them by using dotted files: .file.orgx.

Also, use theindex.org directly instead of including theindex.inc in
theindex.org.  This prevents a bug about republication of theindex.org
being skipped because the file has not been updated.

* org-publish.el (org-publish-index-generate-theindex): rename
from `org-publish-index-generate-theindex.inc'.  Use the file
theindex.org directly instead of including theindex.inc.
(org-publish-projects): Don't delete .orgx files.
(org-publish-aux-preprocess): Use .file.orgx.
2011-07-28 11:24:02 +02:00
Bastien Guerry 2610bfd052 org-publish: delete .orgx and temporary buffers.
Also add the org- prefix to some variable.

* org-publish.el (org-publish-find-title): bugfix: kill
buffers unless they were already visited.
(org-sitemap-sort-files, org-sitemap-sort-folders)
(org-sitemap-ignore-case, org-sitemap-requested)
(org-sitemap-date-format, org-sitemap-file-entry-format): use
a correct prefix.
(org-publish-projects): Make sure to delete .orgx files.
(org-publish-index-generate-theindex.inc): Small docstring
fix.
2011-07-27 14:36:54 +02:00
Bastien Guerry 5c53026d32 Fix (a lot of) compiler warnings.
Also introduce `org-pop-to-buffer-same-window' as a compatibility
function for Emacs =>24.1.
2011-07-18 19:25:10 +02:00
Jon Anders Skorpen 920cf53e68 org-publish: Fix regexp for include files
* org-publish.el (org-publish-cache-file-needs-publishing): Regexp did
  not find includes with double quoted file names.

TINYCHANGE
2011-07-16 15:01:11 +02:00
Bastien Guerry 9c05a7c781 Bump to version 7.6 2011-07-06 21:06:03 +02:00
Bastien Guerry 382e69ee6c org-publish.el: fix bug in `org-publish-cache-file-needs-publishing'.
* install/git/org-mode/lisp/org-publish.el
(org-publish-cache-file-needs-publishing): only check against .org
files.
2011-07-06 19:21:50 +02:00
Bastien Guerry c6b22dee33 org-publish.el: Take #+INCLUDE: directives into account.
* install/git/org-mode/lisp/org-publish.el
(org-publish-cache-file-needs-publishing): Takes care of more
recently included files, returning `t' in case the file including
them needs to be republished.
2011-07-06 17:04:07 +02:00
Bastien Guerry a14815aa92 org-publish.el: delete trailing whitespaces. 2011-07-03 13:07:27 +02:00
David Maus 60d24c01ea Properly handle relative symlinks when publishing
* org-publish.el (org-publish-cache-ctime-of-src): Properly handle
relative symlinks.

At Thu, 07 Apr 2011 01:11:00 -0400,
Nick Dokos wrote:
>
> org-publish-cache-ctime-of-src tries (but does not always succeed) to
> deal with symlinks: file-symlink-p returns the target as a string, but
> if the target is relative to the symlink, that's not going to fly.
> e.g. if c is a symlink like this
>
>     /a/b/c->../d/f
>
> then (file-symlink-p "/a/b/c") -> "../d/f"
> but if the current directory is any place other than /a/b, the target
> will not be found, the file attributes are going to be nil and
> the function will blow up.
2011-07-03 13:06:52 +02:00
Manuel Giraud 04c13ee6b5 Optimize getting the date for org-publish
* org-publish.el (org-publish-find-date): optimization
2011-05-02 11:13:46 +02:00
Manuel Giraud 71400037f3 Allow Sitemap links without extension
* lisp/org-publish.el (org-publish-project-alist): Document new
:sitemap-sans-extension property.
(org-publish-org-sitemap): Use new sitemap-sans-extension setting.

The following patch adds an option to remove extensions of files linked
from the auto generated sitemap. This is useful if you want to follow
this: http://www.w3.org/Provider/Style/URI
2011-05-02 09:26:15 +02:00
emacs 11a10bdfe7 Update website to show 7.5 as current release 2011-03-07 14:27:39 +00:00
Bastien Guerry 99675ffead Use `org-export-current-backend' whenever possible.
* org-special-blocks.el
(org-special-blocks-make-special-cookies): Use
`org-export-current-backend'.

* org-publish.el (org-publish-aux-preprocess): Use
`org-export-current-backend'.

* org-inlinetask.el (org-inlinetask-export-handler): Use
`org-export-current-backend'.

* org-exp.el (org-export-current-backend): New variable.
(org-export-preprocess-string)
(org-export-format-drawer-function)
(org-export-remove-or-extract-drawers)
(org-export-format-drawer)
(org-export-convert-protected-spaces)
(org-export-select-backend-specific-text)
(org-export-mark-list-end, org-export-mark-list-properties)
(org-export-attach-captions-and-attributes)
(org-export-replace-src-segments-and-examples)
(org-export-format-source-code-or-example)
(org-export-number-lines): Use the new global variable instead
of a local variable.

* org-exp-blocks.el (org-export-blocks-format-ditaa)
(org-export-blocks-format-dot)
(org-export-blocks-format-comment): Use
`org-export-current-backend'.
2011-03-01 20:01:42 +01:00
Bastien Guerry 77c278c932 Fix small typos in docstrings. 2011-02-19 12:52:26 +01:00
Bastien Guerry 4b8d74150f Fix bug: fetch the updated title of a page when creating the sitemap.
* org-publish.el (org-publish-cache-ctime-of-src): improve
docstring.
(org-publish-find-title): New option to explicitly reset the
title in the cache.
(org-publish-format-file-entry): Use this new option.

Thanks to Jonathan Bisson for reporting this.
2011-02-16 11:39:13 +01:00
Manuel Giraud dbb46ae6b1 Better sitemap formating
Hi,

Here's a patch that make the sitemap entry formating coherent with the
new html-pre/postamble one.

While here I was trying to add some documentation about this feature in
org.texi but I end up copy/pasting or paraphrasing the docstring of
correspondant customs. Is it acceptable for the documentation or plain
useless?

>From 766b0db7d0189d2edb0d8799c3424d62f9ac4e47 Mon Sep 17 00:00:00 2001
From: Manuel Giraud <manuel.giraud@univ-nantes.fr>
Date: Fri, 11 Feb 2011 15:32:58 +0100
Subject: [PATCH] org-publish.el: sitemap formating coherent with new preamble

Adopt downcase for format directive to be coherent with the new
pre/postamble formating.

Use `format-spec' function instead of `org-replace-escapes'.
2011-02-11 17:35:52 +01:00
Bastien Guerry da8dc7bba7 Rewrite the handling of HTML preamble/postamble.
* org-html.el (org-export-html-auto-preamble)
(org-export-html-auto-postamble): Remove.
(org-export-html-preamble, org-export-html-postamble): Turn
into custom variables.  Update the docstrings.
(org-export-html-preamble-format)
(org-export-html-postamble-format): New custom variables.
(org-export-as-html): Use org-export-html-postamble-format and
org-export-html-preamble-format.
(org-export-html-title-format): delete.

* org-exp.el (org-export-plist-vars): Remove
:auto-preamble and :auto-postamble.  Rename :preamble and
:postamble to :html-preamble and :html-postamble.

* org-publish.el (org-publish-project-alist): Remove
:auto-preamble and :auto-postamble.  Rename :preamble and
:postamble to :html-preamble and :html-postamble.

* org.texi (Publishing options): replace :preamble and
:auto-preamble by :html-preamble (same for postamble.)
2011-02-11 01:27:15 +01:00
Manuel Giraud 641144ef26 org-publish.el: allow formatting of sitemap entries.
* org-publish.el (org-publish-sitemap-date-format)
(org-publish-sitemap-file-entry-format): new custom variables.
(org-publish-projects): use these variables to format the
sitemap entries.
2011-02-09 17:12:18 +01:00
Manuel Giraud 334cf2038d Adds sort options when publishing the sitemap
This patch adds sort options to the sitemap.  In addition to
alphabetical order, one can choose chronological or anti-chronological
ordering of sitemap entries.  To retrieve file date, it tries to parse
the "#+date" keyword and if not present defaults to file modification
time.
2011-02-08 17:51:17 +01:00
Jan Seeger deb5f8df31 Always add sitemap file to project files if sitemap is requested
* lisp/org-publish.el (org-publish-get-base-files): Add sitemap file.

I noticed some wonkiness in getting my sitemap created on my webserver
when pushing my website, and the problem seems to lie in
org-publish-get-base-files only returning existing files, and not
picking up on the soon to be generated sitemap. My patch always adds
the sitemap file to the list of returned files if a sitemap is
requested, regardless of if it exists or not.
2011-01-26 11:03:20 +01:00
David Maus b4979a86ca Use mtime of symlink target
* lisp/org-publish.el (org-publish-cache-ctime-of-src): Use mtime of
symlink target.
2011-01-06 20:25:00 +01:00
Carsten Dominik 7666ba421f Version number back to 7.4 2010-12-10 18:49:40 +01:00
Carsten Dominik 76a25715c9 Bump version number to 7.5 2010-12-10 18:43:10 +01:00
Bastien Guerry 6630edbd0f Set version number to 7.3 2010-11-07 14:52:14 +01:00
Carsten Dominik 82af72eef7 Push version number to 7.02trans 2010-10-29 09:11:46 +02:00
Carsten Dominik d5d96f612e Improve docstring for org-publish-project-alist 2010-10-14 14:12:37 +02:00
Carsten Dominik 9f5c6557f2 Add publishing functions for ASCII, Latin-1 and UTF-8
* lisp/org-publish.el (org-publish-org-to-ascii):
(org-publish-org-to-latin1):
(org-publish-org-to-utf8): New functions.

* doc/org.texi (Publishing action): Document the new publishing functions.

Thanks to Matthias Danzl for showing how to do this.
2010-10-14 13:51:23 +02:00
Bastien Guerry cf5fbad49b org-publish-all: remove outdated comment. 2010-09-18 18:44:44 +02:00
Sebastian Rose 2fcd20e6eb Bug: Inconsistency with org-publish-attachment
Aidan Gauland <aidalgol@no8wireless.co.nz> writes:
> Sebastian Rose <sebastian_rose <at> gmx.de> writes:
>> did you revert the previous patch?  The second patch was against master
>> again.
>
> I ran git reset --hard then applied the second patch.
>
>> I changed to a subdirectory of my :base-directory (here $BASE):
>>
>> $ cd ${BASE}/subdirectory
>> $ cp ~/images/first.jpg .        # a simple image
>> $ ln -s ~/images/second.jpg      # a link to an image
>> $ ln -s ~/images/screenshots/    # a link to a directory
>>
>> When exporting, I get this tree in :publishing-directory ($PUB):
>>
>> $PUB/
>>  |-- subdirectory/
>>  |   |-- first.jpg
>>  |   |-- second.jpg
>>  |   `-- screenshots/
>>  |       |-- some.png
>>  |       `-- other.png
>>
>> which is what you expected, is that right?
>
> Yes, that's what I expected.  What I'm getting is a little different.
>
> $PUB/
> `-- subdirectory/
>     |-- screenshots/
>     |	  `-- subdirectory/
>     |	      `-- screenshots/
>     |	          |-- other.png
>     |	          `-- some.png
>     `-- subdirectory/
>         |-- first.jpg
>         |-- second.jpg
>
> This is how the project is defined...
> (setq
>  org-publish-project-alist
>  '(("static"
>     :base-directory "~/org-bug/"
>     :publishing-directory "~/org-bug-pub/"
>     :publishing-function org-publish-attachment
>     :recursive t
>     :base-extension "css\\|gz\\|bz\\|lzma\\|jpg\\|gif\\|png")))
>
> And published with this sexp.
> (org-publish "static")
>
> Perhaps the discrepancy between our setups is git commit (not sure if
> I'm using the right terms there)?  git log shows
> 878d94b472 at the top of its output.
>
> Thanks for your help!
> --Aidan

Ahrrgh :)

I just pulled, because I couldn't find that commit.

That commit already includes the (obviously wrong) first patch...

Here's the patch that reverts the first attempt and applies the new
one.   Hope this works :)

  Sebastian
2010-09-18 02:58:28 +02:00
Sebastian Rose f2eec6921f Make org-publish-attachment honor directory structure
* lisp/org-publish.el (org-publish-attachment): Put the attachment
into the right directory.

Aidan Gauland <aidalgol@no8wireless.co.nz> writes:
> On Thu, Sep 16, 2010 at 12:40:34AM +0200, Sebastian Rose wrote:
>> Aidan Gauland <aidalgol@no8wireless.co.nz> writes:
>> > Sebastian Rose <sebastian_rose <at> gmx.de> writes:
>> >> It would be a bug.
>> >>
>> >> But I cannot reproduce it (current Org mode from git, emacs24).
>> >
>> > I just figured out why: I store all my images in ~/images/ and just
>> > have symbolic links to them in my Org website directory.
>> >
>> > Can you reproduce it now that you have this piece of information?
>>
>>
>> Ah, OK.  That might be because of some call to
>>
>>   (file-truename file...)
>>
>> or similar.  `file-truename' removes symbolic links in filenames.
>>
>> Functions like this are called to make sure, the file is published only
>> if needed (i.e. the file has changed since last export).
>>
>> I'm not sure currently if it's clever to remove such calls (see
>> lisp/org-publish.el and search `file-truename').
>
> What if `file-truename' was used only to get the path of the actual
> file to copy, but the (relative) path of the link is used as the
> destination?
>
> --Aidan

Hi Aidan,

`org-publish-attachment' is wrong or called with wrong arguments.

This patch fixes it.

As always, there might be a better way to fix it,
but this way the function `org-publish-attachment' will work regardless
of parameters.  Someone will always call this function with the wrong
`PUB-DIR' parameter...

Aidan, would like to apply the patch and verify it works for you?

Best wishes,

  Sebastian
2010-09-16 18:00:59 +02:00
Bastien Guerry 11e7a573a5 org-publish.el: allow :base-directory to omit the ending slash.
This was spotted by Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl>.
2010-09-02 16:01:51 +02:00
Harri Kiiskinen 550278c135 :body-only property for publishing projects
* lisp/org-publish.el (org-publish-project-alist): Document the new
body-only property.
(org-publish-org-to): Use the body-only property.
2010-08-23 13:34:31 +02:00
Carsten Dominik 3529be82ef Fix interpretation of the :include property as a list of file names 2010-08-16 17:27:25 +02:00
Carsten Dominik dd484300d3 Publish: Better error messages if important information is missing
* lisp/org-publish.el (org-publish-file): Better error message if
base-directory or publishing-directory are not defined.
2010-07-22 11:45:04 +02:00
Carsten Dominik 6268cceec3 Mention release 7.01 on the website, push release number to 7.01trans 2010-07-19 08:33:24 +02:00
Philip Rooke ebf808f9aa Correct some docstrings [part 4]
Same rationale as previous patches in this series.

Phil
2010-07-16 21:00:36 +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 6c381070f9 Make timestamp directory even if the parent does not exist
* lisp/org-publish.el (org-publish-initialize-cache): Make
timestamp directory, the entire path to it.
2010-07-01 11:31:14 +02:00
Sebastian Rose 2700ec42c7 possible Bug: non-interactive publishing (emacs 22.1)
This patch fixes batch-mode publishing. Tested in emacs24 like this:

   sh$   emacs -q -batch --eval='(org-publish "PROJECT_NAME" t)'
2010-06-16 02:17:05 -04:00
David Maus d7e15f0c88 Serialize the publishing cache
* lisp/org-publish.el (org-publish-write-cache-file):
Write a serialized version of the cache hash.
(org-publish-initialize-cache): Reset the cache hash before creating a
new one.Serialize publishing project cache with `puthash' expressions.
2010-05-25 11:38:42 +02:00
Carsten Dominik 9cb5299bd1 Define a variable 2010-05-15 14:15:08 +02:00
David Maus 5e264e35c5 Remove superfluous third argument to `org-publish-cache-set'. 2010-05-15 00:59:53 +02:00
David Maus 54da0dce2a Use `make-hash-table' to create hash table of org-publish-cache. 2010-05-15 00:59:39 +02:00
Sebastian Rose 339d6fe4bb Publishing, cashing and timestamps
Carsten Dominik <carsten.dominik@gmail.com> writes:
> Hi Sebastian,
>
> sorry for being slow.  Could you do me a favor and send me the cache patch one
> more time - if possible updated to the current master.
>
> I am just not sure I have the right patch in my hands.

Hi Carsten,

no problem. The patch is attached.

Here is a list of my ChangeLog entries, redated to today:

2010-05-13  Sebastian Rose  <sebastian_rose@gmx.de>

	* org-publish.el (org-publish-cache): Use one big hashmap for
	each project defined in `org-publish-project-alist'. The
	hashmap will hold pairs of our timestamp-filenames and
	timestamps, as well as pairs of source-paths and associated
	plists for arbitrary values. Currently only the files title is
	stored there.

	The caching feature writes the information gathered during
	publishing to disk and re-loads it from there the next time we
	publish the same project.  All those informations will hence
	survive a restart of emacs.

	One cache file per publishing project is used. The contents of
	that file is the elisp that fills the new variable
	`org-publish-cache'.  The cache file is named according to the
	project with `.cache' added and lives in
	`org-timestamp-directory'.

	* org-publish.el (initialize-files-alist): This function and
	the variable `org-publish-files-alist' are not used anymore in
	favour of the reloadable cache and the functions for handling
	it. Removed therefor.

	* org-publish.el (org-publish-validate-link) was not used
	anywhere. Removed.

	* org-publish.el (org-publish-get-base-files): Added the
	variable `sitemap-requested' to avoid sorting where possible.
	See also end of `org-publish-get-base-files-1'.

	* org-publish.el (org-publish-get-files): This function is
	not called anymore. Removed.

	* org-publish.el (org-publish-get-project-from-filename) does
	not depend on a list of files anymore. Instead of laoding all
	files of all, we walk `org-publish-project-alist' until we
	find a project, where the properties :base-directory, :recursive,
	:base-extension, :include and :exclude match.

	* org-publish.el (org-publish-file) takes an additional
	parameter to avoid superfloues loading and writing of the
	cache file when used to publish a part of a project.
2010-05-13 20:03:35 +02:00
Carsten Dominik c86a3fc4aa Push version number to 6.36trans 2010-05-09 06:24:20 +02:00