From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0HH6BHjwZ2JLvgAAbAwnHQ (envelope-from ) for ; Tue, 26 Apr 2022 15:15:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id wIsKBHjwZ2IR8gAAG6o9tA (envelope-from ) for ; Tue, 26 Apr 2022 15:15:36 +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 3462321C10 for ; Tue, 26 Apr 2022 15:15:34 +0200 (CEST) Received: from localhost ([::1]:48838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njL2T-00056B-3G for larch@yhetil.org; Tue, 26 Apr 2022 09:15:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njKwB-0001Bc-H2 for emacs-orgmode@gnu.org; Tue, 26 Apr 2022 09:09:04 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]:34525) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njKw9-00032d-7d for emacs-orgmode@gnu.org; Tue, 26 Apr 2022 09:09:03 -0400 Received: by mail-ej1-x629.google.com with SMTP id g6so13135527ejw.1 for ; Tue, 26 Apr 2022 06:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew.cmu.edu; s=google-2021; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=k332ryehwahodf96u/1hor2KYPokLDE0EvSAnhkwNWU=; b=cHSFOgvl0iHbjc1+14gK6ebLPty3x7zZLMIvxi/nwGmprIGJJbtXaoDRII7jeiN5Pz jpRgVmTM711s3UfBJ+FAEo8Dhh3g9qkXaKMYkSe2EZ3O4NYvoTpTepZW7V+5ttIYQyE7 E7K59RLzVe0GDrN48lVcYPAmLCMCANrlPCMEDYppl5H37ZUy0hlewOfmTTbiTpUGwfed U3UGfXDUTdUUQfrrb7VFcfZ2KWiW7BBPftlYFr+z1zlQkZbQ+OtNA5S5WL8f6QRmdmiQ N+MOt2dlsAySpdDSsqaFgJiJyy50amSPrsP7mOZ6sSMhATkWg4iO4s5hm047ERbd0pZK chsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=k332ryehwahodf96u/1hor2KYPokLDE0EvSAnhkwNWU=; b=jbIXl95YcG7KZwyZTKQWkWTPm31WOkDW1x9C7v9prn7gFyebFSYhv3YYHd0RitHPeT n/ZabuzhJBo0T76akGGwKl3+0sk1ovZNsiW/RZnabdkY+L5r1l+83c7tdgz6XDjuRJtI +P+LRUeT2YryrTFlc7M+7iEMovm/DPrsYinOnJDhwPSRFOaWiSux/Q6scFS6zQofFC3s G2RywWYhp2oxt/q+TW6tp9kSDx1D7B9Ndbr3LxenLjk12QXJpMBR/eqArCF2IpG0hAhZ KqGYDZcFgqgMQsqorYb8ofy+mEaq9TkaNRn9YRh/HriGQ7Mula+7iasjqVRdUDVbeNtr OjBQ== X-Gm-Message-State: AOAM530lZs8zMLapj4YnhbxaBIHkeowzNs2mRwOF1Js0LAQ5z2C29WzZ D8N+9YbqN5TKbmvjYYD5JXoXxYeKKIvRozp59Z21A4giYxo= X-Google-Smtp-Source: ABdhPJyNVxtFcRm4WPIjkZQfXCz2CEfvjpFaJxratHrNT27hsscaxrzFk7KrFfArGWQack34U/IkI67VXsIxC38yyzw= X-Received: by 2002:a17:907:7252:b0:6df:75cc:615e with SMTP id ds18-20020a170907725200b006df75cc615emr21401744ejc.683.1650978538731; Tue, 26 Apr 2022 06:08:58 -0700 (PDT) MIME-Version: 1.0 References: <87zgk9vaw1.fsf@mat.ucm.es> <87fsm1ibkx.fsf@mat.ucm.es> <87h76gv5l8.fsf@localhost> <87h76gmjlo.fsf@mat.ucm.es> In-Reply-To: <87h76gmjlo.fsf@mat.ucm.es> From: John Kitchin Date: Tue, 26 Apr 2022 09:08:47 -0400 Message-ID: Subject: Re: [the culprit] To: org-mode-email Content-Type: multipart/alternative; boundary="000000000000553dce05dd8e6560" Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=johnrkitchin@gmail.com; helo=mail-ej1-x629.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650978935; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=k332ryehwahodf96u/1hor2KYPokLDE0EvSAnhkwNWU=; b=nDnPLEX3nRA62o5yS5P+QB96kAov7/bHCfCbtIBuEHLfWXWq3nTJEDFEWKhZgwVgJ6Oumy nQuufEHIcMZfzoD4hre9ezPL2tHNPv015stE0mAaP6kkgI0+nEiObRfItjPBL1Mo2mUvs4 ZG09eBO9bhGLw5Hn4tpssOhElU1/uyhcSB4GUe+5sl74sjhgcLgtaOFnlLi5s0KuDWGSb+ UifmsbQm38OIbFJNmxweZ8gUa9vGs0y07FhVen7LTxOsNLFH5TecOPoMxLPNsUVCCEcL7h 9Y/YpLgNCwoW8jJ3e6xP6YWbrmd/jBG0pH4yNMfz6KkSPZvyZRGhlCim8vkmEQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650978935; a=rsa-sha256; cv=none; b=tLo2KS/G+bklCuZVEqDIER1toWKD9J4Hth2aryunqt4cI49CRaxowRGrHkTCGwl7kC7p8z /khi1gGmG/V4tGsnUrOlj/W1y1zTkOpdzpUGUY+1A2HBsdk2cWeHYbEA1LzJdoXpCRA15R 42F+JAaZp8VwbF575xrOmGCmVkLw8YqITcPHFmddfr6vv8yTlStDr+NOMX6t8Qlkef7v2e 4Fna5YhvTHlyKgaDsVLVxwhORgPpeHXamyyOyKuL+C49kbXbK3v0NczptDyrWrtZYKcDle D0lTJEmh8FV5M8JY8UJlrIfNi29clyFFykx7Sun1+czKWMKDGUTLQzWhhfAdSw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=andrew.cmu.edu header.s=google-2021 header.b=cHSFOgvl; dmarc=pass (policy=none) header.from=andrew.cmu.edu; 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" X-Migadu-Spam-Score: -6.01 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=andrew.cmu.edu header.s=google-2021 header.b=cHSFOgvl; dmarc=pass (policy=none) header.from=andrew.cmu.edu; 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" X-Migadu-Queue-Id: 3462321C10 X-Spam-Score: -6.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: OLNVBIb4J5Rr --000000000000553dce05dd8e6560 Content-Type: text/plain; charset="UTF-8" This seems like something that could (should?) go in a personal config, as a custom function, or advice. You could, for example do something like this (lightly tested) #+BEGIN_SRC emacs-lisp (defun my-put (property value here) (interactive (list nil nil current-prefix-arg)) (if (null here) (org-set-property property value) (let* ((property (or property (org-read-property-name))) (value (or value (org-read-property-value property)))) (save-excursion (beginning-of-line) (search-forward ":") (backward-char) (insert (format ":%s: %s\n" property value)))))) #+END_SRC if you call it as M-x my-put, it just uses org-set-property. If you call it as C-u M-x my-put, it inserts the property before the point. It does not check you are in a property drawer, which could be a good idea. John ----------------------------------- Professor John Kitchin (he/him/his) Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Tue, Apr 26, 2022 at 2:43 AM Uwe Brauer wrote: > >>> "IR" == Ihor Radchenko writes: > > > Uwe Brauer writes: > >>> But it does not help, org-set-property sets always a new property at > the > >>> end of the property list. > >> > >>> Any idea what to do (besides touching the function itself) > >> > >> > >> It seems that the culprit is the function > >> org-entry-put > >> which always puts a new entry at the end of the property section. > > > You are right, org-set-property adds the property to the end of property > > drawer. I do not think that its docstring suggests anything different. > > > Do you want to propose a new feature request? I guess patches are > welcome. > > The question is what would be the best solution? > > 1. Change the behavior for org-entry-put > > 2. Or just for org-set-property. > > If it is the first option, then maybe a variable should be added > org-set-property-at-line say, what could be t or nil. > > Recently I use drawers that have a lot of properties, that I want a bit > organised, but if new properties are added always at the end, that > complicates things. What do others think (I don't have the feeling that > large drawers are very common). > --000000000000553dce05dd8e6560 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This seems like something that could (should?) go in a per= sonal config, as a custom function, or advice.

