From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: az Newsgroups: gmane.emacs.help Subject: Re: question concerning overlay before-strings and =?utf-8?b?cHJvcGVydHkJaW5oZXJpdGFuY2U=?= Date: Mon, 25 Apr 2011 22:42:14 +0000 (UTC) Message-ID: References: <83wrii81cm.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1303771358 14863 80.91.229.12 (25 Apr 2011 22:42:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 25 Apr 2011 22:42:38 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 26 00:42:34 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QEUUC-0007oG-SZ for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Apr 2011 00:42:33 +0200 Original-Received: from localhost ([::1]:52726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEUUC-0005hc-FO for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Apr 2011 18:42:32 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:36923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEUU7-0005hM-TV for help-gnu-emacs@gnu.org; Mon, 25 Apr 2011 18:42:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEUU7-0001N7-4u for help-gnu-emacs@gnu.org; Mon, 25 Apr 2011 18:42:27 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:57299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEUU6-0001N1-Uy for help-gnu-emacs@gnu.org; Mon, 25 Apr 2011 18:42:27 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QEUU5-0007lg-MQ for help-gnu-emacs@gnu.org; Tue, 26 Apr 2011 00:42:25 +0200 Original-Received: from pool-71-182-163-252.pitbpa.east.verizon.net ([71.182.163.252]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Apr 2011 00:42:25 +0200 Original-Received: from ujfubvur by pool-71-182-163-252.pitbpa.east.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Apr 2011 00:42:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 71.182.163.252 (Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:80843 Archived-At: > Why should the before-string "inherit" from o2? Apologies if my question was asinine, or if I appeared to be suggesting that the existing behavior was incorrect. I wasn't--I was asking if there was, currently, a way to get something like the behavior I described. As to motivation: Consider a case in which one is using before-strings to temporarily annotate bits of code, and using another set of overlays to highlight stretches of code, where the intent of the highlighting is such that it meaningfully applies to the annotation as well as to the code itself. > If we were to introduce such "inheritance", how would Emacs > determine from which overlay to "inherit"? This has already been decided and implemented for mouse-face properties: (save-excursion (goto-char 1) (insert ";; String\n") (let ((o (make-overlay 6 7)) (o2 (make-overlay 4 8))) (overlay-put o 'before-string "FOO") (overlay-put o2 'mouse-face 'highlight)))