From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: using glyphs by default in perl-mode Date: Fri, 07 Jun 2013 11:39:21 -0400 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <8738suq6ae.fsf@lifelogs.com> References: <87bo877kf7.fsf@lifelogs.com> <87obbs7cew.fsf@lifelogs.com> <87ip1y54fx.fsf@lifelogs.com> <87ehck6670.fsf@lifelogs.com> <87a9n854tx.fsf@lifelogs.com> <8761xw54rv.fsf@lifelogs.com> <87sj0y4p7h.fsf@lifelogs.com> <87ppw13aky.fsf@lifelogs.com> <874ndc39bt.fsf@lifelogs.com> <83d2ryv0cn.fsf@gnu.org> <87wqq6qe6n.fsf@lifelogs.com> <83obbit1lx.fsf@gnu.org> Reply-To: emacs-devel@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1370619582 17468 80.91.229.3 (7 Jun 2013 15:39:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Jun 2013 15:39:42 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 07 17:39:43 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UkylR-0000sq-Hd for ged-emacs-devel@m.gmane.org; Fri, 07 Jun 2013 17:39:41 +0200 Original-Received: from localhost ([::1]:42479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkylR-0002D0-5m for ged-emacs-devel@m.gmane.org; Fri, 07 Jun 2013 11:39:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkylN-0002AP-NH for emacs-devel@gnu.org; Fri, 07 Jun 2013 11:39:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkylJ-0004Ao-87 for emacs-devel@gnu.org; Fri, 07 Jun 2013 11:39:37 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkylI-0004Ab-MS for emacs-devel@gnu.org; Fri, 07 Jun 2013 11:39:32 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UkylG-0000gi-Va for emacs-devel@gnu.org; Fri, 07 Jun 2013 17:39:30 +0200 Original-Received: from pool-72-93-26-80.bstnma.east.verizon.net ([72.93.26.80]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Jun 2013 17:39:30 +0200 Original-Received: from tzz by pool-72-93-26-80.bstnma.east.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Jun 2013 17:39:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 87 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pool-72-93-26-80.bstnma.east.verizon.net 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 User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:rQlNsehjaRrzKnY566ewwXUu76U= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160227 Archived-At: On Fri, 07 Jun 2013 17:52:10 +0300 Eli Zaretskii wrote: >> From: Ted Zlatanov >> Date: Fri, 07 Jun 2013 08:48:48 -0400 >> >> OK, but read that sentence again. Can you really make sense of it? EZ> Yes, definitely. I wonder what makes it illegible for you. (No, I EZ> didn't write that doc string.) The way it's written makes it hard to read, not illegible. You and others who know how text composition works are a terrible use case for this docstring. I'll propose a revised version. >> Currently, AFAIK Emacs treats images as a text property. EZ> More accurately, you display images by creating text properties with EZ> images as their values. Yes, exactly. >> This is convenient but there are many cases where I'd rather have >> images behave like typed characters: one image == one character == >> one glyph. EZ> Then create a font. That's what you want. Emacs cannot display text EZ> as something else except via text properties or overlays. Yes! But I don't want to create the font, I want Emacs to do it for me. >> (make-char 'image "/tmp/gnus.png") >> >> will produce something that respects font size, can be scaled, and looks >> like a character to all Emacs functions but like an image visually. In >> text mode or without image support it would be treated like a character >> that can't be rendered. EZ> This doesn't make sense to me: a character has many properties and EZ> attributes that the above doesn't provide. They will have to be faked, simulated, or ignored. EZ> Displaying an image as a character means that you will need to EZ> implement a font library, or something close. It's a feature request based on my experience with images in Emacs today. If it goes on my queue, it may never get done because I have no knowledge of the font and image internals. But obviously that's what will happen if no one else thinks it's worth implementing... so this is my proposal, to gather interest. EZ> Why can't you generate a set of strings with display properties, and EZ> then insert them into a buffer? After all, a single-character string EZ> should do what you want, no? It doesn't. It doesn't respect font size, most importantly. It needs to scale so I can insert 20 images at size 15 and have them look good. And when I change to size 25, I want the images to flow like text. I don't want to treat images in a special way in some cases. The origin of this was that I'd like to extend `prog-prettify-symbols' to support images as well. It would be so much easier to say ("eli" . ,(make-char 'image "eli.png")) and pass the character to be inserted, not a special extension to this simple format to support images. BTW, SVG would be great here too. Fundamentally, I'm talking about treating images as characters because Emacs is good at dealing with characters. Text properties are useful and I think the image support there is great, but text properties are not first-class citizens of a buffer. For instance, to come back to the first part of this post, it would be very nice to compose characters with image glyphs or SVG glyphs (gradients and vector graphics). It would make some pretty amazing visuals possible. I've done this with Java Swing, and you can see some examples at http://filthyrichclients.org/ (I highly recommend the book). HTML is a very good analogy. It has images as a text property through CSS and it has images as an element, which ends up as an actual DOM node (IIUC the terminology, I hope you'll know what I mean). They both have their place. Emacs only has the former. Ted