From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: coderef does not provide file path for org-insert-link when not in original buffre Date: Wed, 26 Sep 2018 15:18:04 +0200 Message-ID: <871s9gqtwz.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g59hk-0003pE-1k for emacs-orgmode@gnu.org; Wed, 26 Sep 2018 09:18:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g59hf-0005SW-0B for emacs-orgmode@gnu.org; Wed, 26 Sep 2018 09:18:11 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:58259) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g59he-0005S2-Ml for emacs-orgmode@gnu.org; Wed, 26 Sep 2018 09:18:06 -0400 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id DA4B620005 for ; Wed, 26 Sep 2018 13:18:04 +0000 (UTC) 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 List Hello, stardiviner writes: > I take a look at the org.el code of functions `org-store-link`, > `org-insert-link`, they can't inherit the original buffer file name > `buffer-file-name`. Why can't they? > So can't use `org-link-file-path-type 'adaptive` case. But I found > `org-insert-link` function definition has this snippet of code: [...] > ;; I tried to add this, but failed. because `coderef` is executed in `org-edit-src-code` which invokes `org-src--edit-element`, it create a dedicated buffer which does not have `buffer-file-name`. I don't know how to archive what I want now. > ;; ((eq org-link-file-path-type 'adaptive) In "org-src.el", we create local variables to store information from original buffer. See, e.g., `org-src--src-type' or `org-src--tab-width'. Anyway, see my first question. Regards, -- Nicolas Goaziou 0x80A93738