Search code examples
emacspublishorg-mode

Using emacs org-mode, how to publish the unchanged files in a project?


I am running Emacs 24.3 and org-mode 8.25f. When I use M-x org-publish command, the org-mode only convert the new .org files to .html and skip all the others which have not been modified since last publish operation.

However, usually I have some changes in the publish setup and some CSS code changes. I want them to take effect to all the files, not just the recently modified ones.

So, can I tell org-mode not to skip these unchanged files?


Solution

  • This should work:

    M-: (org-publish "project name" t)
    

    This runs org-publish with FORCE set to t. From the docs:

    When optional argument FORCE is non-nil, force publishing all
    files in PROJECT.  With a non-nil optional argument ASYNC,
    publishing will be done asynchronously, in another process.
    

    As you discovered yourself, a prefix argument will also force Org to publish all files:

    C-u M-x org-publish