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 SJfaJxNXnmN3PgAAbAwnHQ (envelope-from ) for ; Sun, 18 Dec 2022 00:56:03 +0100 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 SKLzJhNXnmMMDAEAG6o9tA (envelope-from ) for ; Sun, 18 Dec 2022 00:56:03 +0100 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 0E56E2F16D for ; Sun, 18 Dec 2022 00:56:02 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6h1S-0004Qx-JN; Sat, 17 Dec 2022 18:55:19 -0500 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 1p6h1P-0004Qk-3j; Sat, 17 Dec 2022 18:55:15 -0500 Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6h1M-0008Oi-D6; Sat, 17 Dec 2022 18:55:14 -0500 Received: from localhost ([::ffff:102.87.40.167]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000055D55.00000000639E56DA.000079BC; Sat, 17 Dec 2022 16:55:06 -0700 Date: Sun, 18 Dec 2022 02:54:31 +0300 From: Jean Louis To: Ihor Radchenko Cc: Sterling Hooten , emacs-orgmode@gnu.org, hyperbole-users@gnu.org Subject: Re: Completely hide properties drawer in 9.6 Message-ID: Mail-Followup-To: Ihor Radchenko , Sterling Hooten , emacs-orgmode@gnu.org, hyperbole-users@gnu.org References: <4CC6A1F4-0B08-44E0-AE4D-60CA11636663@gmail.com> <87ilibsha7.fsf@localhost> <87bko3s7gy.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87bko3s7gy.fsf@localhost> User-Agent: Mutt/2.2.9+54 (af2080d) (2022-11-21) Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-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 ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671321363; a=rsa-sha256; cv=none; b=Tb30wT2xuuyxdB2i8vRVh7PZjwXLVfudzXKDA0gCNPA3nxolP8o/H9QutW+oTwKPH63yEa mn7lBLW+Sy0uce6Ao+tmlYS/QqqYDLO60xLakXFZ8M83Ysr8zaP0ve7LVAzzba4C7nadK/ 9I7jVsTvAQSgAHGnevKaB5jxCUUh4OW4Yp7HVeOn5r6tWOACHJg9iC9aAgy/6Cr5l073Ck eX1yX1aAZ4sH0YAuZBX830NQXtTH69xwGkbghayeHjcxmwJYeWqIXpN7JD54GY6yskavT5 NTXP0NfUn8FHhe+Ha5Z+aC+8qkRUhLDklHI6KeWNoRHuttOVZc2MvVpMGSPF7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671321363; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qcCN4dal0ZDubLJ02nHHyiWGK6LfI/7LNgsJg/3o88U=; b=PsDFdrt5uSljOFzIUoPDmC0UKiRCejK/RtHVLS2sa/EqADgidwEclO8VCXb+ssD1Rpo0gC oTpkmMeSNxgqY1/H88rYfczqRAtsSrx2LuT1RLFxBVOk9JIiw06mZIYTlAEtuvPmXkV9gS FZgp4sKgmy9aJW0ZNGwvh2Gwkki06byUaGq048VrY/z/WEY8MoSGSwAfTQ884DS/tOCLDb 5NFdxtzI2EMLXmmiFx5IGdggst8rtZAY3xn/LANHwjykPiCIGp58oxQ8Zyq68CpXPgsp6M C2T2iAPlSvpkMbLa+sC/YmaiGtc8Q+ZYHum7yiPtlvV3qeum4vDOaL9h/61u6A== Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -1.79 X-Spam-Score: -1.79 X-Migadu-Queue-Id: 0E56E2F16D X-TUID: aSOtwJY/6lHo * Ihor Radchenko [2022-12-16 18:21]: > I agree that your message is on topic. Just, as I pointed, I feel like > it is a bit too broad to be useful. I may be wrong, of course. You may take it personally, but you shouldn't, as people like me, and others, may not always discuss exactly that what you would like it to be. You and people may wish to develp new Emacs packages and extend features. What you extend is what you decide, some other people make different packages, why then so much resistance and opposition just because you personally don't like idea. If you don't like it, don't engage in it. If you think it is wrong, than say why is it technically wrong, and if there is intention to extend some features, let me do it, what you don't like, you will not use anyway, and I did not tell to inject any code into main Org. When some proposal is not helpful, then feel free to give argumented analysis why it would not be helpful, instead of generalizations, personal antagonism and calling mob on me. Thanks for attention so far. Better we stop here about it. 🛑 In my opinion, my proposals were either too abstract for you, or out of your reality, and you cannot do nothing with it. Personally I use UUIDs for quick references to whatever it may be. While majority of people in many other software packages do not use UUIDs to reference to things universally, it is already in Org mode when ID is generated. It is not really new. To me it is very practical to have this simple heading with a drawer that is completely hidden, which references by using UUID to a complex set of properties. To somebody else, that may not be useful or is abstract to understand. In my work I would not like having more properties for Org heading but one, like this one: * My heading :PROPERTIES: :ID: 944334aa-acab-4e6a-8dd6-ebfd144eac6b :END: And that alone would be a reference to any other property that I personally may need. It is a link from heading to relations to many different pieces of information. If you have maybe followed some latest Hyperbole discussion, using UUIDs with Hyperbole has been shown useful. UUID itself may decide to what it is referenced. Simple click on UUID and one may be in whatever object it can be. Let us make it visual, here is the video how it works when Org headline has only UUID. Video is mock up of how properties can be removed from Org file, it uses package Hyperbole to quickly jump to properties related to UUID: https://gnu.support/images/2022/12/2022-12-18/2022-12-18-02:07:35.ogv Instead of Hyperbole, one can simply use keybindings as usual on the function which will show the properties. Following the thought of separating properties, to add a property, one would of course use a key, and add property in about the same manner as usual. To delete a property, one jumps to property list and press key like `d', to edit the property one uses either Org functions or direct editing and selecting like shown in video. Emacs 29 has SQLite built-in, there is PostgreSQL module and also rcd-hash-edit package that works in similar way as shown on video. Hashes may easily be stored in text files and read from text files. I use following functions to store data to file: ;;;; LISP DATA FUNCTIONS (defun string-to-file-force (string file) "Prints string into file, matters not if file exists. Return FILE as file name." (with-temp-file file (insert string)) file) (defun file-to-string (file) "File to string function" (with-temp-buffer (insert-file-contents file) (buffer-string))) (defun data-to-file (data file) "PRIN1 Emacs Lisp DATA to FILE" (string-to-file-force (prin1-to-string data) file)) (defun data-from-file (file) "Reads and returns Emacs Lisp data from FILE" (condition-case nil (car (read-from-string (file-to-string file))) (error nil))) Visual hash editing is one of options to store properties when database is not available. Editing of the hash looks just the same as on the video. Hash can store any kind of data. Saving hash in text file goes like this: (let ((my-hash (make-hash-table :test #'equal))) (puthash "SUMMARY" "This is my summary of the Org heading." my-hash) (data-to-file my-hash (concat (file-name-as-directory (getenv "HOME")) "my-hash.el"))) Then hash get saved: #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ("SUMMARY" "This is my summary of the Org heading.")) And can be easily read back: (let ((my-properties (data-from-file (concat (file-name-as-directory (getenv "HOME")) "my-hash.el")))) (gethash "SUMMARY" my-properties)) ➜ "This is my summary of the Org heading." And by thinking that, it is also possible to make Org functions that save properties in separate Org file automatically. In case of the heading like this: * My heading :PROPERTIES: :ID: 944334aa-acab-4e6a-8dd6-ebfd144eac6b :END: One could have a separate Org file that is used only to write properties, and which could contain something like following: * 944334aa-acab-4e6a-8dd6-ebfd144eac6b :PROPERTIES: :DATE-CREATED: 2022-12-18 :PERSON-RELATED: Ihor Radchenko :END: There are many reasons why properties should be hidden or separate from Org file, apart from aesthetics and readability. I have been sharing Org files and headings too many times to staff members (without export), and then why should other person see clocked or scheduled properties if such are not meant for that person? The above eloboration demonstrates that properties could not only be hidden from main view, but become structural and organized collection of data. Storage is possible into PostgreSQL by using emacs-libpq module or PostgreSQL packages, in Emacs 29 by using the built-in SQLite or SQLite packages, or cdb database or key/value databases, or by storing hashes into files, or by storing properties into separate Org files. Implementation is close to fingertips. Generally, using properties and UUIDs as references to properties, also liberates properties from Org mode and gives the power of referencing to any kind of text or mode. That means, having Markdown file with commented UUID, could allow the user to have the same properties as in Org mode, one could freely tag, clock-in, clock-out, schedule, deadline, etc. any kind of Markdown heading, whatabout Asciidoc, truly plain text, HTML pieces, Wiki, and other formats and files. In normal text files, I would then make UUIDs invisible inside of Emacs, when necessary: (defun rcd-uuid-reference-make-invisible () "Make all UUIDs in buffer invisible." (interactive) (save-excursion (goto-char (point-min)) (while (search-forward-regexp thing-at-point-uuid-regexp nil t) (when (thing-at-point 'uuid) (facemenu-set-invisible (match-beginning 0) (match-end 0)))))) ;; df2c9f4d-77ab-4697-842e-d7aa31ffeee3 If UUIDs are disturbing in the output, then I would have a filter to export the file without UUIDs, when necessary. And there is no need to go to property drawer to find properties, as there is the function (org-property-values "ID") ➜ ("944334aa-acab-4e6a-8dd6-ebfd144eac6b") which may be used in a function and by using key binding one could quickly jump to properties just as shown on the video, but without moving cursor to the UUID. How to hide Org properties, I do not know, as the following function can't work with font-lock in Org mode, that is something where you could say how to make org-property-drawer-re invisible? (defun rcd-org-drawer-make-invisible () "Make Org property drawers invisible." (save-excursion (goto-char (point-min)) (while (search-forward-regexp org-property-drawer-re nil t) (facemenu-set-invisible (match-beginning 0) (match-end 0))))) -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/