You could= , for example do something like this (lightly tested)

<= div>#+BEGIN_SRC emacs-lisp
(defun my-put (property value here)
=C2=A0= (interactive (list nil nil current-prefix-arg))
=C2=A0 (if (null here)<= br>=C2=A0 =C2=A0 =C2=A0 (org-set-property property value)
=C2=A0 =C2=A0 = (let* ((property (or property (org-read-property-name)))
=C2=A0 (value= (or value (org-read-property-value property))))
=C2=A0 =C2=A0 =C2=A0 (s= ave-excursion
(beginning-of-line)
(search-forward ":") (backward-char)
(insert (format ":%s: %s\n" property value)= )))))
#+END_SRC

if you call it as M-x my-put, i= t just uses org-set-property.

If you call it as C-= u M-x my-put, it inserts the property before the point. It does not check y= ou are in a property drawer, which could be a good idea.


John

-----------------------------------
Professor Joh= n Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engi= neering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-78= 03


On Tue, Apr 26, 2022 at= 2:43 AM Uwe Brauer <oub@mat.ucm.es> wrote:
>= ;>> "IR" =3D=3D Ihor Radchenko <yantar92@gmail.com> writes:

> Uwe Brauer <oub= @mat.ucm.es> writes:
>>> But it does not help, org-set-property sets always a new prope= rty at the
>>> end of the property list.
>>
>>> Any idea what to do (besides touching the function itself)
>>
>>
>> It seems that the culprit is the function
>> org-entry-put
>> which always puts a new entry at the end of the property section.<= br>
> You are right, org-set-property adds the property to the end of proper= ty
> drawer. I do not think that its docstring suggests anything different.=

> Do you want to propose a new feature request? I guess patches are welc= ome.

The question is what would be the best solution?

=C2=A0 =C2=A0 1. Change the behavior for org-entry-put

=C2=A0 =C2=A0 2. Or just for org-set-property.

If it is the first option, then maybe a variable should be added
org-set-property-at-line say, what could be t or nil.

Recently I use drawers that have a lot of properties, that I want a bit
organised, but if new properties are added always at the end, that
complicates things. What do others think (I don't have the feeling that=
large drawers are very common).
--000000000000553dce05dd8e6560--