help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why do I find ^L in elisp code?


From: Eduardo Ochs
Subject: Re: Why do I find ^L in elisp code?
Date: Sat, 22 May 2021 14:02:33 -0300

Hi Christopher,

On Sat, 22 May 2021 at 12:48, Christopher Dimech <dimech@gmx.com> wrote:
>
> Is it still useful in new code?
>
> The Form Feed is hard to type.  Most text editors do not provide easy ways to 
> type it.
> Could emacs cease using invisible glyphs as they could be are confusing and 
> hard to read
> and type?  Sometimes I see an ASCII art box.
>
> Regards
> Christopher


This is what I use to make the formfeed and a few other special characters
be displayed as colored glyphs (and stand out):

;; Screenshot:
;; http://angg.twu.net/glyphs/eev-glyphs.el.png
;; The code below was mostly taken from:
;; http://angg.twu.net/eev-current/eepitch.el.html#glyphs
;; http://angg.twu.net/eev-current/eepitch.el

(defface eev-glyph-face-bluebg
  '((t (:background "blue")))
  "Face used for the glyph for backspace (char 8; a solid blue box).")

(defface eev-glyph-face-yellow-on-red
  '((t (:foreground "yellow" :background "red")))
  "Face used for the formfeed glyph (char 12).")

(defface eev-glyph-face-blue
  '((t (:foreground "blue")))
  "Face used for the glyph for CR (char 13).")

(defface eepitch-star-face
  '((t (:foreground "red")))
  "Face used for the red star glyph (char 15).")

(defun eepitch-set-glyph0 (pos &optional char face)
  "See: (find-eepitch-intro \"glyph\")"
  (aset standard-display-table pos
(if char (vector (make-glyph-code char face)))))

(defun eepitch-set-glyph (pos &optional char face)
  "See: (find-eepitch-intro \"glyph\")
and: (find-anchors-intro \"glyphs\")
This is the high-level version of `eepitch-set-glyph0', with a hack
to make it work similarly in unibyte and multibyte buffers."
  (eepitch-set-glyph0 pos char face)
  (if (<= 128 pos)
      (eepitch-set-glyph0 (make-char 'eight-bit pos) char face)))

(if (not standard-display-table)
    (setq standard-display-table (make-display-table)))

(eepitch-set-glyph    8 32 'eev-glyph-face-bluebg)
(eepitch-set-glyph   12 ?L 'eev-glyph-face-yellow-on-red)
(eepitch-set-glyph   13 ?M 'eev-glyph-face-blue)
(eepitch-set-glyph   15 ?* 'eepitch-star-face)

;; Test: (insert "\n" 8 12 13 15)

;; Cheers,
;;    Eduardo Ochs =)
;;    http://angg.twu.net/#eev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]