From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Temporary notes in Emacs buffers? Date: Wed, 01 Jan 2020 02:42:39 +0100 Message-ID: <87sgl0osts.fsf@web.de> References: <87zhfecbpt.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="265536"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Help Gnu Emacs mailing list To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 01 02:43:45 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1imT32-0016yc-NO for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Jan 2020 02:43:44 +0100 Original-Received: from localhost ([::1]:47538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imT30-00072a-Ss for geh-help-gnu-emacs@m.gmane.org; Tue, 31 Dec 2019 20:43:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37991) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imT28-00070y-OL for help-gnu-emacs@gnu.org; Tue, 31 Dec 2019 20:42:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1imT27-00052u-4C for help-gnu-emacs@gnu.org; Tue, 31 Dec 2019 20:42:48 -0500 Original-Received: from mout.web.de ([212.227.17.12]:51845) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1imT26-0004ys-PM for help-gnu-emacs@gnu.org; Tue, 31 Dec 2019 20:42:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1577842960; bh=iRfb+6JiQ793tncQfa3COojQcv3VopOWWpAwlqxa1BQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=n+EeTVNW6ciSwJhRXd/de0AhJRiXF0pc15Y7s26iIXO31kZG1Z2ReMfyoJSafT8LG A8RHvCWHlVV9iz3LN9Kok8MzcPlCXpBDF9cFSTpWBYVkf1vrntgDiXhntMQVznhJWW iCPtTrlXoN+ymVwfIqrKGtWlNkbrBI+ez03xGGJ0= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([188.99.160.184]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MXpZD-1jHQSF1yy7-00WltJ; Wed, 01 Jan 2020 02:42:40 +0100 In-Reply-To: <87zhfecbpt.fsf@mbork.pl> (Marcin Borkowski's message of "Fri, 27 Dec 2019 11:19:26 +0100") X-Provags-ID: V03:K1:DLLAxl7gzkubMlLgxllx79QP4oC6r57ZS8erLAXVj5NrR1e+JCY k6qv6tWDMBGQQqn8ZbjSPMmXFCbzslZXPjBAh1em4+hR6MP5Kazeo3GbVUmiQ6DZbpc8r2E 6lnKOCYss3v+icQSsDeMuz0rR/NBVKaf9EPS2zIcllVDMayuYY2v0/FqGBgiMSCudHoKLTM qxQcLwds3wgm01lh2MCPw== X-UI-Out-Filterresults: notjunk:1;V03:K0:QKvaTBc5+d8=:acFHVOKyT2NvBC3j2Zdcja 7d49R5AxN/9hYH6/3cffSOKsBoWkg5bXRlXTPP+/kMe0ghgSSaWD5rpMePd2Fl6fAp3ZNupzW DZwPYUow/DXsPbsPXyp7gCbhEGexfWz9PrZlI+tZQRPFtQMBMwe0P6X8+/WU94N5ZQNTTZPDO 8y78eT3LJH2J2ZKnM4Gk4VH/xP8YCJpP8f+dvie96xmbo1VyyvfGCp7ZZLX5HRkcTv08K9h/c eRP/9fkS0WaY6Rk2tqDulTQAxa3DlAhU/dfftTgo6l/r1/ydz5YkgMe6p7iU5UPD1wiCHGyPH Tvjv3/WI59YGiT8Rs9+kYS//yPfhCXGx79EZPBTlfPUSKIQ6ZLUvdKAS2hdGuGQUazdKQDgst lOA5fklbqp4929ZXI3W9Q+j6eUXn+CMj7/U1spRvtSstL8Q8wFCk4BOvNk3p5qGZf2lqcNATL BB+YUoUt3V9NQh+CxkgVuEczpro7R7TAvIqNTthbKVXQeZwmU1n3W7xj+IhDx5tYx/LyMkcQb QZLXyDfEQkjZiQjWfHA8fCwg6/smblYmL03LHk8RFbfB8PhaAoems0+MjVQC2JFGfP99O59qD PyF5gwDLQqPeCrmXxm6THE090DFqySpcMXOpssVS6AfITd9bmbO5eZ5qFJ038jUZlFs+2rMXF iS7H/dINbG5Zh4RPkChqtaQSaBeiQXEcHC/TYWp79RXZGMSVMNnL41LtmKRlLo6fVDoeO8mbh SlUCkZiDa5Ovh97M8yLlgD/jiCHPAdr0xDAf8eLQMui6PH6Y4sEy6RUcDXYj9NoBZExP58wc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:122117 Archived-At: Marcin Borkowski writes: > At present, I use normal code comments, however, this is suboptimal, > since I cannot use them in certain modes (occur buffer, JSON). Is that occur buffer saved to a file? Because, if it's a dynamically created buffer, how could notes attached to it be durable at all? > Does there exist something like that? Am I the only one interested in > such a feature? (I'd be happy to code it myself, though it would take > time, of course.) I also considered to implement something like that several times. We could use overlays to assign the positions and overlay properties to store note texts and metadata. When a buffer is edited, the overlay begin and end marker positions are updated by Emacs on the fly. I would use after-save-hook or so to make Emacs save that stuff automatically for every file save. Where it is saved would be (file locally) configurable: in a file local variable, in a directory local variable, or in a configurable central place. When you open a file, a minor-mode-hook would arrange that everything is restored. There would also be a variant for dired buffers to attach notes to whole files. Michael.