From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: Automatic minor modes? Date: Sun, 14 Oct 2018 03:59:29 +0000 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: References: <87bmelj0p4.fsf@mouse.gnus.org> <87vacthkpc.fsf@mouse.gnus.org> <1sctj9q1.fsf@lifelogs.com> <3ea6abeb-49c6-81b1-5cf2-ec9abf14fcf6@gmail.com> <866fec51-cd9b-7bbf-9e31-b71bf9786efc@gmail.com> <1s91z1rs.fsf@lifelogs.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1539489498 2501 195.159.176.226 (14 Oct 2018 03:58:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 Oct 2018 03:58:18 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 14 05:58:14 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBXXf-0000Ul-G1 for ged-emacs-devel@m.gmane.org; Sun, 14 Oct 2018 05:58:11 +0200 Original-Received: from localhost ([::1]:46998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBXZl-0006x6-Tu for ged-emacs-devel@m.gmane.org; Sun, 14 Oct 2018 00:00:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBXZ5-0006x0-7b for emacs-devel@gnu.org; Sat, 13 Oct 2018 23:59:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBXZ2-0007T7-0m for emacs-devel@gnu.org; Sat, 13 Oct 2018 23:59:39 -0400 Original-Received: from mail-yw1-xc2b.google.com ([2607:f8b0:4864:20::c2b]:45745) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gBXZ1-0007SR-Lw for emacs-devel@gnu.org; Sat, 13 Oct 2018 23:59:35 -0400 Original-Received: by mail-yw1-xc2b.google.com with SMTP id v198-v6so6395151ywg.12 for ; Sat, 13 Oct 2018 20:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lifelogs.com; s=google; h=from:to:cc:subject:organization:references:mail-copies-to:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=aBgWL3y8EodSCccyuXS+qc47bKlU0mzzQ29IY+wPwFU=; b=XLukA/hxHW1tEdXGbXV0/KoK25B6iK9ch2zvozsmfpTiJILjJ4ccCB2qPqf4LqRb58 6pD/f/hHsjOkb68eJzXdDwwQzCW7Rx24s+jX3328IeQk7Y9HoM0V/V1pJi0WSveNM68B C9NFVh/NLO8rwPN4kCMHoQQGF2V0zsM2k6WWI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:organization:references :mail-copies-to:date:in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=aBgWL3y8EodSCccyuXS+qc47bKlU0mzzQ29IY+wPwFU=; b=O0rGJ7ceObkPZEfZqMrFAy3dsJb4Q3Q3pu1TIEf0sqHtx7DU33J7VMcY5ZUkQU9dJN xclnd6FT/kmLYVov/dr+EL+47xRRbOkKbBAddmIRnMBsuLn6D89jban/vlp2sjk2C2bD odtEECivlZDjewFKABzGI+382SKvOKrJ4gTB23WNo1bqJZ1UZeMWQLcVb5vSzul5f8k5 u3XwpgUfT3llxlm+zQi6RbU2ez+xNHFMnqJH38TP4IXg+d9TzpDka0GKO/Pg0gsNPRvN wL3x1rt9f+14ydalZNHcfiApXMi/+qlsMeJ5PCsaG7P7bWHkKMWnm4ecqAZy6HgPOENs zQyA== X-Gm-Message-State: ABuFfohkMaso4mRIcnks376gP5Or/69j+IUvP2UDKmgSHN9WCPWcRm6/ /7BUC3//lpGshnqgt9n+MJszhNfdj9+OGA== X-Google-Smtp-Source: ACcGV63DbOJymk5293bj7nb4NhTQSBLNgYm49ZBvZSx5GiZjZu7+91ionvL7gqvdR600dczi9NEeeQ== X-Received: by 2002:a81:a949:: with SMTP id g70-v6mr6816638ywh.115.1539489574128; Sat, 13 Oct 2018 20:59:34 -0700 (PDT) Original-Received: from flea (c-76-28-41-155.hsd1.ma.comcast.net. [76.28.41.155]) by smtp.gmail.com with ESMTPSA id u22-v6sm1786318ywu.49.2018.10.13.20.59.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 13 Oct 2018 20:59:32 -0700 (PDT) X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never In-Reply-To: (Ted Zlatanov's message of "Tue, 09 Oct 2018 19:44:05 +0000") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::c2b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230374 Archived-At: On Tue, 09 Oct 2018 19:44:05 +0000 Ted Zlatanov wrote:=20 TZ> On Mon, 08 Oct 2018 10:57:23 -0400 Stefan Monnier wrote:=20 >>> Any ideas here? This is still a feature worth having, I think. But >>> Cl=E9ment and Stefan's comments have confused me so I don't know if it's >>> waiting for something and if there's a "right" way to do it? SM> IIUC there are many different right ways. TZ> Stefan, can you recommend one? We all trust your expertise and you did a TZ> lot of the work on prettify-symbols-mode that would apply here :) I found several other threads about this, asking more or less the same things "how to I use prettify-symbols-mode with strings/regexps" https://emacs.stackexchange.com/questions/36572/prettify-symbols-mode-and-m= ulti-character-replacements?noredirect=3D1&lq=3D1 https://emacs.stackexchange.com/questions/34808/using-prettify-symbols-with= -strings-instead-of-characters?noredirect=3D1&lq=3D1 and "how do I hide secrets in Emacs" https://www.reddit.com/r/emacs/comments/9ncypp/hide_copy_and_edit_secrets_i= n_gpg_encrypted_file/ The users are asking for this--it's not just us here. From my side, I wanted to add support for it to JSON mode (for authinfo.json users) and a netrc minor mode or something. So... I looked at several things: `reveal-mode`: the docs are simply unclear about how to use it: ;; Reveal mode is a minor mode that makes sure that text around point ;; is always visible. When point enters a region of hidden text, ;; `reveal-mode' temporarily makes it visible. ... ;; It only works with packages that hide text using overlays. ...but no explanation of how to use it, practically, just references to other packages which don't explain it either. It all seems custom-fitted together in a way that's hard to reuse. Then I looked at "(elisp) Replacing Specs" which let me to "(elisp) Other Display Specs" and "(elisp) Overlay Properties" and... it was not easy to follow when I just wanted to use reveal-mode. OK, I can make overlays with special display properties... but how do I hook that with font-lock and why do I have to know these details? I then looked at the hideshow and outline modes, and they didn't have generic functionality either, and it wasn't clear to me how to use them. I looked at prettify-symbols-mode but extending it for strings and regexps seems a bit inconsistent with how it was designed. I could hack it probably. Thus I was not able to make progress on this one. Maybe someone else will, or be able to help me. Ted