Peter Davis | 2 Nov 19:30 2010

Using environment variables in path names

I'm trying to set up Muse so that my projects (and ultimately my emacs 
setup files) live in a Dropbox folder.  I've set an environment 
variable, DROPBOX, to where the folder is mounted on my Win7 system.  
However, I can't publish my projects.  My emacs init.el contains:

(setq drop-box (getenv "DROPBOX"))
(setq muse-path (concat drop-box "\\Muse"))
(setq load-path (add-to-list 'load-path "~/emacsdir/muse/lisp"))
(require 'muse-mode)
(require 'muse-html)
(require 'muse-latex)
(require 'muse-project)
(setq muse-project-alist
            '(("website"            ; my various writings
               ("~/Pages" :default "index")
               (:base "html" :path "~/public_html")
               (:base "pdf" :path "~/public_html/pdf"))
              ("Info"
               (muse-path :default "index")
               (:base "html" :path (concat muse-path "\\HTML"))
               )))

But when I try to C-c C-p, I get:

     Assertion failed: (file-name-directory path)

Any clues about what I'm doing wrong, or how to fix it?

Thank you!

(Continue reading)

Martin Svenson | 2 Nov 21:49 2010
Picon

Re: Using environment variables in path names

The problem is that you're quoting (using the shorthand ') your variables, which means they will appear as symbols in your list and not be substituted.

Compare this:

(setq muse-project-alist
      (list
       '("website"            ; my various writings
     ("~/Pages" :default "index")
     (:base "html" :path "~/public_html")
     (:base "pdf" :path "~/public_html/pdf"))
       (list "Info"
         (list muse-path :default "index")
         (list :base "html" :path (concat muse-path "\\HTML")))))

If you want a nicer muse-define-project syntax, write a method or play around with a macro :)

// Martin

On Tue, Nov 2, 2010 at 7:30 PM, Peter Davis <pfd <at> pfdstudio.com> wrote:
I'm trying to set up Muse so that my projects (and ultimately my emacs setup files) live in a Dropbox folder.  I've set an environment variable, DROPBOX, to where the folder is mounted on my Win7 system.  However, I can't publish my projects.  My emacs init.el contains:

(setq drop-box (getenv "DROPBOX"))
(setq muse-path (concat drop-box "\\Muse"))
(setq load-path (add-to-list 'load-path "~/emacsdir/muse/lisp"))
(require 'muse-mode)
(require 'muse-html)
(require 'muse-latex)
(require 'muse-project)
(setq muse-project-alist
          '(("website"            ; my various writings
             ("~/Pages" :default "index")
             (:base "html" :path "~/public_html")
             (:base "pdf" :path "~/public_html/pdf"))
            ("Info"
             (muse-path :default "index")
             (:base "html" :path (concat muse-path "\\HTML"))
             )))

But when I try to C-c C-p, I get:

   Assertion failed: (file-name-directory path)


Any clues about what I'm doing wrong, or how to fix it?

Thank you!

-pd


--
--------
Peter Davis
 The Tech Curmudgeon - http://www.techcurmudgeon.com
Ideas Great and Dumb - http://www.ideasgreatanddumb.com


_______________________________________________
Muse-el-discuss mailing list
Muse-el-discuss <at> gna.org
https://mail.gna.org/listinfo/muse-el-discuss

<div>
<p>The problem is that you're quoting (using the shorthand ') your variables, which means they will appear as symbols in your list and not be substituted.<br><br>Compare this:<br><br>(setq muse-project-alist<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (list<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '("website"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; my various writings<br>&nbsp;&nbsp;&nbsp; &nbsp;("~/Pages" :default "index")<br>&nbsp;&nbsp;&nbsp; &nbsp;(:base "html" :path "~/public_html")<br>&nbsp;&nbsp;&nbsp; &nbsp;(:base "pdf" :path "~/public_html/pdf"))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (list "Info"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; (list muse-path :default "index")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; (list :base "html" :path (concat muse-path "\\HTML")))))<br><br>If you want a nicer muse-define-project syntax, write a method or play around with a macro :)<br><br>// Martin<br><br></p>
<div class="gmail_quote">On Tue, Nov 2, 2010 at 7:30 PM, Peter Davis <span dir="ltr">&lt;<a href="mailto:pfd <at> pfdstudio.com">pfd <at> pfdstudio.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">
I'm trying to set up Muse so that my projects (and ultimately my emacs setup files) live in a Dropbox folder. &nbsp;I've set an environment variable, DROPBOX, to where the folder is mounted on my Win7 system. &nbsp;However, I can't publish my projects. &nbsp;My emacs init.el contains:<br><br>
(setq drop-box (getenv "DROPBOX"))<br>
(setq muse-path (concat drop-box "\\Muse"))<br>
(setq load-path (add-to-list 'load-path "~/emacsdir/muse/lisp"))<br>
(require 'muse-mode)<br>
(require 'muse-html)<br>
(require 'muse-latex)<br>
(require 'muse-project)<br>
(setq muse-project-alist<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '(("website" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; my various writings<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;("~/Pages" :default "index")<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(:base "html" :path "~/public_html")<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(:base "pdf" :path "~/public_html/pdf"))<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ("Info"<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(muse-path :default "index")<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(:base "html" :path (concat muse-path "\\HTML"))<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)))<br><br>
But when I try to C-c C-p, I get:<br><br>
 &nbsp; &nbsp;Assertion failed: (file-name-directory path)<br><br><br>
Any clues about what I'm doing wrong, or how to fix it?<br><br>
Thank you!<br><br>
-pd<br><br><br>
-- <br>
--------<br>
Peter Davis<br>
&nbsp;The Tech Curmudgeon - <a href="http://www.techcurmudgeon.com" target="_blank">http://www.techcurmudgeon.com</a><br>
Ideas Great and Dumb - <a href="http://www.ideasgreatanddumb.com" target="_blank">http://www.ideasgreatanddumb.com</a><br><br><br>
_______________________________________________<br>
Muse-el-discuss mailing list<br><a href="mailto:Muse-el-discuss <at> gna.org" target="_blank">Muse-el-discuss <at> gna.org</a><br><a href="https://mail.gna.org/listinfo/muse-el-discuss" target="_blank">https://mail.gna.org/listinfo/muse-el-discuss</a><br>
</blockquote>
</div>
<br>
</div>
Peter Davis | 2 Nov 22:01 2010

Re: Using environment variables in path names


Excellent!  Thank you, Martin.

I'm not much of a lisp maven (yet).  I was just trying to cobble something from examples I found in the Muse doc, though obviously there are subtleties that I missed.

Thanks!

-pd


On Tue, Nov 2, 2010 at 4:49 PM, Martin Svenson <phromo <at> gmail.com> wrote:
The problem is that you're quoting (using the shorthand ') your variables, which means they will appear as symbols in your list and not be substituted.

Compare this:

(setq muse-project-alist
      (list

       '("website"            ; my various writings
     ("~/Pages" :default "index")
     (:base "html" :path "~/public_html")
     (:base "pdf" :path "~/public_html/pdf"))
       (list "Info"
         (list muse-path :default "index")
         (list :base "html" :path (concat muse-path "\\HTML")))))

If you want a nicer muse-define-project syntax, write a method or play around with a macro :)

// Martin

On Tue, Nov 2, 2010 at 7:30 PM, Peter Davis <pfd <at> pfdstudio.com> wrote:
I'm trying to set up Muse so that my projects (and ultimately my emacs setup files) live in a Dropbox folder.  I've set an environment variable, DROPBOX, to where the folder is mounted on my Win7 system.  However, I can't publish my projects.  My emacs init.el contains:

(setq drop-box (getenv "DROPBOX"))
(setq muse-path (concat drop-box "\\Muse"))
(setq load-path (add-to-list 'load-path "~/emacsdir/muse/lisp"))
(require 'muse-mode)
(require 'muse-html)
(require 'muse-latex)
(require 'muse-project)
(setq muse-project-alist
          '(("website"            ; my various writings
             ("~/Pages" :default "index")
             (:base "html" :path "~/public_html")
             (:base "pdf" :path "~/public_html/pdf"))
            ("Info"
             (muse-path :default "index")
             (:base "html" :path (concat muse-path "\\HTML"))
             )))

But when I try to C-c C-p, I get:

   Assertion failed: (file-name-directory path)


Any clues about what I'm doing wrong, or how to fix it?

Thank you!

-pd


<div>
<div><br></div>
<div>Excellent! &nbsp;Thank you, Martin.</div>
<div><br></div>
<div>I'm not much of a lisp maven (yet). &nbsp;I was just trying to cobble something from examples I found in the Muse doc, though obviously there are subtleties that I missed.</div>
<div><br></div>
<div>Thanks!</div>
<div><br></div>
<div>-pd</div>
<div><br></div>
<br><div class="gmail_quote">On Tue, Nov 2, 2010 at 4:49 PM, Martin Svenson <span dir="ltr">&lt;<a href="mailto:phromo <at> gmail.com">phromo <at> gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">The problem is that you're quoting (using the shorthand ') your variables, which means they will appear as symbols in your list and not be substituted.<br><br>Compare this:<br><br>(setq muse-project-alist<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (list<div class="im">
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '("website"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; my various writings<br>&nbsp;&nbsp;&nbsp; &nbsp;("~/Pages" :default "index")<br>&nbsp;&nbsp;&nbsp; &nbsp;(:base "html" :path "~/public_html")<br>&nbsp;&nbsp;&nbsp; &nbsp;(:base "pdf" :path "~/public_html/pdf"))<br>
</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (list "Info"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; (list muse-path :default "index")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; (list :base "html" :path (concat muse-path "\\HTML")))))<br><br>If you want a nicer muse-define-project syntax, write a method or play around with a macro :)<br><br>// Martin<br><br><div class="gmail_quote">
<div>
<div></div>
<div class="h5">On Tue, Nov 2, 2010 at 7:30 PM, Peter Davis <span dir="ltr">&lt;<a href="mailto:pfd <at> pfdstudio.com" target="_blank">pfd <at> pfdstudio.com</a>&gt;</span> wrote:<br>
</div>
</div>
<blockquote class="gmail_quote"><div>
<div></div>
<div class="h5">
I'm trying to set up Muse so that my projects (and ultimately my emacs setup files) live in a Dropbox folder. &nbsp;I've set an environment variable, DROPBOX, to where the folder is mounted on my Win7 system. &nbsp;However, I can't publish my projects. &nbsp;My emacs init.el contains:<br><br>
(setq drop-box (getenv "DROPBOX"))<br>
(setq muse-path (concat drop-box "\\Muse"))<br>
(setq load-path (add-to-list 'load-path "~/emacsdir/muse/lisp"))<br>
(require 'muse-mode)<br>
(require 'muse-html)<br>
(require 'muse-latex)<br>
(require 'muse-project)<br>
(setq muse-project-alist<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '(("website" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; my various writings<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;("~/Pages" :default "index")<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(:base "html" :path "~/public_html")<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(:base "pdf" :path "~/public_html/pdf"))<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ("Info"<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(muse-path :default "index")<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(:base "html" :path (concat muse-path "\\HTML"))<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)))<br><br>
But when I try to C-c C-p, I get:<br><br>
 &nbsp; &nbsp;Assertion failed: (file-name-directory path)<br><br><br>
Any clues about what I'm doing wrong, or how to fix it?<br><br>
Thank you!<br><br>
-pd<br>
</div>
</div></blockquote>
</div>
</blockquote>
<div><br></div>
<div><br></div>
</div>
</div>
Martin Svenson | 2 Nov 22:07 2010
Picon

Re: Using environment variables in path names

np! If I had thought before writing my mail, I would also have mentioned the backquote:

(setq muse-project-alist
      `("website" ,muse-path))

The backquote means that everything is quoted EXCEPT symbols preceded with comma. See http://cl-cookbook.sourceforge.net/macros.html and the section on backquote and you'll have a much cleaner looking setq.

On Tue, Nov 2, 2010 at 10:01 PM, Peter Davis <pfd <at> pfdstudio.com> wrote:

Excellent!  Thank you, Martin.

I'm not much of a lisp maven (yet).  I was just trying to cobble something from examples I found in the Muse doc, though obviously there are subtleties that I missed.

Thanks!

-pd


On Tue, Nov 2, 2010 at 4:49 PM, Martin Svenson <phromo <at> gmail.com> wrote:
The problem is that you're quoting (using the shorthand ') your variables, which means they will appear as symbols in your list and not be substituted.

Compare this:

(setq muse-project-alist
      (list

       '("website"            ; my various writings
     ("~/Pages" :default "index")
     (:base "html" :path "~/public_html")
     (:base "pdf" :path "~/public_html/pdf"))
       (list "Info"
         (list muse-path :default "index")
         (list :base "html" :path (concat muse-path "\\HTML")))))

If you want a nicer muse-define-project syntax, write a method or play around with a macro :)

// Martin

On Tue, Nov 2, 2010 at 7:30 PM, Peter Davis <pfd <at> pfdstudio.com> wrote:
I'm trying to set up Muse so that my projects (and ultimately my emacs setup files) live in a Dropbox folder.  I've set an environment variable, DROPBOX, to where the folder is mounted on my Win7 system.  However, I can't publish my projects.  My emacs init.el contains:

(setq drop-box (getenv "DROPBOX"))
(setq muse-path (concat drop-box "\\Muse"))
(setq load-path (add-to-list 'load-path "~/emacsdir/muse/lisp"))
(require 'muse-mode)
(require 'muse-html)
(require 'muse-latex)
(require 'muse-project)
(setq muse-project-alist
          '(("website"            ; my various writings
             ("~/Pages" :default "index")
             (:base "html" :path "~/public_html")
             (:base "pdf" :path "~/public_html/pdf"))
            ("Info"
             (muse-path :default "index")
             (:base "html" :path (concat muse-path "\\HTML"))
             )))

But when I try to C-c C-p, I get:

   Assertion failed: (file-name-directory path)


Any clues about what I'm doing wrong, or how to fix it?

Thank you!

-pd



_______________________________________________
Muse-el-discuss mailing list
Muse-el-discuss <at> gna.org
https://mail.gna.org/listinfo/muse-el-discuss


<div>
<p>np! If I had thought before writing my mail, I would also have mentioned the backquote:<br><br>(setq muse-project-alist<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `("website" ,muse-path))<br><br>The backquote means that everything is quoted EXCEPT symbols preceded with comma. See <a href="http://cl-cookbook.sourceforge.net/macros.html">http://cl-cookbook.sourceforge.net/macros.html</a> and the section on backquote and you'll have a much cleaner looking setq.<br><br></p>
<div class="gmail_quote">On Tue, Nov 2, 2010 at 10:01 PM, Peter Davis <span dir="ltr">&lt;<a href="mailto:pfd <at> pfdstudio.com">pfd <at> pfdstudio.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">
<div><br></div>
<div>Excellent! &nbsp;Thank you, Martin.</div>
<div><br></div>
<div>I'm not much of a lisp maven (yet). &nbsp;I was just trying to cobble something from examples I found in the Muse doc, though obviously there are subtleties that I missed.</div>

<div><br></div>
<div>Thanks!</div>
<div><br></div>
<div>-pd</div>
<div>
<div></div>
<div class="h5">
<div><br></div>
<br><div class="gmail_quote">On Tue, Nov 2, 2010 at 4:49 PM, Martin Svenson <span dir="ltr">&lt;<a href="mailto:phromo <at> gmail.com" target="_blank">phromo <at> gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">The problem is that you're quoting (using the shorthand ') your variables, which means they will appear as symbols in your list and not be substituted.<br><br>Compare this:<br><br>(setq muse-project-alist<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (list<div>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '("website"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; my various writings<br>&nbsp;&nbsp;&nbsp; &nbsp;("~/Pages" :default "index")<br>&nbsp;&nbsp;&nbsp; &nbsp;(:base "html" :path "~/public_html")<br>&nbsp;&nbsp;&nbsp; &nbsp;(:base "pdf" :path "~/public_html/pdf"))<br>
</div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (list "Info"<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; (list muse-path :default "index")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; (list :base "html" :path (concat muse-path "\\HTML")))))<br><br>If you want a nicer muse-define-project syntax, write a method or play around with a macro :)<br><br>// Martin<br><br><div class="gmail_quote">
<div>
<div></div>
<div>On Tue, Nov 2, 2010 at 7:30 PM, Peter Davis <span dir="ltr">&lt;<a href="mailto:pfd <at> pfdstudio.com" target="_blank">pfd <at> pfdstudio.com</a>&gt;</span> wrote:<br>
</div>
</div>
<blockquote class="gmail_quote"><div>
<div></div>
<div>
I'm trying to set up Muse so that my projects (and ultimately my emacs setup files) live in a Dropbox folder. &nbsp;I've set an environment variable, DROPBOX, to where the folder is mounted on my Win7 system. &nbsp;However, I can't publish my projects. &nbsp;My emacs init.el contains:<br><br>
(setq drop-box (getenv "DROPBOX"))<br>
(setq muse-path (concat drop-box "\\Muse"))<br>
(setq load-path (add-to-list 'load-path "~/emacsdir/muse/lisp"))<br>
(require 'muse-mode)<br>
(require 'muse-html)<br>
(require 'muse-latex)<br>
(require 'muse-project)<br>
(setq muse-project-alist<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '(("website" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; my various writings<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;("~/Pages" :default "index")<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(:base "html" :path "~/public_html")<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(:base "pdf" :path "~/public_html/pdf"))<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ("Info"<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(muse-path :default "index")<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(:base "html" :path (concat muse-path "\\HTML"))<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)))<br><br>
But when I try to C-c C-p, I get:<br><br>
 &nbsp; &nbsp;Assertion failed: (file-name-directory path)<br><br><br>
Any clues about what I'm doing wrong, or how to fix it?<br><br>
Thank you!<br><br>
-pd<br>
</div>
</div></blockquote>
</div>
</blockquote>
<div><br></div>
<div><br></div>
</div>
</div>
</div>
<br>_______________________________________________<br>
Muse-el-discuss mailing list<br><a href="mailto:Muse-el-discuss <at> gna.org">Muse-el-discuss <at> gna.org</a><br><a href="https://mail.gna.org/listinfo/muse-el-discuss" target="_blank">https://mail.gna.org/listinfo/muse-el-discuss</a><br><br>
</blockquote>
</div>
<br>
</div>

Gmane