From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CIGCKyBzXmH1dAAAgWs5BA (envelope-from ) for ; Thu, 07 Oct 2021 06:10:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id j74KJyBzXmFqSAAAbx9fmQ (envelope-from ) for ; Thu, 07 Oct 2021 04:10:08 +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 EE343292D8 for ; Thu, 7 Oct 2021 06:10:07 +0200 (CEST) Received: from localhost ([::1]:60658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYKjN-0001r2-Jb for larch@yhetil.org; Thu, 07 Oct 2021 00:10:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYKib-0001qe-5q for emacs-orgmode@gnu.org; Thu, 07 Oct 2021 00:09:17 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:44572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mYKiY-0004zU-Uj for emacs-orgmode@gnu.org; Thu, 07 Oct 2021 00:09:16 -0400 Received: by mail-pf1-x42a.google.com with SMTP id 145so4170209pfz.11 for ; Wed, 06 Oct 2021 21:09:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=ZUm5pi5uTu/dzg8nOU0jggsBxCswhEr8R4u4TiD9jjU=; b=buzEDEVpnAXfXR5xxrDiJrVjajVhE0vFV0bjj+z5K9b3f6I+ZGwSUXc2DEaMV25eVN FrTyQ9+X1UwLVXXL8cirS5bF7kkfW7rqheUfFKwBQS8pLN6g3+lEAp8GMEi56Xm9Gx5c J+gdR+p6dJVTpqVMbUp750UY/etpwbfONjWknvlon2la96eX79F8d/q861nyX+aEnEWq 453x64+6YGqeikKFUJChINWnngkIB2i9z5IIGv2l7aq9OoN6603if0ZrpVUduVpyz0fm F3IcEZeArc1/ryNR3CukGAwSokt+/3mdgJP2jNx5dtqgbRhwpgpKs8sfx13rvnBfwzYe Ypag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=ZUm5pi5uTu/dzg8nOU0jggsBxCswhEr8R4u4TiD9jjU=; b=RpyfauHL395LHOMWZCSLUn8DgpKwMCygUzvdAsmEzKQhU/Gfgws48+Bcsnm2HQ9AyR MrGsZjtsGwapQ03fJcd0SELL5YmmFDOu4HT7BQJcm2A4a18OnlETF4kasG7h0EaKnkBd jn275oPW2sA2uGgeYcvrNvVr/k9D8jhjC+nRR6d7Wv7nQAtzLjLQqJRhb3J0oKa0GOdK y93BD98Fc4cWzQDEzIIIwumrRuXUzoIfSQJNzR59Mr9PLf3I48LKsv3fSCETigzrGcXL +o4GgqtBCtUwJL2iGVkOICJViCfsPCTQbQPwUbP3GzKPRTyVprJ2++8XWF3jxUCq7/cd ZjeQ== X-Gm-Message-State: AOAM530WhALF53gmsIf7Qp9FadyEeZgCNMs+jeYPnxqh4Cr94UG6CSRj BYg0+IhI6CjYJ6uf6UwZThQ= X-Google-Smtp-Source: ABdhPJxzqx/YrTmk/fkOYV8o7am0YFwsjxPHC0BB2wSEAn+CPZQUHYHUzwz1DMGeQ9jqV9H2zs6cXQ== X-Received: by 2002:a63:4c55:: with SMTP id m21mr1613603pgl.126.1633579752779; Wed, 06 Oct 2021 21:09:12 -0700 (PDT) Received: from localhost ([103.125.234.111]) by smtp.gmail.com with ESMTPSA id z10sm21458626pfn.70.2021.10.06.21.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 21:09:12 -0700 (PDT) From: Ihor Radchenko To: Harald Judt Subject: Re: [BUG] org-context called from link in org-agenda entry returns wrong values [9.5 (9.5-g0a86ad @ /home/.emacs.d/elpa/org-9.5/)] In-Reply-To: <97c31832-9dce-c52f-038e-ccc80157b62e@gmx.at> References: <97c31832-9dce-c52f-038e-ccc80157b62e@gmx.at> Date: Thu, 07 Oct 2021 12:10:30 +0800 Message-ID: <877depxyo9.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=yantar92@gmail.com; helo=mail-pf1-x42a.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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633579808; 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=ZUm5pi5uTu/dzg8nOU0jggsBxCswhEr8R4u4TiD9jjU=; b=CcyeRdgL3TdB3u53YIbBrzMYLqIaslfCoHifdP2Mgj/eoMqyCFWYauq5Ihxsg4ZNxCPod2 x98oxux2UVzNKDuZ38/nBfQqPpVr8I7ZG7JjPn0JnlLq7bPsQmFTzocx5d9m+z5UOdrEiM jBlk0/ddIGOQmhUKgQm3dc0cxN2rdKFe3XIdixYDLKc5Q8XemU0UnC99riNZnFZ0mrKVpF xoMX0gv3tixRAmF8VTXAgmYIwrbQ2fRk4fHFRaUUAdzsIIwQRk6u9ClBqCYK0U3BYfDgQ4 t97JVUhulHIVDRTyTf2n3lLekj9q9Cu2H5j5Ko2xGhbRWtKwl4cN52bQbLLY7w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633579808; a=rsa-sha256; cv=none; b=I7hNSGkX8g7RHzznV5lllrs+ydsW9WcJIxuydn1NrXzXpY69bugQGsAijHyrv6V7eq+671 p8txtgjeB8JS/eWEwlE/OA3OEzycaPjpKmbu63gWjSY9TZw26zyRzpB/LMmA3/CFmBoyda utse1PWZHi1bDN/Ch9vG5hTZt15jXXcwiGLiqWErn+fCPEOkmNHk6BPVmtOBe268n4zA4T /vrHIIQ3L415T2h67pxPHw81P1rjsbaTuoFAq9Xdz0/7SIjRU4nn5vqBhp37thce9nNqbD nzZNdrUEJNeLfU5p0KFYgw+CubNgTmvwlSMu43OefE5sSru8ZMdTZDJQjOLCYw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=buzEDEVp; 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-Migadu-Spam-Score: -2.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=buzEDEVp; 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-Migadu-Queue-Id: EE343292D8 X-Spam-Score: -2.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: 33GwyoVE6Ree Harald Judt writes: > Hi, > > I am using this function to copy links from the agenda to the clipboard: > > (defun my-copy-org-url () > (interactive) > (let* ((link-info (assoc :link (org-context))) > ... org-context is ancient. It relies on org-links being fontified using 'org-link face and would fail for any non-standard link with :face link parameter. Moreover, the return value will be different depending on org-link-descriptive setting. We should probably deprecate this function and encourage using org-element-context. So, I recommend rewriting your code with org-element-context. > This indeed worked fine with previous versions of org, but recently started > to fail to extract the link. Example entry to put into your agenda > to test this: > > * TODO Header with [[https://orgmode.org/][Link]] > SCHEDULED: <2021-10-06 Mi 12:00> > > Now the function above should extract "https://orgmode.org/", but > instead the text extracted is "Lin". It seems that some of the faces were not applied together, making next-single-property change stop early because faces are not 'eq (though 'equal). Not sure if we really need to do anything about it. It is a bad idea to rely on next/prev-property-change in org-context anyway. Best, Ihor