unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Vaidheeswaran C <vaidheeswaran.chinnaraju@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 20721@debbugs.gnu.org
Subject: bug#20721: 25.0.50; Review default settings of Info-quoted face (Requires > texinfo-5 ???)
Date: Sat, 06 Jun 2015 07:49:08 +0530	[thread overview]
Message-ID: <5572589C.8010307@gmail.com> (raw)
In-Reply-To: <jwvd21e9js4.fsf-monnier+emacsbugs@gnu.org>

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


On Tuesday 02 June 2015 09:51 PM, Stefan Monnier wrote:

>> 2. Change the default value of Info-quoted in following ways:
>>    Screenshot: http://en.zimagez.com/zimage/info-mode-font-lock-keywordswithcourierface.php
>
> It looks OK to me, except for the fact that it seems to be using
> a courier font that is not anti-aliased (i.e. it's probably a bitmap font).
> Do you have another monospaced font with serifs on your system that you
> could recommend instead?

Emacs picks up `adobe-courier-medium' (an x font) for the courier
family.  Surprisingly, this font doesn't turn up in the GTK menu and
it confused me.

So, I cooked up the attached font-family.el to examine the various
fonts that Emacs recognizes.  Here is how you use it:

   1. M-x load-library font-family.el
   2. M-x list-font-families
   3. RET to set the frame font
   4. x   to change the displayed string

(Do you think above the file will be useful to a larger audience?)

There are couple of issues that I ran in to wrt `font-family-list':

    1. GUI dialog doesn't display 'X' fonts (that Emacs falls back upon)
    2. (font-family-list) returns "nil".
    3. (font-family-list) returns duplicate family names.
    4. (delete-dups (font-family-list)) STILL has duplicate entries.

See the attached screenshot.

>>    I want the Info buffer to be colorized, so that I have enough visual
>>    clues to skim it quickly. (2a) will ensure colorization.
>
> I find such coloring jarring, but it's probably just me.  So if you can
> find a coloring that is agreeable to other people, I can live with it.

Drew wants coloration.  IMNSHO, Choosing Blue as the effective may not
be problematic.

Here is the scorecard:

    against:1 for:2.

>> 3. Info-quoted should be lower-cased, I think
>
> Thanks.
> Indeed, not sure what I used a capital in the first place.

[-- Attachment #2: bug-20721.png --]
[-- Type: image/png, Size: 180963 bytes --]

[-- Attachment #3: font-family.el --]
[-- Type: text/x-emacs-lisp, Size: 2482 bytes --]

(require 'tabulated-list)

(defvar-local font-family-menu-test-string nil
  "Test string to display in the menu.")

(defvar font-family-menu-mode-map
  (let ((map (make-sparse-keymap))
        (menu-map (make-sparse-keymap "Font Family")))
    (set-keymap-parent map tabulated-list-mode-map)
    (define-key map "\C-m" 'font-family-menu-set-frame-font)
    (define-key map "x" 'font-family-menu-set-test-string)
    map)
  "Local keymap for `font-family-menu-mode' buffers.")

(define-derived-mode font-family-menu-mode tabulated-list-mode "Font Family Menu"
  "Inspect font families and pick a frame font.
Display the name of the font family in that family.  Use
`font-family-set-test-string' to set a test string.

 \\<font-family-menu-mode-map> \\{font-family-menu-mode-map}"
  (setq tabulated-list-format
        `[("Font Family" 30 t)
          ("Text" 30 nil)])
  (setq tabulated-list-padding 2)
  (setq tabulated-list-sort-key (cons "Font Family" nil))
  (add-hook 'tabulated-list-revert-hook 'font-family-menu--refresh nil t)
  (font-family-menu--refresh)
  (tabulated-list-init-header)
  (tabulated-list-print))

(defun list-font-families ()
  "Display the name of the font family using it's own face.
Use `font-family-menu-set-test-string' to display a test string
instead."
  (interactive)
  (let ((buf (get-buffer-create "*Font Families*")))
    (with-current-buffer buf
      (font-family-menu-mode))
    (switch-to-buffer buf)))

(defun font-family-menu--refresh ()
  "Re-populate `tabulated-list-entries'."
  (let ((f (delete-dups (font-family-list))))
    (setq tabulated-list-entries
	  (mapcar
	   (lambda (f)
	     (let ((s (or font-family-menu-test-string f)))
	       (list f (vector
			(cons f `(font-family ,f action font-family-menu-set-frame-font))
			(propertize s 'face (list :family f))))))
	   f))))

(defun font-family-menu-set-frame-font ()
  "Set the frame font to current one."
  (interactive)
  (when (derived-mode-p 'font-family-menu-mode)
      (let ((f (tabulated-list-get-id)))
	(when (and f (yes-or-no-p (concat "Set frame font to " f)))
	  (set-frame-font f nil t)))))

(defun font-family-menu-set-test-string (s)
  "Set the test string."
  (interactive "sDisplay string: ")
  (when (derived-mode-p 'font-family-menu-mode)
    (if (and (stringp s) (not (string= s "")))
	(setq font-family-menu-test-string s)
      (setq font-family-menu-test-string nil))
        (font-family-menu--refresh)
	(tabulated-list-print)))

(provide 'font-family)

  reply	other threads:[~2015-06-06  2:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02  5:51 bug#20721: 25.0.50; Review default settings of Info-quoted face (Requires > texinfo-5 ???) Vaidheeswaran C
2015-06-02 16:21 ` Stefan Monnier
2015-06-06  2:19   ` Vaidheeswaran C [this message]
2015-06-08 13:44     ` Stefan Monnier
2015-06-13  3:21       ` Vaidheeswaran C
2015-06-02 16:30 ` Drew Adams
2015-06-06  5:12   ` Vaidheeswaran C
2015-06-06  6:31   ` Vaidheeswaran C

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=5572589C.8010307@gmail.com \
    --to=vaidheeswaran.chinnaraju@gmail.com \
    --cc=20721@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).