[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/show-font ff995c626d 15/54: Incorporate suggestions fro
From: |
ELPA Syncer |
Subject: |
[elpa] externals/show-font ff995c626d 15/54: Incorporate suggestions from Philip Kaludercic |
Date: |
Tue, 10 Sep 2024 03:58:57 -0400 (EDT) |
branch: externals/show-font
commit ff995c626d03311a457a87150afcaabb705e86bb
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Incorporate suggestions from Philip Kaludercic
These were sent to me on emacs-devel mailing list:
<https://lists.gnu.org/archive/html/emacs-devel/2024-09/msg00146.html>.
---
show-font.el | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/show-font.el b/show-font.el
index 4ecd184764..c150f3ec0d 100644
--- a/show-font.el
+++ b/show-font.el
@@ -49,7 +49,7 @@
(const :tag "Grumpy wizards make toxic brew for the evil queen and
jack" wizards)
(const :tag "A quick movement of the enemy will jeopardize six
gunboats" gunboats)
(const :tag "Prot may find zesty owls join quiet vixens as the night
beckons" prot)
- string)
+ (string :tag "A custom pangram"))
:group 'show-font)
(defcustom show-font-character-sample
@@ -101,8 +101,7 @@ x×X .,·°;:¡!¿?`'‘’ ÄAÃÀ TODO
"Regular expression to match font file extensions.")
(defconst show-font-latin-alphabet
- '("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m"
- "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z")
+ (eval-when-compile (mapcar #'string (number-sequence ?a ?z)))
"The latin alphabet as a list of strings.")
(defun show-font-pangram-p (string &optional characters)
@@ -155,7 +154,9 @@ matched against the output of the `fc-scan' executable."
(error "Cannot find `fc-scan' executable; will not render font"))
(when-let ((f (or file buffer-file-name))
(_ (string-match-p show-font-extensions-regexp f))
- (output (shell-command-to-string (format "fc-scan -f \"%%{%s}\"
%s" attribute f))))
+ (output (shell-command-to-string (format "fc-scan -f \"%%{%s}\"
%s"
+ (shell-quote-argument
attribute)
+ (shell-quote-argument
f)))))
(if (string-match-p "," output)
(car (split-string output ","))
output)))
@@ -214,25 +215,25 @@ With optional ATTRIBUTE use it instead of \"family\"."
(push (propertize pangram 'face (list face :family family))
list-of-lines)
(push (propertize show-font-character-sample 'face (list face
:family family)) list-of-blocks))
(concat
- (propertize name 'face (list 'show-font-title :family family)) "\n"
- (propertize (make-string (length name) ?-) 'face (list
'show-font-title :family family)) "\n"
- (propertize "Rendered with parent family:" 'face (list
'show-font-regular :family family)) "\n"
- (propertize family 'face (list 'show-font-subtitle :family family))
"\n"
- (propertize (make-string (length family) ?=) 'face (list
'show-font-subtitle :family family)) "\n\n"
+ (propertize name 'face (list 'show-font-title :family family))
+ "\n"
+ (make-separator-line)
+ "\n"
+ (propertize "Rendered with parent family:" 'face (list
'show-font-regular :family family))
+ "\n"
+ (propertize family 'face (list 'show-font-subtitle :family family))
+ "\n"
+ (make-separator-line)
+ "\n"
+ ;; Why not use `make-separator-line' here?
(mapconcat #'identity (nreverse list-of-lines) "\n") "\n"
(mapconcat #'identity (nreverse list-of-blocks) "\n") "\n"))))))
-(defmacro show-font-with-unmodified-buffer (&rest body)
- "Run BODY while not making the buffer appear modified."
- `(progn
- ,@body
- (set-buffer-modified-p nil)))
-
(defun show-font--add-text (&optional buffer)
"Add the `show-font-pangram' as an overlay at `point-min'.
With optional BUFFER, operate therein. Otherwise, do it in the current
buffer."
- (show-font-with-unmodified-buffer
+ (with-silent-modifications
(with-current-buffer (or buffer (current-buffer))
(let ((inhibit-read-only t))
(save-excursion
- [elpa] externals/show-font b1bf2837f9 36/54: Rename helper function that check FILE font attributes, (continued)
- [elpa] externals/show-font b1bf2837f9 36/54: Rename helper function that check FILE font attributes, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 8ed7c66c63 44/54: Merge pull request #3 from swapnilsm/main, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font e8bb71badc 45/54: Add .elpaignore file for GNU ELPA, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 7dd09cd87e 48/54: Update the package Commentary, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 7d1cf73686 50/54: Update to show-font version 0.1.0, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 29c8fef4c6 33/54: Define functions to install a font file, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 69e2db52e5 34/54: Make show-font-install non-interactive, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 66bb076f77 47/54: Update the README.md and include links to the manual and changelog, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 6e10b12b5d 54/54: Fix a couple of typos, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 54508fc514 13/54: Fix regression in show-font--get-attribute (when output has many families), ELPA Syncer, 2024/09/10
- [elpa] externals/show-font ff995c626d 15/54: Incorporate suggestions from Philip Kaludercic,
ELPA Syncer <=
- [elpa] externals/show-font 09ad971308 21/54: Update show-font-pangram doc string, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 3be8056ae5 24/54: Stop using show-font-extensions-regexp; define regexp directly, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font b1a9d8a5cc 07/54: Remove needless 'let' before the 'when-let', ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 2d04283d8e 31/54: Add revert-buffer-function for show-font-select-preview, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 7bd66d3105 39/54: Add FIXME to refine show-font-list output, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font ad30c77b06 42/54: Remove WIP notices, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 0f46562e42 51/54: Make sure to delete duplicates and sort fonts, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font 683d5ab4d1 49/54: Mention links to the Info manual and web page in the defgroups, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font ff0251d565 19/54: Remove the function that shows the font from the major mode, ELPA Syncer, 2024/09/10
- [elpa] externals/show-font c8f889d12a 11/54: Define helper functions to get installed fonts and check for one among them, ELPA Syncer, 2024/09/10