unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-devel@gnu.org>
Subject: RE: cannot understand Elisp manual node Glyphs
Date: Fri, 9 Feb 2007 16:40:00 -0800	[thread overview]
Message-ID: <EIENLHALHGIMHGDOLMIMCENOCOAA.drew.adams@oracle.com> (raw)
In-Reply-To: <E1HFfUL-0001pF-4f@fencepost.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1816 bytes --]

> Specifying faces thru glyph codes is kludgy and perhaps obsolete.  I
> think it calls for a total redesign, perhaps not before Emacs 23.
>
> It was added at a time when there was no other way to specify faces
> for buffer text.  It doesn't seem very useful to me now.  So maybe we
> should delete it instead of redesigning it.
>
> What are the purposes for which people want to use it now?

To repeat why I started this thread: I modify a display-table entry for ^L,
to display text like this: "Section (Printable Page)" instead of "^L" or
"\014".

I couldn't figure out how to apply a face to that display-table entry.
Thanks to the explanations in the mailing list, in particular from Kim, I
can now do it, and I now understand the doc better. The doc is not clear in
this regard, IMO.

Can I do the same thing somehow without specifying a face through a glyph
code?

Thanks to Kim's one-line convenience function, my code is clear:

(defun ^L-display-table-entry ()
  "Returns the display-table entry for the Control-l (`^L') character.
A vector determining how a Control-l character is displayed.
Either a vector of characters or nil.  The characters are displayed in
place of the Control-l character.  nil means `^L' is displayed."
  (vconcat (mapcar (lambda (c) (make-glyph-code c '^L-highlight))
                   "          Section (Printable Page)          ")))

;; Proposed Emacs helper function from Kim
(defun make-glyph-code (char &optional face)
  "Return a glyph code representing char CHAR with face FACE."
  (if face (logior char (lsh (face-id face) 19)) char))

(aset standard-display-table ?\014 (^L-display-table-entry))

A screenshot is attached. An explanation and the full code are here:
http://www.emacswiki.org/cgi-bin/wiki/PrettyControlL,
http://www.emacswiki.org/cgi-bin/wiki/pp-c-l.el

[-- Attachment #2: drew-emacs-pretty-control-l.png --]
[-- Type: image/png, Size: 17145 bytes --]

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2007-02-10  0:40 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-05 23:11 cannot understand Elisp manual node Glyphs Drew Adams
2007-02-07 13:29 ` Kim F. Storm
2007-02-07 14:54   ` Drew Adams
2007-02-07 15:24     ` Kim F. Storm
2007-02-07 15:53       ` Drew Adams
2007-02-07 16:16         ` Stuart D. Herring
2007-02-07 16:21           ` Drew Adams
2007-02-08 16:38             ` Stuart D. Herring
2007-02-07 22:52   ` Miles Bader
2007-02-08  8:26     ` Kim F. Storm
2007-02-08  8:51       ` David Kastrup
2007-02-08 10:39         ` Kim F. Storm
2007-02-08 23:46           ` Richard Stallman
2007-02-09  7:17             ` David Kastrup
2007-02-09  9:12               ` Markus Triska
2007-02-09  9:43                 ` Nick Roberts
2007-02-09 23:48                 ` Richard Stallman
2007-02-09 14:23               ` Richard Stallman
2007-02-09 11:12             ` Kim F. Storm
2007-02-09 11:32               ` Juanma Barranquero
2007-02-09 23:48                 ` Richard Stallman
2007-02-09 14:05               ` Kim F. Storm
2007-02-09 23:49                 ` Richard Stallman
2007-02-10  0:40                   ` Drew Adams [this message]
2007-02-10 17:40                     ` Richard Stallman
2007-02-11 14:18                       ` Miles Bader
2007-02-11 21:07                       ` Kim F. Storm
2007-02-12 17:53                         ` Richard Stallman
2007-02-14 23:32                           ` Kim F. Storm
2007-02-10 10:19                   ` Eli Zaretskii
2007-02-10 17:41                     ` Richard Stallman
2007-02-10 13:59                   ` Miles Bader
2007-02-11  0:20                     ` Richard Stallman
2007-02-11  1:34                       ` Drew Adams
2007-02-11 14:16                       ` Miles Bader
2007-02-12 17:52                         ` Richard Stallman
2007-02-09 18:16               ` Stuart D. Herring
2007-02-08 16:21       ` Stefan Monnier
2007-02-08 16:36         ` Juanma Barranquero
2007-02-08  9:58     ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EIENLHALHGIMHGDOLMIMCENOCOAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).