From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Amos Bird Newsgroups: gmane.emacs.help Subject: Re: How can I remove effects of text properties in 'before-string Date: Mon, 23 Oct 2017 02:08:40 +0800 Message-ID: <87o9oz9hsn.fsf@gmail.com> References: <87tvyrabkk.fsf@gmail.com> <838tg3b27v.fsf@gnu.org> <87r2tv9knb.fsf@gmail.com> <834lqrayti.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: blaine.gmane.org 1508695763 13066 195.159.176.226 (22 Oct 2017 18:09:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Oct 2017 18:09:23 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 25.3.1 Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 22 20:09:19 2017 Return-path: Envelope-to: geh-help-gnu-emacs@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 1e6KgN-0001Tl-Md for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Oct 2017 20:09:07 +0200 Original-Received: from localhost ([::1]:33847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6KgV-0007QK-3U for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Oct 2017 14:09:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6Kg4-0007Q1-1O for help-gnu-emacs@gnu.org; Sun, 22 Oct 2017 14:08:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6Kg2-0002Q1-Cj for help-gnu-emacs@gnu.org; Sun, 22 Oct 2017 14:08:47 -0400 Original-Received: from mail-pf0-x22c.google.com ([2607:f8b0:400e:c00::22c]:55088) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e6Kg0-0002PA-DE; Sun, 22 Oct 2017 14:08:44 -0400 Original-Received: by mail-pf0-x22c.google.com with SMTP id n89so15467062pfk.11; Sun, 22 Oct 2017 11:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=wZhG7MG/5SqWuqUO7a5d7t71EeL6mgwx03kUb/FZHBA=; b=oXBsT8uoLVbOh881eqcJZxsothGo+EQvGW4mXsjT4uQIKmyGBUw/xcAJq9RBotigDG hBN0afkZAaOWJDtvgwrBUNpKHHqr9dAjqhRx037PpWK803qqdA2Q1omTGAloZzyz5wVM u73+WT4FgdMI81+7P9gmUv3rjdfrIoX4k1i17Lq+ohox0FPURhEdNnoNZnG1eUqHmHg0 rLFReLXLtyXmg04wyTqVgLi5HPCdKwnyrrEHdPU3mynLXGjK40Ig9vVbaneDL9eBpptO 2fI++e/9b9dgQOCt3Xlri+yShQKpjrTTwuHeeCTJkGQvaDdKjbF6XpYdXqwKLvR8BZAr WV0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=wZhG7MG/5SqWuqUO7a5d7t71EeL6mgwx03kUb/FZHBA=; b=pp2CT53hPCIuapJQrUBK05X4k+wop0yOjPxg3a+ztbs6z/PopjNnicrxxpe/psHm2x XjnhFglOWpErKzcd2q0mQcodCN+8ERDsM1S9s6X4QsO3LpaOatVylL3SgknqGYbMQdfN Ge6jxF5EBJRvW8FCx9rouMMGshkz7g7PZBjw9EF5Skpe3nwaQcJuxtiA/pzIJxnWOlQw frT2ofmEafWpyIGN6Blaq7RQjXYU+XecQjkDHIVbQ4MjlJz6D0Le8F3+NqR9TN6S9rdC /begedZu7HtFGneqEXoYmxOMKCTv0TuYz2fHyAPTcjR/XNR6LcLOrnQAaiTagiW+jLse IxvQ== X-Gm-Message-State: AMCzsaW8mWqU/LWXPtvkKfHWgoPu5CMZMiNWT0R/NxOtUbP9Or6d5ef9 bAbrgMgamOOF0yjbiTrvfjXNXZVB X-Google-Smtp-Source: ABhQp+SxOjudnOoGkxse8xQZ6ceWVjebNnWAte8dgvh0M2ZQ7NPrPPzF1Yr+z0qzybQ04ct0hBFhAA== X-Received: by 10.84.217.206 with SMTP id d14mr8640450plj.196.1508695723211; Sun, 22 Oct 2017 11:08:43 -0700 (PDT) Original-Received: from localhost ([2604:180:3:28::c542]) by smtp.gmail.com with ESMTPSA id z86sm10726908pfk.34.2017.10.22.11.08.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2017 11:08:42 -0700 (PDT) In-reply-to: <834lqrayti.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22c X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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:114608 Archived-At: Hi, thanks for the code. It works! However, I tried to explicited set face to '((t (:foreground "magenta" :weight bold :inherit default)) which doesn't. Why? regards, Eli Zaretskii writes: >> From: Amos Bird >> Cc: help-gnu-emacs@gnu.org >> Date: Mon, 23 Oct 2017 01:07:04 +0800 >> >> Hi, could you show the elisp code that resolves this? I don't >> quite understand how to give a distinct face. > > Here, this simple variation of your original recipe will display > the > string in the margin using the 'default' face: > > (set-window-margins (get-buffer-window) 20 0) > (setq ovstring (propertize "Hi, there!" 'face 'default)) > <<<<<<<<<<<<<<< > (overlay-put (make-overlay (point) (point)) 'before-string > (propertize "." > 'display > `((margin left-margin) ,ovstring))) > (hl-line-mode) > > The line marked with "<<<<<" is the main part of the solution. -- Amos Bird amosbird@gmail.com