From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Idea: Be able to use text properties as face attributes Date: Wed, 29 Mar 2017 17:21:05 +0200 Message-ID: References: <7a902f7b-d808-4d0f-8ff9-b8f07eaddf83@default>>>> <83h92e93ip.fsf@gnu.org>>>> <8080a162-700f-42cc-aec9-5fdd7c646297@default>>> <8360iu8sdm.fsf@gnu.org>>> <19e94d18-656f-4a8f-8843-4d46ffdd037b@default>> <83shlx782i.fsf@gnu.org>> <403a3ff2-464f-4eb5-9843-60592e786955@default> <83a8846srr.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1490800933 30398 195.159.176.226 (29 Mar 2017 15:22:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 29 Mar 2017 15:22:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: Drew Adams , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 29 17:22:09 2017 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 1ctFQ4-0006G1-3W for ged-emacs-devel@m.gmane.org; Wed, 29 Mar 2017 17:21:56 +0200 Original-Received: from localhost ([::1]:59595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctFQA-0001h2-4k for ged-emacs-devel@m.gmane.org; Wed, 29 Mar 2017 11:22:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctFPZ-0001fU-Q8 for emacs-devel@gnu.org; Wed, 29 Mar 2017 11:21:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctFPW-0005QN-CA for emacs-devel@gnu.org; Wed, 29 Mar 2017 11:21:25 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:56620) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ctFPW-0005My-5f; Wed, 29 Mar 2017 11:21:22 -0400 Original-Received: from cm-84.213.17.174.getinternet.no ([84.213.17.174] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ctFPF-0000dF-Th; Wed, 29 Mar 2017 17:21:12 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEX96tf6xbb82MVeJSr8 zbzRnJX1ua3++e1OenqcAAACbklEQVQ4jVWUTXPaMBCGNc5Qzpsq7tXZmJ7bOOZcqeucA2Y5RwTr zI2/33dlIKmGGQ/7eD9frd0+1ynlXBN55ja2ws7O2eWUvSdPEiKzq5gNLM8zEB8lwIGbiqviYYC8 CNkveCnoApJIQPwQFOeANAUsz+5YAIVxRzWpZyQ/F5B8oJzpoxOqc73lEJ2rdgiFt+ucaOwk1Iky tyLNorsCmrruiIgyMMfo7tSAUE519wk4ukUBoc75A0AuQJpKf5RQOecRIBp4iKutc2NlAA7I0PXW fJiaJ3Wr72srl2aHNUCgTfyr7mlsLgD27gWjlSHFYXy/ey5DnCMBsPiwi+3rr8Xb+xewi2iaaxQ7 dqqfoBdhCftF5ap+vRiXBpLlfgZoH3WFQenvb3o+AVjbABGDbRbVKvdv57OBRCW3QO7Ij9vVeIBM mDwUtFAvMbYRKm1/dr0JeMIQX0tRNtZWVodhrbw0F4p/DUBuFpFB+x27ArzMA4HagfzwkO8bU/bk ZM5tgLwfpDZgJ003IJSUfJztrojUbcT6UN2QuKr5AnLykV83ZA7lyp2uAKSdyG62c7G4FJUAchrg QALjfEtnoACKq2hgWZU1mAz0k+ajOYQ5TFFQrb+c1QPIdW1suuYCUG9QKmqe7UXBsaTwmqS97dMM IDKqHbzZ+eJgYBr7PVQJmAk26gvI2kPG2A6T7lWnz1D4n5P8aQc1oJ8ee2RAnY/TZGs4udMtFEqS e25rLDxzdQ2lNg1sOreTbhRhr6HU5hfRGRnAWS5nsLdQ9yG29FBvjofIs/2WA58GfFDifENuIJmZ TMXmf0DBFg5Pj84v4B9iUwo2+Yp4vQAAAABJRU5ErkJggg== In-Reply-To: <83a8846srr.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 29 Mar 2017 17:51:04 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 80.91.224.195 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:213501 Archived-At: Eli Zaretskii writes: > IOW, I'm still struggling to understand why you attach this feature to > faces, and to faces only. I may well be misunderstanding what Drew is asking for, because I didn't understand it the first four times he explained it, either. But I think he's asking for something that works like a face, but includes all text properties. That is: He wants to say (defprop my-prop '(:read-only t :invisible nil :font "futura")) (set-text-prop (point-min) (+ (point-min) 4) my-prop) (set-text-prop (+ (point-min) 10) (+ (point-min) 20) my-prop) and then (set-prop my-prop :invisible t) and then these two ranges would suddenly become invisible. So it's like... a CSS selector... kinda. The thing is, I think you can just cheat and this thing is already available? That is, just make my-prop a list, apply that list to the regions you are interested in, and then just mutate that list instead of using the property functions? Or does set-text-properties copy PROPERTIES before putting them on the text? I have neither tested nor read the source code. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no