From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Danan Subject: [PATCH] org-attach: Allow attaching file from visited buffer Date: Thu, 21 Jun 2018 16:27:12 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000a0fe2c056f27b6e0" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW0Ya-0003aO-BB for emacs-orgmode@gnu.org; Thu, 21 Jun 2018 10:27:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW0YW-0007q8-CQ for emacs-orgmode@gnu.org; Thu, 21 Jun 2018 10:27:28 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:40526) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fW0YW-0007pd-4E for emacs-orgmode@gnu.org; Thu, 21 Jun 2018 10:27:24 -0400 Received: by mail-it0-f44.google.com with SMTP id 188-v6so5021750ita.5 for ; Thu, 21 Jun 2018 07:27:23 -0700 (PDT) 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: emacs-orgmode@gnu.org --000000000000a0fe2c056f27b6e0 Content-Type: text/plain; charset="UTF-8" Hello, When the file to attach is already open in emacs, it is generally faster to select it from the buffer list than navigating to it through the file system. This patch adds a `b' command to the attach dispatcher that reads a buffer and writes it in the attachment directory. Regards, Eric --000000000000a0fe2c056f27b6e0 Content-Type: application/octet-stream; name="0001-org-attach-Allow-attaching-file-from-visited-buffer.patch" Content-Disposition: attachment; filename="0001-org-attach-Allow-attaching-file-from-visited-buffer.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jion1iim0 RnJvbSA1OTg1NTQ4NzM2YjM5MDdhOWQyZD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