From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6C9KKsj+xF96bwAA0tVLHw (envelope-from ) for ; Mon, 30 Nov 2020 14:16:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id SFQGJsj+xF9ELQAAbx9fmQ (envelope-from ) for ; Mon, 30 Nov 2020 14:16:40 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 39E5694011C for ; Mon, 30 Nov 2020 14:16:40 +0000 (UTC) Received: from localhost ([::1]:55042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjjyn-0008W9-Tw for larch@yhetil.org; Mon, 30 Nov 2020 09:16:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjjwT-0007PQ-Km for emacs-orgmode@gnu.org; Mon, 30 Nov 2020 09:14:13 -0500 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:36233) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kjjwR-00030a-Qx for emacs-orgmode@gnu.org; Mon, 30 Nov 2020 09:14:13 -0500 Received: by mail-ot1-x332.google.com with SMTP id y24so11388747otk.3 for ; Mon, 30 Nov 2020 06:14:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:reply-to :user-agent:mime-version:content-transfer-encoding; bh=pXzV4FcH4aBRGYmwMYZLCtFvW3whlyehYyaqDDMn9FU=; b=F4M0HBUx6JGzV6WZYjWIk55ctblRCWve0HjA/dKuHHOcHuyWBSurde9tpbUzw8nWun lVjkCVBsg7XMQfEZ9r3w2QDZWDDtCbT2x40vlrcC2j+YCCgII4Xg3OLZMrMzh4OAwtEZ 0DYcNJLgLpEiyeH+dmY6ky3zeIG6aLKJChENvOfTnc3ZZpCEcNRvh3oRl2YuBG1Dsk72 J8LPVGC6dCcGUPVMyO+4COBlDNNoCPkGzuJXkqjufhrO0xf7RR1Q5b8/3BoLBbd9fPZb gF5DfOJdj0RS/WfcnkHSZIPcGh6zvs+qMI86RBJj/AfQVZmUyY7KrDas8qpDHltHsCw7 hFhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:reply-to:user-agent:mime-version :content-transfer-encoding; bh=pXzV4FcH4aBRGYmwMYZLCtFvW3whlyehYyaqDDMn9FU=; b=S+5uN8rrqqwUwGnpr5zVsKkhe312bc4ecTa8uBJqJngyt/ezstN/NIVnUIO66BoRms jQ8IKl9qFTxh7QxZjl74WywFwPOSaUgeCMblP7EywOkW6v/y9mnrvuIBf/fDv77cBwue zwMKJMa7sjyLnxZEzieBN4+kL7qMDj9uFmnnxWs+FcnISoOqi1jAXnWIL6ZA6rj1DAXm 8e/2Uqy6Hn9QcTe+IE96PjC6ARUfH9euN9RfP2copb/qfvfnKqZ3HzwKf9vNmOedTMBm L1coSi5wMzR8UsCxZcOmMmb0icXV9Zi6cvw503/WilmSDpjkTFXEbA8X9znPf9FWG2vM XyLQ== X-Gm-Message-State: AOAM530EV5j5fXPx4j1nKRrHfwBCFBenOShhPOO4CYSbLgFRtemHerMV IG0ZgQkDJe4mhgBV7kTBq7ExG1gN3BY= X-Google-Smtp-Source: ABdhPJwTXv4YbWlApcEglJPWEliCbVf7mDxZsLBLChbNNgKzes7ZfRgsIO92Hz+8HMV8FkmGGHV5PQ== X-Received: by 2002:a05:6830:19cc:: with SMTP id p12mr16569551otp.297.1606745650259; Mon, 30 Nov 2020 06:14:10 -0800 (PST) Received: from [10.16.0.10] ([206.217.205.16]) by smtp.gmail.com with ESMTPSA id j18sm8201672otn.23.2020.11.30.06.14.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Nov 2020 06:14:09 -0800 (PST) From: "Gyro Funch" To: emacs-orgmode@gnu.org Subject: Re[2]: set source directory for org-attach Date: Mon, 30 Nov 2020 14:14:09 +0000 Message-Id: In-Reply-To: <87lfejzlk8.fsf@localhost> References: <87lfejzlk8.fsf@localhost> User-Agent: eM_Client/7.2.40748.0 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=gyromagnetic@gmail.com; helo=mail-ot1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Gyro Funch Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.62 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=F4M0HBUx; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 39E5694011C X-Spam-Score: -0.62 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: G6CoK7xJPQxw Thank you, Ihor. That is very helpful. Kind regards, gyro ------ Original Message ------ From: "Ihor Radchenko" To: "gyro funch" ; emacs-orgmode@gnu.org Sent: 11/29/2020 6:21:27 PM Subject: Re: set source directory for org-attach >gyro funch writes: >> I am probably missing something obvious, but is there a way to set the >> default source directory for attachments? > >Not by default. I am using the following advice (requires helm and f.el): > >(defvar yant/org-attach-default-source "~/Downloads/" > "Default directory to attach the files from.") > >(define-advice org-attach-attach (:around (oldfun files &rest args) start-= from-default-directory) > "Look for new attachments from `yant/org-attach-default-source' directo= ry instead of `default-directory'." > (interactive > (list > (mapcar #'directory-file-name (helm-read-file-name "File to keep as a= n attachment:" > :initial-input (or (progn > (require 'dired-aux) > (dired-dwim-target-directory)) > (and yant/org-attach-default-source > (f-slash yant/org-attach-default-source)) > default-directory) > :marked-candidates t)) > current-prefix-arg > nil)) > (unless (listp files) (setq files (list files))) > (mapc (lambda (file) (apply oldfun file args)) files)) > >Best, >Ihor