conao3 / leaf-keywords.el

Additional leaf.el keywords for external packages
GNU General Public License v3.0
30 stars 10 forks source link

Prevent defaults from being loaded. Defaults prevent other configuration files from loading. #146

Closed alecStewart1 closed 3 years ago

alecStewart1 commented 3 years ago

Description

Defaults for certain packages are being loaded, and it's preventing some other packages from being installed.

Starting up Emacs, from scratch, with leaf and first few packages are installed, and then I get put in the *Compile-Log* buffer and many other packages later in my configuration files are not installed.

Issue leaf-block

;;; For leaf.el
;;;

(unless (bound-and-true-p package--initialized)
  (setq package-enable-at-startup nil)
  (package-initialize))

(eval-and-compile 
  (unless (package-installed-p 'leaf)
    (add-transient-hook! 'package-install (package-refresh-contents))
    (package-install 'leaf))

  (setq leaf-expand-minimally t)

  (leaf leaf-keywords
    :ensure t
    :init
    (leaf gnu-elpa-keyring-update :ensure t)
    (leaf diminish :ensure t)
    (leaf hydra
      :ensure t
      :tag "external" "hydra" "ui-ux"
      :commands (hydra-move-splitter-up
                 hydra-move-splitter-down
                 hydra-move-splitter-right
                 hydra-move-splitter-left)
      :init
      (setq lv-use-separator t))
    (leaf mode-hydra
      :ensure t
      :tag "external" "hydra" "ui-ux"
      :after hydra
      :defun (major-mode-hydra-define major-mode-hydra-define+)
      :bind ("M-SPC" . major-mode-hydra))
    (leaf pretty-hydra
      :ensure t
      :tag "external" "hydra" "ui-ux"
      :after hydra
      :defun (pretty-hydra-define pretty-hydra-define+)
      :preface
      (cl-defun pretty-hydra-title (title &optional icon-type icon-name
                                          &key face height v-adjust)
        "Add an icon in the hydra title."
        (let ((face (or face `(:foreground ,(face-background 'highlight))))
              (height (or height 1.0))
              (v-adjust (or v-adjust 0.0)))
          (concat
           (when (and (icons-displayable-p) icon-type icon-name)
             (let ((f (intern (format "all-the-icons-%s" icon-type))))
               (when (fboundp f)
                 (concat
                  (apply f (list icon-name :face face :height height :v-adjust v-adjust))
                  " "))))
           (propertize title 'face face))))
      :config
      (with-eval-after-load 'avy
        (pretty-hydra-define hydra-avy (:hint nil :color blue :quit-key "q" :title "Avy Things")
                             ("Characters/Symbols"
                              (("c" avy-goto-char-in-line "char (1)"))
                              ("C" avy:goto-char-2 "char (2)")
                              ("x" avy-goto-symbol-1 "symbol")
                              "Words"
                              (("w" avy-goto-word-0 "word"))
                              ("f" avy:goto-word-beg "word beg.")
                              ("s" avy-goto-subword-1 "subword")
                              "Lines"
                              (("n" avy-goto-line-below "line below"))
                              ("p" avy-goto-line-above "line above")
                              ("l" avy-copy-line "copy line")
                              ("m" avy-move-line "move line")
                              ("e" avy-goto-end-of-line "end of line")
                              "Misc"
                              (("C-c" avy:goto-lisp-cond "Lisp conditional"))))
        (define-key 'text-mode-map (kbd "C-c a") #'hydra-avy/body))

      (with-eval-after-load 'smartparens
        (pretty-hydra-define hydra-sp (:hint nil :quit-key "q" :title "Smartparens")
                             ("Moving"
                              (("a" sp-beginning-of-sexp)
                               ("e" sp-end-of-sexp)
                               ("f" sp-forward-sexp)
                               ("b" sp-backward-sexp)
                               ("n" sp-down-sexp)
                               ("N" sp-backward-down-sexp)
                               ("p" sp-up-sexp)
                               ("P" sp-backward-up-sexp))
                              "Slurping & Barfing"
                              (("h" sp-backward-slurp-sexp)
                               ("H" sp-backward-barf-sexp)
                               ("l" sp-forward-slurp-sexp)
                               ("L" sp-forward-barf-sexp))
                              "Wrapping"
                              (("R" sp-rewrap-sexp)
                               ("u" sp-unwrap-sexp)
                               ("U" sp-backward-unwrap-sexp)
                               ("(" sp-wrap-round)
                               ("{" sp-wrap-curly)
                               ("[" sp-wrap-square))
                              "Sexp juggling"
                              (("S" sp-split-sexp)
                               ("s" sp-splice-sexp)
                               ("r" sp-raise-sexp)
                               ("j" sp-join-sexp)
                               ("t" sp-transpose-sexp)
                               ("A" sp-absorb-sexp)
                               ("E" sp-emit-sexp)
                               ("o" sp-convolute-sexp))
                              "Destructive editing"
                              (("c" sp-change-inner :exit t)
                               ("C" sp-change-enclosing :exit t)
                               ("k" sp-kill-sexp)
                               ("K" sp-backward-kill-sexp)
                               ("w" sp-copy-sexp))))
        (define-key 'prog-mode-map (kbd "C-c (") #'hydra-sp/body)))
                                        ;(leaf general :ensure t)
    :config
    (leaf-keywords-init))) ;; <- we get to the end here and things start to bug out, it would seem

Output of *Compile-Log*

Compiling file /home/my-user/.config/emacs/.local/elpa/pretty-hydra-20210221.834/pretty-hydra.el at Sat Jul 10 20:02:06 2021
Entering directory ‘/home/my-user/.config/emacs/.local/elpa/pretty-hydra-20210221.834/’
Warning (bytecomp): function ‘leaf-keywords-defaults--leaf/company’ defined multiple times in this file
Warning (bytecomp): reference to free variable ‘company-active-map’
Warning (bytecomp): reference to free variable ‘company-search-map’
Warning (bytecomp): function ‘leaf-keywords-defaults--leaf/cus-edit’ defined multiple times in this file
Warning (bytecomp): function ‘leaf-keywords-defaults--leaf/cus-start’ defined multiple times in this file
Warning (bytecomp): function ‘leaf-keywords-defaults--leaf/delsel’ defined multiple times in this file
Warning (bytecomp): function ‘leaf-keywords-defaults--leaf/files’ defined multiple times in this file
Warning (bytecomp): function ‘leaf-keywords-defaults--leaf/flycheck’ defined multiple times in this file
Warning (bytecomp): function ‘leaf-keywords-defaults--leaf/paren’ defined multiple times in this file
Warning (bytecomp): function ‘leaf-keywords-defaults--leaf/simple’ defined multiple times in this file
Warning (bytecomp): function ‘leaf-keywords-defaults--leaf/startup’ defined multiple times in this file
Warning (bytecomp): the following functions are not known to be defined:
    global-company-mode, company-filter-candidates,
    company-select-next, company-select-previous,
    company-complete-selection, blackout, ddskk-posframe-mode,
    global-flycheck-mode, flycheck-next-error,
    flycheck-previous-error, ivy-mode, swiper, counsel-mode,
    counsel-recentf, prescient-persist-mode, ivy-prescient-mode

More Info

My Emacs config repo. The issue block is in the lisp/packing.el file.

My init.el shows that the ui-ux.el file would be the next to load, however, as seen at the top of that file, that the my-splash function is not an available interactive function to run.

conao3 commented 3 years ago

Honestly, I already :defaults and :convert-default is moved leaf-defaults. I've forgot just remove those keyword from this package. I try to remove them via #146, please re-try after MELPA build.

alecStewart1 commented 3 years ago

Ah, awesome! I will try to tomorrow then.

alecStewart1 commented 3 years ago

@conao3 Hmmm...tried just a few minutes ago and I didn't get booted into a *Compile-Log* buffer. However, still ended up stopping at installing pretty-hydra like before.

I was getting

Package refresh done
Loading advice...done
Loading grep...done
Eager macro-expansion failure: (void-function \,)
Setting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations

However I fixed that and it's still stopping at installing pretty-hydra.

How do you debug leaf expansion failures? I'm assuming that's what causing my issue. You can always look at my configuration repo, and, if you do, I recommend looking in

because I believe that's where the issue is occurring.

alecStewart1 commented 3 years ago

Ah, silly me. I forgot the *Warnings* buffer exists.

alecStewart1 commented 3 years ago

Seems like a lot of configuration errors on my part. Will close since it doesn't seem to be anything wrong with the keywords.