From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KMb9Ni1Tll53UwAA0tVLHw (envelope-from ) for ; Wed, 15 Apr 2020 00:19:57 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YHb5NDBTll7lRgAAB5/wlQ (envelope-from ) for ; Wed, 15 Apr 2020 00:20:00 +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 aspmx2.migadu.com (Postfix) with ESMTPS id 5B5E6681ED4 for ; Wed, 15 Apr 2020 00:19:58 +0000 (UTC) Received: from localhost ([::1]:40538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOVmX-00020g-DJ for larch@yhetil.org; Tue, 14 Apr 2020 20:19:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52787) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOVmC-00020T-9R for emacs-orgmode@gnu.org; Tue, 14 Apr 2020 20:19:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jOVmA-0007WT-Sj for emacs-orgmode@gnu.org; Tue, 14 Apr 2020 20:19:36 -0400 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]:35567) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jOVmA-0007WB-Mu for emacs-orgmode@gnu.org; Tue, 14 Apr 2020 20:19:34 -0400 Received: by mail-qk1-x729.google.com with SMTP id c63so15519056qke.2 for ; Tue, 14 Apr 2020 17:19:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:references:user-agent:from:to:cc:subject:in-reply-to :message-id:date:mime-version; bh=CxfzuVoGJZyUgypcto9Ov0YfRN6GJce22Rr2XcgEP4M=; b=GmTqWPOSS+fb8EOJKv9TKwMwf875JZdaOKBf3404teTfTMhv3CLOlUZbGMrqojVuIb Z+yHG/JgqslNBQoHRdaeuneX+3wXUQHpDEsHs8f09ReoxEArbIg8R60YPfxkNzQiZSB+ kUEkg8n3/iyva/aSFhgJYCOB0f83xq168xF45uuujZhjsucomfe71BA3cdoinMfUSOpI ijwt4+jFV342DoopP8rmoNV9Tj+P5wyQcPTshPoqRmfCbCZULx9RYHorsP12n1pfe9F0 1WvvKLDEm2kY5u0TdMLCn0fZbIM/pEQEIDsteN1lcNup9CtPkjrp9rH8uxSzKpsEWV5T Eh6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=CxfzuVoGJZyUgypcto9Ov0YfRN6GJce22Rr2XcgEP4M=; b=IkPGBqtyUc70kOUW/V4rm2E7FSKNLTtYxZRUETHkAGOEyjVfP3cVjjgzSItB1Nnvm4 2B1/5SJirbHltf38YbRF5ibwtexnbBiVywkbkKMXsXkKJvvtyRetPwMAnllY8aQhC6C2 WKrneQc7+SZGybwufkfJ+bS+hBIcUUyGnrTjcH010NqDd2SUCHaAabmRNYnOts5yYZTb QHwuugWJ0UjkIFYJHTt/Wt4M5L/c+Oze6KrjJrzbl4VEAFD7EBpcONamZOsnATPu3Out uF2RYtoDw6LktdU8RKbP35fS0YfH9wr0vO7NxHc+BDJyKWwHd0E8ItHZwlDi97He9XJt Pw/g== X-Gm-Message-State: AGi0PuYaBlY6acPcW86wWA0byliquEO9Nf+dVhksSYWgNtbxx8js61hJ im8G7KYreO7320Nn47tqnzVpHANdhsI= X-Google-Smtp-Source: APiQypKnmzleQqNB9x2FQxofg/Cj1AG+IzY6xiHqzaeDdIyl9WH9dFYVutJEyKjbWoxM4W4hLyJAsQ== X-Received: by 2002:a37:9b4a:: with SMTP id d71mr23211437qke.382.1586909973061; Tue, 14 Apr 2020 17:19:33 -0700 (PDT) Received: from Johns-MacBook-Air.local ([2601:547:901:1830:b928:f519:1d98:d06]) by smtp.gmail.com with ESMTPSA id b13sm11085680qtp.46.2020.04.14.17.19.31 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Apr 2020 17:19:32 -0700 (PDT) References: <3637b672-535c-2a73-d793-9cc2f479ab2b@grinta.net> <934ea660-2aad-f450-f7a7-1ccd0195d3f0@grinta.net> User-agent: mu4e 1.3.6; emacs 26.3 From: John Kitchin To: Daniele Nicolodi Subject: Re: org-ref: xxx-add-bibtex-entry with an org-capture like interface In-reply-to: <934ea660-2aad-f450-f7a7-1ccd0195d3f0@grinta.net> Message-ID: Date: Tue, 14 Apr 2020 20:19:30 -0400 MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::729 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx2.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=GmTqWPOS; dmarc=fail reason="SPF not aligned (relaxed)" header.from=andrew.cmu.edu (policy=none); spf=pass (aspmx2.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-Scan-Result: default: False [0.09 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.57562069241855]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.27), country: US(-0.01), ip: 209.51.188.17(-0.58)]; DKIM_TRACE(0.00)[gmail.com:-]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jkitchin@andrew.cmu.edu,emacs-orgmode-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_SEVEN(0.00)[7]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[andrew.cmu.edu : SPF not aligned (relaxed),none] X-TUID: zyqD0/gvMQdA That function inserts into a bibtex file, and if you don't save it then the new entry is not "findable", so it is somewhat critical to do that in my mind. It could make sense to check if there is a file attached to the buffer though, and only save in that case. That would preserve the current behavior, and solve your problem I think. WDYT? Daniele Nicolodi writes: > On 09-04-2020 13:43, John Kitchin wrote: >> This is basically what doi-add-bibtex-entry does. There isn't one >> function that does arxiv too, but there is arxiv-add-bibtex-entry. Those >> are both commands in org-ref. These don't pop up a buffer for approval, >> that is something you would have to build yourself. >> >> There are many workflows people want, the one above works for me when I >> am writing, and just want to add entries with minimal disruption. I >> usually polish the entries later if needed. I can see a slower, approach >> like you describe too. > > Hello John, > > I have been able to hack something combining org-capture and the utility > functions you mention that implements the workflow I described. > > There is only one issue: doi-utils-insert-bibtex-entry-from-doi contains > a (save-buffer) call that does not play nicely when I call it on a > temporary buffer. Why is the (save-buffer) there? > doi-utils-insert-bibtex-entry-from-doi looks like an utility function, > thus I think it should not try to save the current buffer. What do you > think? > > Thank you. > > Cheers, > Dan -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu