From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id WDWCNleNHmWxXgAAauVa8A:P1 (envelope-from ) for ; Thu, 05 Oct 2023 12:18:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WDWCNleNHmWxXgAAauVa8A (envelope-from ) for ; Thu, 05 Oct 2023 12:17:59 +0200 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 701D73A438 for ; Thu, 5 Oct 2023 12:17:59 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=KlSML6bb; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696501079; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=mivxEIDUCEmC700E0qwZFqyRCOvAIVrJdcaaNOBM8og=; b=ocx9OvSNd8TnglD5I/OU94KTK+qfKNPcD34RosFwP3cLC1sqko3R63V0EoN1dI82n8VRWG VK/ftfFC7FAPLGnBXIa7dTX2O6Qdnvs0nmz9JGFlFGFYvN/r6en8A3+SSmjdpNvuVcKjnd O9hb3frAdDzu7vowsaxp/McAAXq6a2LHzPxshHxwg0HM/OCPA69rB5xN6+pPCRqcy+y2pI IFy09UQcPBDaKnXR0Y9FqZVTmcbNnnTe6+uxTKWgcNcXhz3Pw6wNcFwZ6pgVGdDAw0eXkw z699tmli4dtKzDoAQnqYc+/lgJoCw8gqJdQuZtWVft+IquCJZutEIvHJX1wPgw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696501079; a=rsa-sha256; cv=none; b=OCSMAJRf9WDy/UsZ8ps1nMEUOkwP8XjjEYDi28x6JYdZwuxTrMQYgIvFxQZpCPZfmytKTL r+iRzP47ZTss1B8ZkIDUwPzhUBPznpx61noNrzgKIC7fjjM6nbeLs+9LBzYY0hO3w8ckAs YjG8ehFibYxjzblmwSR8kQaNRq5LRUkBa2qkM/6nts102hSBuF635J1e+7ha0jbZ97ax+z YVtQaMX6GuXW1PJp83XGHpcDms9yNMtzGsCpzpXDz2V4MEXcgqaea76yB2Y66R37TPGK99 ZaQj6REfT9puQ+wKYq97pnOnyiVgq8sOC2s0lljMYw8tPwRcgMwpEogNEdDZjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=KlSML6bb; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoLPa-0000C4-RP; Thu, 05 Oct 2023 06:16:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoLPW-0000Ai-15 for emacs-orgmode@gnu.org; Thu, 05 Oct 2023 06:16:50 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoLPT-0000Xz-Gp for emacs-orgmode@gnu.org; Thu, 05 Oct 2023 06:16:49 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id B52BF240027 for ; Thu, 5 Oct 2023 12:16:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1696501004; bh=fSavFoz0wysqQcaVnaWz2zm72uedqR4H5lDVt+E1G/4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=KlSML6bb2BNJ4vUOvs8HZhayspJumi28iaSWTwlULLMPFrThqkI5lStYlpldlOFbt IF9XsUCKhHdqmtHIlRlj7wwbpC1rpwNXTNlOQdWJneWtqH7Q0Myjf/wUM2bmrc0zwb 97reMu4DvgZ4s0TxCuklALOk9ryYlt6Kp1XuNEflDbNSGcP6SQmFDZYtfPWmtKrwjF rpQInaH/2vLVSGnJpc7J1dqoBnaUmHUAyctLr0RlhFw2XEiL+AGwUf6wFX05Gef9uz YrSybqhGXOksxoqbBhPqUUm0uj9QclHq3v+lfpj4pfqm466o267+mmZa//mL1oszYV qV3JvmIea2MXw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S1SCH7210z9rxP; Thu, 5 Oct 2023 12:16:43 +0200 (CEST) From: Ihor Radchenko To: Guillaume MULLER Cc: "emacs-orgmode@gnu.org" Subject: Re: Bug in org-insert-link? In-Reply-To: <9c18a63c-7732-4f96-a25d-382397d0bc65@emse.fr> References: <9c18a63c-7732-4f96-a25d-382397d0bc65@emse.fr> Date: Thu, 05 Oct 2023 10:18:10 +0000 Message-ID: <878r8hjrtp.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.29 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -5.50 X-Migadu-Spam-Score: -5.50 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Queue-Id: 701D73A438 X-TUID: VBSSvtwbsWOb Guillaume MULLER writes: > ... > - Switch back to (Doom)Emacs ("window"/desktop) > - Click inside the Emacs "window" to give it focus > [Here is the problem: sometimes I forgot that I already started the org-insert-link] > - Call org-insert-link > - Paste the URL > - Validate the link creation > > Then the link is inserted where I clicked last (to give focus to the Emacs "window"). By default, Emacs moves point to where you click. You can do the same thing if you deliberately C-x o from the minibuffer. See 9.3 Editing in the Minibuffer section of Emacs manual. I see nothing wrong on the Org side. > Of course, the problem lies in my mistake of calling twice the org-insert-link method, but the behavior is very strange, and it took me some time to identify why my links were inserted at random places in my text. > > However, wouldn't it be possible to prevent it from the beginning by forbidding me to call org-insert-link twice, i.e. making it a singleton/atomic function (I don't see a UseCase where this could be useful to be able to call it inside itself, but maybe I'm wrong)? Check out 22.1 Mouse Commands for Editing section of Emacs manual. `x-mouse-click-focus-ignore-position' might be something you want to customize. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at