mbox series

[bug#67983,0/5] gnu: Nerdify Emacs.

Message ID cover.1703307288.git.jaeme@runbox.com
Headers show
Series gnu: Nerdify Emacs. | expand

Message

Jaeme Sifat Dec. 23, 2023, 4:54 a.m. UTC
Noticed that we have a emacs-nerd-icons package, but it isn't acompanied by
any corresponding nerd icons packages. This patchset rectifies that.

Jaeme Sifat (5):
  gnu: Add emacs-nerd-icons-dired.
  gnu: Add emacs-nerd-icons-corfu.
  gnu: Add emacs-nerd-icons-ivy-rich.
  gnu: Add emacs-nerd-icons-ibuffer.
  gnu: Add emacs-nerd-icons-completion.

 gnu/packages/emacs-xyz.scm | 119 +++++++++++++++++++++++++++++++++++++
 1 file changed, 119 insertions(+)


base-commit: ab1ff7ca40b0a2d935f715dcf64f0f3128632d3d
--
2.41.0

Comments

Liliana Marie Prikler Dec. 23, 2023, 8:03 a.m. UTC | #1
Am Freitag, dem 22.12.2023 um 23:54 -0500 schrieb Jaeme Sifat:
> Noticed that we have a emacs-nerd-icons package, but it isn't
> acompanied by any corresponding nerd icons packages. This patchset
> rectifies that.
On that matter, does the existing package work without downloading
extra fonts?  The nerd fonts mix free and non-free ones willy-nilly, so
they'd better be avoided.

Cheers
Jaeme Sifat Dec. 23, 2023, 8:25 a.m. UTC | #2
> does the existing package work without downloading
 > extra fonts?

The package works without the user having to install nonfree fonts. It 
only requires the NerdFontsSymbolsOnly archive, which is licensed under 
the expat license. There is an install script helper within the 
nerd-icons package that installs *only* the symbols and not any nonfree 
font, this ensures that the user would not have to go and possibly 
download a nonfree nerd font themselves for the package to work.

I hope this clears it up.

Nerd Font Symbols Source (download link)

- 
https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/NerdFontsSymbolsOnly.zip
Jaeme Sifat Jan. 20, 2024, 11:51 p.m. UTC | #3
Hi, This is just a friendly bump for my patchset to add nerd font 
packages to Emacs. There has been no activity on this thread for almost 
a month regarding the new patches.

--

Jaeme
Liliana Marie Prikler Jan. 21, 2024, 8:29 a.m. UTC | #4
Am Samstag, dem 20.01.2024 um 18:51 -0500 schrieb Jaeme Sifat:
> Hi, This is just a friendly bump for my patchset to add nerd font 
> packages to Emacs. There has been no activity on this thread for
> almost a month regarding the new patches.
I don't see how "a built-in downloader" fixes the issues I've pointed
out.  Rather, unless this downloader only picks free fonts, it might
well violate the FSDG.  I think we'd do well in substitute*-ing the
nerd fonts where needed.

Cheers
Jaeme Sifat Jan. 21, 2024, 5:25 p.m. UTC | #5
On 1/21/24 03:29, Liliana Marie Prikler wrote:

> Am Samstag, dem 20.01.2024 um 18:51 -0500 schrieb Jaeme Sifat:
>> Hi, This is just a friendly bump for my patchset to add nerd font
>> packages to Emacs. There has been no activity on this thread for
>> almost a month regarding the new patches.
> I don't see how "a built-in downloader" fixes the issues I've pointed
> out.  Rather, unless this downloader only picks free fonts, it might
> well violate the FSDG.  I think we'd do well in substitute*-ing the
> nerd fonts where needed.
>
> Cheers

On closer inspection, The built-in downloader for `nerd-icons.el' is 
this procedure.

--8<---------------cut here---------------start------------->8---

;;;###autoload
(defun nerd-icons-install-fonts (&optional pfx)
   "Helper function to download and install the latests fonts based on OS.
The provided Nerd Font is Symbols Nerd Font Mono.
When PFX is non-nil, ignore the prompt and just install"
   (interactive "P")
   (when (or pfx (yes-or-no-p "This will download and install fonts, are you sure you want to do this?"))
     (let* ((url-format "https://raw.githubusercontent.com/rainstormstudio/nerd-icons.el/main/fonts/%s")
            (font-dest (cond
                        ;; Default Linux install directories
                        ((member system-type '(gnu gnu/linux gnu/kfreebsd))
                         (concat (or (getenv "XDG_DATA_HOME")
                                     (concat (getenv "HOME") "/.local/share"))
                                 "/fonts/"
                                 nerd-icons-fonts-subdirectory))
                        ;; Default MacOS install directory
                        ((eq system-type 'darwin)
                         (concat (getenv "HOME")
                                 "/Library/Fonts/"
                                 nerd-icons-fonts-subdirectory))))
            (known-dest? (stringp font-dest))
            (font-dest (or font-dest (read-directory-name "Font installation directory: " "~/"))))

       (unless (file-directory-p font-dest) (mkdir font-dest t))

       (mapc (lambda (font)
               (url-copy-file (format url-format font) (expand-file-name font font-dest) t))
             nerd-icons-font-names)
       (when known-dest?
         (message "Fonts downloaded, updating font cache... <fc-cache -f -v> ")
         (shell-command-to-string (format "fc-cache -f -v")))
       (message "%s Successfully %s `nerd-icons' fonts to `%s'!"
                (nerd-icons-wicon "nf-weather-stars" :v-adjust 0.0)
                (if known-dest? "installed" "downloaded")
                font-dest))))

--8<---------------cut here---------------end--------------->8---

The provided font is Symbols Nerd Font Mono, which is distributed under the expat license.
However, I agree that this built in downloader has the chance of violating the FSDG sometime in the future
since it points to the main branch of the repo. It [the nerd icons repository] also redistributes the nerd icons font
without the respective license notice.

> I think we'd do well in substitute*-ing the
> nerd fonts where needed.

I agree, the much better solution would be to create a patch that removes this crude built-in downloader and instead uses Guix for
the nerd icons. So I'm going to send patches that 1. removes the built-in font downloader for `emacs-nerd-icons' and 2.
Adds the nerd icons font to Emacs (licensed under expat) and 3. Adds that icon font as a propagated input to `emacs-nerd-icons'

As a note I'm surprised that `emacs-nerd-icons' managed to be merged into master as it seems to be the main culprit.
Maybe we should remove it for the sake of consistency until this fix is made? I'm willing to send a revised patchset
that contains all the emacs nerd font packages + compliance patches with the FSDG.

I'm going to see what I can do, thank you for your patience.

---
Jaeme