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 32KNKWhIxF/oewAA0tVLHw (envelope-from ) for ; Mon, 30 Nov 2020 01:18:32 +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 YEHQJGhIxF9CHQAAbx9fmQ (envelope-from ) for ; Mon, 30 Nov 2020 01:18:32 +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 34BA5940222 for ; Mon, 30 Nov 2020 01:18:32 +0000 (UTC) Received: from localhost ([::1]:47448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjXpm-0001MP-1g for larch@yhetil.org; Sun, 29 Nov 2020 20:18:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjXp0-0001M5-8T for emacs-orgmode@gnu.org; Sun, 29 Nov 2020 20:17:42 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:35617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kjXoy-0002rI-PB for emacs-orgmode@gnu.org; Sun, 29 Nov 2020 20:17:42 -0500 Received: by mail-pl1-x62f.google.com with SMTP id x15so5560388pll.2 for ; Sun, 29 Nov 2020 17:17:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=VilMDbIuGyOZEEprekBu3pV2mdZBaSS0mWeu7v5qwB4=; b=aHdsu/4Qp3pVX7+sd+Pt2aej3eUx6hxIZaqRamsl4+whMKRQiiMVU0PKA5pf0/nEOZ Trj4dbQiW+H+1vDfNR9Jb/Yp0nJvSiUItalzLEQxhTBX6AGb600GJzGhFqZVWTU0jFyM rljm/95TknK3+QgaQe/m0aiUSn7QnO9XXM888Uq7WsYCyuCatyf/gx7NgLJoqq1fikw0 IkMAFWVpyFHdyyQ7bWB794tw/gV8BY+m7PIXv/2jMbiYSDh0y0Yc2lwO+Hh9P2bNLLPH unp/7iKiDkSsSPdM8GnfwYjJaR0TTCy0fgC+erny+Udt9iBTuEsQKm0ev8wp/L81Qmp9 JZfA== 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:in-reply-to:references:date :message-id:mime-version; bh=VilMDbIuGyOZEEprekBu3pV2mdZBaSS0mWeu7v5qwB4=; b=G/nDxq/QmJEREJXHRVmoEDxfvEmfexUxc5a4JSE1+8nrkUWBaZW0B8fDs2J5GAh0d3 IZGPwbohav76y82Xg6j5+R1PZQt2Q0c+a3/E1C7oznT+pGaOdZU5j2bFySEWnDW6TLiX 478JXORkSj3nom4HBNJU5Y+TwMGoQK19TCWkOmgKZte3++GKDKyDVQm28MDv4EZIhHyE D6NzzShxiThuBaBTzTfXxFeDbj+O+3QeXr+/MPXUB6//uyYUF0Cyd2NbEL0dQ5AIj+q2 AShrkiolsDZOdMcVi8JudtKZVggzkROVg+pDuHdK1wSfQAZ6SlI3edOJ1sLlYRTsKNvF Zdow== X-Gm-Message-State: AOAM533vKuCBUXiIUmsRxF1NArmPVUynfSoh0FEIFgx4iiYEMJ0Rw2R1 b061OgpQM/07QDnPODHVrzk= X-Google-Smtp-Source: ABdhPJzYcxrv3q8WSkkEHyxSqH5SjyLXNbJwUtnPYeR59stZxlf9jFe8w/my67zVxp/Jr2/GXHbzWA== X-Received: by 2002:a17:90a:2e8c:: with SMTP id r12mr23285321pjd.29.1606699059491; Sun, 29 Nov 2020 17:17:39 -0800 (PST) Received: from localhost ([64.120.113.150]) by smtp.gmail.com with ESMTPSA id v145sm14166332pfc.112.2020.11.29.17.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2020 17:17:38 -0800 (PST) From: Ihor Radchenko To: gyro funch , emacs-orgmode@gnu.org Subject: Re: set source directory for org-attach In-Reply-To: References: Date: Mon, 30 Nov 2020 09:21:27 +0800 Message-ID: <87lfejzlk8.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=yantar92@gmail.com; helo=mail-pl1-x62f.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.48 X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=aHdsu/4Q; dmarc=pass (policy=none) header.from=gmail.com; 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-TUID: o39ZvOe5QHLG 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' directory instead of `default-directory'." (interactive (list (mapcar #'directory-file-name (helm-read-file-name "File to keep as an 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