From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: two basic elisp questions Date: Fri, 22 Jul 2016 12:13:06 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c06229cc050f805383bb529 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQd4X-0003yy-Re for emacs-orgmode@gnu.org; Fri, 22 Jul 2016 12:13:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQd4V-0005vM-RW for emacs-orgmode@gnu.org; Fri, 22 Jul 2016 12:13:08 -0400 Received: from mail-qk0-x22c.google.com ([2607:f8b0:400d:c09::22c]:33095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQd4V-0005vA-Lm for emacs-orgmode@gnu.org; Fri, 22 Jul 2016 12:13:07 -0400 Received: by mail-qk0-x22c.google.com with SMTP id p74so105475461qka.0 for ; Fri, 22 Jul 2016 09:13:07 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode --94eb2c06229cc050f805383bb529 Content-Type: text/plain; charset=UTF-8 On Fri, Jul 22, 2016 at 11:38 AM, Matt Price wrote: > > (2) Is it possible to set the default value for interactive file selection > to something OTHER than the currect directory of the current buffer? > Something like: > > (let > ((base-dir "./Assignment1/")) > (org-attach--attach)) > > I'd like to set different base directories when attaching files to > subtrees of different first-level trees in a buffer. I guess I would set > the value for the base directory with a property. > OK, I made some progress on this: (let ((default-directory (concat default-directory "Assignment1/") )) (call-interactively 'org-attach-attach)) However, I'd like to do something like: (let ((parent-basedir nil)) (save-excursion (outline-up-heading) (setq parent-basedir (org-get-entry "BASEDIR"))) (let ((default-directory (concat default-directory parent-basedir) )) (call-interactively 'org-attach-attach ))) But there are errors I don't understand in this code. Any hints? Thanks again! --94eb2c06229cc050f805383bb529 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Fri, Jul 22, 2016 at 11:38 AM, Matt Price <moptop99@gmail.com&= gt; wrote:

(2) Is it possibl= e to set the default value for interactive file selection to something OTHE= R than the currect directory of the current buffer? Something like:

=
(let
=C2=A0 ((base-dir "./Assignment1/"))
=C2=A0 (org-attach--attach))

I'd like to set different b= ase directories when attaching files to subtrees of different first-level t= rees in a buffer. I guess I would set the value for the base directory with= a property.

OK, I made some pr= ogress on this:

(let ((default-directory=C2=A0 (concat default-direc= tory "Assignment1/") )) (call-interactively 'org-attach-attac= h))

However, I'd like to do something like:

(= let
=C2=A0=C2=A0=C2=A0 ((parent-basedir nil))
=C2=A0 (save-excursion<= br>=C2=A0=C2=A0=C2=A0 (outline-up-heading)
=C2=A0=C2=A0=C2=A0 (setq pare= nt-basedir (org-get-entry "BASEDIR")))
=C2=A0 (let
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 ((default-directory (concat default-directory pare= nt-basedir) ))
=C2=A0=C2=A0=C2=A0 (call-interactively 'org-attach-at= tach=C2=A0 )))



But there are errors I don't u= nderstand in this code. Any hints? Thanks again!

<= /div> --94eb2c06229cc050f805383bb529--