emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* New :base-extension parameter: :none
@ 2009-02-12 15:07 Richard KLINDA
  2009-02-12 17:14 ` Daniel Clemente
  0 siblings, 1 reply; 5+ messages in thread
From: Richard KLINDA @ 2009-02-12 15:07 UTC (permalink / raw)
  To: emacs-orgmode

Hello, I don't use filename extensions for my org files and I could not
publish my files that way because you have to give a string parameter to
:base-extension.

I modified the org-publish-get-base-files function to support a :none
keyword, that means that every file gets exported (except those thats
name start with a dot):

,----
|        '("test" . (:base-directory "~/test/"
|                    :base-extension :none  ;; <---- new :none keyword
|                    :publishing-directory "/tmp/"
|                    :with-section-numbers nil
|                    :table-of-contents nil
|                    ))
`----

Here is the modified function, 2 lines changed (look for the "<-----").
Carsten, please include this change in the next version of Org if you
think it's ok, thank you.

,----
| (defun org-publish-get-base-files (project &optional exclude-regexp)
|   "Return a list of all files in PROJECT.
| If EXCLUDE-REGEXP is set, this will be used to filter out
| matching filenames."
|   (let* ((project-plist (cdr project))
| 	 (base-dir (file-name-as-directory
| 		    (plist-get project-plist :base-directory)))
| 	 (include-list (plist-get project-plist :include))
| 	 (recurse (plist-get project-plist :recursive))
| 	 (extension (or (plist-get project-plist :base-extension) "org"))
| 	 (match (if (eq extension :none)  ;; <-----
|                     "^[^\\.]"           ;; <-----
|                     (concat "^[^\\.].*\\.\\(" extension "\\)$"))))
|     (setq org-publish-temp-files nil)
|     (org-publish-get-base-files-1 base-dir recurse match
| 				  ;; FIXME distinguish exclude regexp
| 				  ;; for skip-file and skip-dir?
| 				  exclude-regexp exclude-regexp)
|     (mapc (lambda (f)
| 	    (pushnew
| 	     (expand-file-name (concat base-dir f))
| 	     org-publish-temp-files))
| 	  include-list)
|     org-publish-temp-files))
`----

-- 
Udv, Richard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: New :base-extension parameter: :none
  2009-02-12 15:07 New :base-extension parameter: :none Richard KLINDA
@ 2009-02-12 17:14 ` Daniel Clemente
  2009-02-12 17:16   ` Daniel Clemente
  2009-02-12 17:30   ` Richard KLINDA
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Clemente @ 2009-02-12 17:14 UTC (permalink / raw)
  To: Richard KLINDA; +Cc: emacs-orgmode


Richard KLINDA <rklinda@gmail.com> writes:
> ,----
> |        '("test" . (:base-directory "~/test/"
> |                    :base-extension :none  ;; <---- new :none keyword

  Shouldn't that be
:base-extension 'none
  with a symbol instead of a keyword? I think : is for KEYwords, symbols that are going to be used as keys in a hash table.

--

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: New :base-extension parameter: :none
  2009-02-12 17:14 ` Daniel Clemente
@ 2009-02-12 17:16   ` Daniel Clemente
  2009-02-12 17:32     ` Richard KLINDA
  2009-02-12 17:30   ` Richard KLINDA
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Clemente @ 2009-02-12 17:16 UTC (permalink / raw)
  To: Richard KLINDA; +Cc: emacs-orgmode


Daniel Clemente <n142857@gmail.com> writes:
>   Shouldn't that be
> :base-extension 'none
>   with a symbol instead of a keyword? I think : is for KEYwords, symbols that are going to be used as keys in a hash table.
>

Actually... don't we have nil for that?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: New :base-extension parameter: :none
  2009-02-12 17:14 ` Daniel Clemente
  2009-02-12 17:16   ` Daniel Clemente
@ 2009-02-12 17:30   ` Richard KLINDA
  1 sibling, 0 replies; 5+ messages in thread
From: Richard KLINDA @ 2009-02-12 17:30 UTC (permalink / raw)
  To: emacs-orgmode

>>>>> Regarding 'Re: [Orgmode] New :base-extension parameter: :none'; Daniel Clemente adds:


  > Richard KLINDA <rklinda@gmail.com> writes:
  >> ,---- | '("test" . (:base-directory "~/test/" :base-extension :none
  >> | ;; <---- new :none keyword

  > Shouldn't that be :base-extension 'none with a symbol instead of a
  > keyword? 

'none is fine with me too, Carsten please change the symbol to 'none if
you think that is more in line with org conventions.

  > I think : is for KEYwords, symbols that are going to be used as keys
  > in a hash table.

Actually no, you can use keywords in situations like this, keywords are
just symbols that evaluate to themselves, it's simply a stylistic choice.

-- 
Udv, Richard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: New :base-extension parameter: :none
  2009-02-12 17:16   ` Daniel Clemente
@ 2009-02-12 17:32     ` Richard KLINDA
  0 siblings, 0 replies; 5+ messages in thread
From: Richard KLINDA @ 2009-02-12 17:32 UTC (permalink / raw)
  To: emacs-orgmode

>>>>> Regarding 'Re: [Orgmode] New :base-extension parameter: :none'; Daniel Clemente adds:


  > Daniel Clemente <n142857@gmail.com> writes:
  >> Shouldn't that be :base-extension 'none with a symbol instead of a
  >> keyword? I think : is for KEYwords, symbols that are going to be
  >> used as keys in a hash table.

  > Actually... don't we have nil for that?

,----[ org-publish.el ] 
| 	 (extension (or (plist-get project-plist :base-extension) "org"))
`----

Nil (default case) gets replaced by "org" string, so we have to have
something else for the none case.

-- 
Udv, Richard

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-02-12 17:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-12 15:07 New :base-extension parameter: :none Richard KLINDA
2009-02-12 17:14 ` Daniel Clemente
2009-02-12 17:16   ` Daniel Clemente
2009-02-12 17:32     ` Richard KLINDA
2009-02-12 17:30   ` Richard KLINDA

Code repositories for project(s) associated with this 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).