mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 22:08:16 -05:00
gnu: emacs: Allow producing verbose messages when loading autoloads.
* gnu/packages/aux-files/emacs/guix-emacs.el: Expound commentary. (guix-emacs-verbose): New variable. (guix-emacs--load-file-no-error): New procedure. (guix-emacs-autoload-packages): Use it. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
parent
d3bf08872b
commit
05e4b3cba8
1 changed files with 13 additions and 5 deletions
|
@ -22,8 +22,9 @@
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
;; This file provides auxiliary code to autoload Emacs packages
|
;; This file provides auxiliary code to autoload Emacs packages installed with
|
||||||
;; installed with Guix.
|
;; Guix. To produce verbose messages useful while debugging, set the
|
||||||
|
;; GUIX-EMACS-VERBOSE variable to true.
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(require 'seq)
|
(require 'seq)
|
||||||
|
@ -41,6 +42,15 @@ The files in the list do not have extensions (.el, .elc)."
|
||||||
(directory-files directory 'full-name
|
(directory-files directory 'full-name
|
||||||
guix-emacs-autoloads-regexp))))
|
guix-emacs-autoloads-regexp))))
|
||||||
|
|
||||||
|
(defcustom guix-emacs-verbose nil
|
||||||
|
"Set to true to provide verbose messages, such as when loading packages."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'guix-emacs)
|
||||||
|
|
||||||
|
(defun guix-emacs--load-file-no-error (file)
|
||||||
|
"Load FILE, ignoring any errors"
|
||||||
|
(load file 'noerror (not guix-emacs-verbose)))
|
||||||
|
|
||||||
(defun guix-emacs--non-core-load-path ()
|
(defun guix-emacs--non-core-load-path ()
|
||||||
;; Filter out core Elisp directories, which are already handled by Emacs.
|
;; Filter out core Elisp directories, which are already handled by Emacs.
|
||||||
(seq-filter (lambda (dir)
|
(seq-filter (lambda (dir)
|
||||||
|
@ -63,9 +73,7 @@ The files in the list do not have extensions (.el, .elc)."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((autoloads (mapcan #'guix-emacs-find-autoloads
|
(let ((autoloads (mapcan #'guix-emacs-find-autoloads
|
||||||
(guix-emacs--non-core-load-path))))
|
(guix-emacs--non-core-load-path))))
|
||||||
(mapc (lambda (f)
|
(mapc #'guix-emacs--load-file-no-error autoloads)))
|
||||||
(load f 'noerror t))
|
|
||||||
autoloads)))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun guix-emacs-load-package-descriptors ()
|
(defun guix-emacs-load-package-descriptors ()
|
||||||
|
|
Loading…
Reference in a new issue