Hi Nick,

It works perfectly, thanks a lot~

Chao

On Thu, Nov 18, 2010 at 9:50 AM, Nick Dokos <nicholas.do...@hp.com> wrote:

> Chao LU <looc...@gmail.com> wrote:
>
> > Dear all,
> >
> > I'm trying to define a variable, to let org-mode know different path to
> use when I'm under different system (Windows or Mac), but got trouble to get
> it
> > work. Here is the Code:
> >
> > ----
> > (defconst lch-win32-p (eq system-type 'windows-nt) "Are we on Windows?")
> > (defconst lch-mac-p (eq system-type 'darwin) "Are we on Mac")
> > (if lch-mac-p (defvar org-source-dir "~/Dropbox/org/org" "org source
> dir"))    ;For under windows, it should be My Dropbox...
> > (setq org-publish-project-alist
> >       '(
> >     ("org-notes"
> >      :base-directory org-source-dir)))
> > ----
> >
> > Apparently, this doesn't work, since the variable org-source-dir will not
> be evaluated inside the quote, but I really didn't find out how to make it
> > evaled... Does anyone has any hints?
> >
>
> You need backquote (similar to quote, but allows selective evaluation
> of internal structure) and the , (selective evaluation) mechanism:
>
> (setq org-publish-project-alist
>      `(("org-notes"
>         :base-directory ,org-source-dir)
>        ))
>
> See section 13.5 of the Emacs Lisp Reference manual for more details.
>
> HTH,
> Nick
>
_______________________________________________
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

Reply via email to