Package: dictionary-el
Version: 1.10-3
Severity: wishlist
Tags: patch

Dear Maintainer,

Since emacs can handle nice variable width fonts, it makes sense to
have dictionary.el use them by default. While there is support for
changing some of the font faces, such as the buttons at the top, the
package is mysteriously missing the ability to change the font of the
definition itself.

Here is a patch that defines dictionary-word-definition-face, which
defaults to "DejaVu Serif", if that font family is supported. If that
font isn't available and the display type is "X", "Sans Serif" is
used. Otherwise, the default fonts are used.

[Side note: I may have a misunderstanding of how font availabilty
checking is supposed to work in Emacs. I based my code on the
documentation in the Emacs Lisp Reference Manual ("Defining Faces").
The actual behavior of Emacs seems to differ slightly, but I'll report
that in a different bug.]

 ----8<----8<----8<----8<-------CUT HERE-------8<----8<----8<----8<----

--- /usr/share/emacs/site-lisp/dictionary-el/dictionary.el      2017-01-05 
18:32:36.000000000 -0800
+++ ~/.local/share/elisp/dictionary.el  2017-06-12 02:45:19.188853099 -0700
@@ -202,6 +202,16 @@
 (if (fboundp 'defface)
     (progn
       
+      (defface dictionary-word-definition-face
+       '((((supports '(:family "DejaVu Serif")))
+          (:family "DejaVu Serif"))
+         (((type x))
+          (:font "Sans Serif"))
+         (t
+          (:font "default")))
+       "The face that is used for displaying the definition of the word."
+       :group 'dictionary)
+      
       (defface dictionary-word-entry-face
        '((((type x))
           (:italic t))
@@ -760,6 +770,7 @@
   (let ((start (point)))
     (insert (dictionary-decode-charset reply dictionary))
     (insert "\n\n")
+    (put-text-property start (point) 'face 'dictionary-word-definition-face)
     (let ((regexp "\\({+\\)\\([^ '\"][^}]*\\)\\(}+\\)"))
       (goto-char start)
       (while (< (point) (point-max))

 ----8<----8<----8<----8<-------CUT HERE-------8<----8<----8<----8<----

-- System Information:
Debian Release: 8.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.16.0-4-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dictionary-el depends on:
ii  emacs              46.1
ii  emacs23 [emacsen]  23.4+1-4
ii  emacs24 [emacsen]  24.4+1-5
ii  emacsen-common     2.0.8

dictionary-el recommends no packages.

dictionary-el suggests no packages.

-- no debconf information

Reply via email to