-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Support]: Upgrading built-in Eldoc #236
Comments
A good way to check out what's happening is to expand the macro via (progn
(eval-and-compile (unload-feature 'eldoc t))
(elpaca eldoc
(eldoc-add-command "embark-dwim")
(eldoc-add-command-completions "avy-goto-") (require 'eldoc nil nil))) You can see that use-package's
use-package's (use-package eldoc
:preface (unload-feature 'eldoc t)
:config
(eldoc-add-command "embark-dwim")
(eldoc-add-command-completions "avy-goto-"))
;; Expands to:
(progn
(eval-and-compile (unload-feature 'eldoc t))
(elpaca eldoc
(require 'eldoc nil nil) (eldoc-add-command "embark-dwim")
(eldoc-add-command-completions "avy-goto-") t)) This error:
is a little trickier. It looks like you have (use-package eglot ...)
(use-package corfu ...) Another solution would be to add (use-package corfu
:after (upgraded-eldoc)
:config (eldoc-add-command ...))
(use-package or-like-this
:config
(with-eval-after-load 'upgraded-eldoc
(eldoc-add-command ...)))
(use-package eldoc
:preface (unload-feature 'eldoc t)
:config
(provide 'upgraded-eldoc)) I believe that should work, but I haven't tested it. Does that help? |
Thanks for the reply. Yes, I used If I strip my init config right back to just having Elpaca and Eldoc installed using the following configuration: (use-package eldoc
:preface (unload-feature 'eldoc t)
:config
(eldoc-add-command "embark-dwim")
(eldoc-add-command-completions "avy-goto-")) I get the following error:
If I use the (when (featurep 'eldoc)
(unload-feature 'eldoc t))
(elpaca eldoc)
(elpaca-wait)
;; I have also tried using the build steps approach recommended
;; for seq and it produces the same error:
;; (defun my/elpaca-unload-eldoc (e)
;; (and (featurep 'eldoc) (unload-feature 'eldoc t))
;; (elpaca--continue-build e))
;;
;; (defun my/elpaca-eldoc-build-steps ()
;; (append (butlast (if (file-exists-p (expand-file-name "eldoc" elpaca-builds-directory))
;; elpaca--pre-built-steps elpaca-build-steps))
;; (list #'my/elpaca-unload-eldoc #'elpaca--activate-package)))
;;
;; (elpaca `(eldoc :build ,(my/elpaca-eldoc-build-steps))) Then I get a warning about the missing
I have had many If I evaluate the value of I think the Corfu error has the same cause (i.e. |
The ;;; eldoc-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*-
;; Generated by the `loaddefs-generate' function.
;; This file is part of GNU Emacs.
;;; Code:
;;; Generated autoloads from eldoc.el
(defvar eldoc-minor-mode-string (purecopy " ElDoc") "\
String to display in mode line when ElDoc Mode is enabled; nil for none.")
(custom-autoload 'eldoc-minor-mode-string "eldoc" t)
(autoload 'eldoc-mode "eldoc" "\
Toggle echo area display of Lisp objects at point (ElDoc mode).
ElDoc mode is a buffer-local minor mode. When enabled, the echo
area displays information about a function or variable in the
text where point is. If point is on a documented variable, it
displays the first line of that variable's doc string. Otherwise
it displays the argument list of the function called in the
expression point is on.
This is a minor mode. If called interactively, toggle the `Eldoc
mode' mode. If the prefix argument is positive, enable the mode,
and if it is zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is `toggle'. Enable
the mode if ARG is nil, omitted, or is a positive number.
Disable the mode if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate `eldoc-mode'.
The mode's hook is called both when the mode is enabled and when
it is disabled.
(fn &optional ARG)" t)
(put 'global-eldoc-mode 'globalized-minor-mode t)
(defcustom global-eldoc-mode t "\
Non-nil if Global Eldoc mode is enabled.
See the `global-eldoc-mode' command
for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
or call the function `global-eldoc-mode'." :set #'custom-set-minor-mode :initialize 'custom-initialize-delay :type 'boolean)
(custom-autoload 'global-eldoc-mode "eldoc" nil)
(autoload 'global-eldoc-mode "eldoc" "\
Toggle Eldoc mode in all buffers.
With prefix ARG, enable Global Eldoc mode if ARG is positive;
otherwise, disable it.
If called from Lisp, toggle the mode if ARG is `toggle'.
Enable the mode if ARG is nil, omitted, or is a positive number.
Disable the mode if ARG is a negative number.
Eldoc mode is enabled in all buffers where `turn-on-eldoc-mode' would
do it.
See `eldoc-mode' for more information on Eldoc mode.
(fn &optional ARG)" t)
(autoload 'turn-on-eldoc-mode "eldoc" "\
Turn on `eldoc-mode' if the buffer has ElDoc support enabled.
See `eldoc-documentation-strategy' for more detail.")
(register-definition-prefixes "eldoc" '("eldoc"))
;;; End of scraped data
(provide 'eldoc-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; no-native-compile: t
;; coding: utf-8-emacs-unix
;; End:
;;; eldoc-autoloads.el ends here |
Thanks for all the info. |
Digging into this more. custom-set-minor-mode(global-eldoc-mode t)
custom-initialize-reset(global-eldoc-mode (funcall #'#f(compiled-function () #<bytecode 0x19800016fe5d4>)))
custom-initialize-delay(global-eldoc-mode (funcall #'#f(compiled-function () #<bytecode 0x19800016fe5d4>))) I get a similar error when manually evaluating the autoloads. (elpaca-test
:interactive t
:early-init
(setq elpaca-menu-functions '(elpaca-menu-gnu-devel-elpa))
:init
(unload-feature 'eldoc t) ;; Unload built-in eldoc
;; Workaround custom.el initialization for global-eldoc-mode.
;; Not sure about setting this globally.
;; Might want to move it into a custom build step which
;; replaces `elpaca--activate-package` for eldoc.
(setq custom-delayed-init-variables '())
(defvar global-eldoc-mode nil)
(defun +test-command () (interactive) (message "PASS"))
(elpaca eldoc
(require 'eldoc)
(global-eldoc-mode) ;; This is usually enabled by default by Emacs
(eldoc-add-command "+test-command"))) or with use-package support enabled: (elpaca-test
:interactive t
:early-init
(setq elpaca-menu-functions '(elpaca-menu-extensions elpaca-menu-gnu-devel-elpa))
:init
(elpaca elpaca-use-package
(elpaca-use-package-mode)
(setq elpaca-use-package-by-default t))
(elpaca-wait)
(use-package eldoc
:preface
(unload-feature 'eldoc t)
(setq custom-delayed-init-variables '())
(defvar global-eldoc-mode nil)
:config
(global-eldoc-mode))) I'll keep investigating. |
I appreciate you looking into this. I think Elpaca will really benefit from presenting a cohesive interface for managing/upgrading both built-in and third-party packages. The workaround works great for now and allows me to re-enable version checking for Eglot (as the latest Eldoc is now being pulled) 👍🏽 |
Had the same issue when I needed to update eldoc to use the latest eglot. I always got the warning
For some reason the use-package version of the workaround doesn't fully work for me, I still get the same above warning. But the pure init.el;; init.el --- Initialization file -*- lexical-binding: t; no-byte-compile: t; -*-
(defvar elpaca-installer-version 0.7)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
:ref nil :depth 1
:files (:defaults "elpaca-test.el" (:exclude "extensions"))
:build (:not elpaca--activate-package)))
(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
(build (expand-file-name "elpaca/" elpaca-builds-directory))
(order (cdr elpaca-order))
(default-directory repo))
(add-to-list 'load-path (if (file-exists-p build) build repo))
(unless (file-exists-p repo)
(make-directory repo t)
(when (< emacs-major-version 28) (require 'subr-x))
(condition-case-unless-debug err
(if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
((zerop (apply #'call-process `("git" nil ,buffer t "clone"
,@(when-let ((depth (plist-get order :depth)))
(list (format "--depth=%d" depth) "--no-single-branch"))
,(plist-get order :repo) ,repo))))
((zerop (call-process "git" nil buffer t "checkout"
(or (plist-get order :ref) "--"))))
(emacs (concat invocation-directory invocation-name))
((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
"--eval" "(byte-recompile-directory \".\" 0 'force)")))
((require 'elpaca))
((elpaca-generate-autoloads "elpaca" repo)))
(progn (message "%s" (buffer-string)) (kill-buffer buffer))
(error "%s" (with-current-buffer buffer (buffer-string))))
((error) (warn "%s" err) (delete-directory repo 'recursive))))
(unless (require 'elpaca-autoloads nil t)
(require 'elpaca)
(elpaca-generate-autoloads "elpaca" repo)
(load "./elpaca-autoloads")))
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))
;; Install elpaca use-package support
(elpaca elpaca-use-package
;; Enable elpaca use-package integration
(elpaca-use-package-mode)
;; Assume :ensure t unless otherwise specified.
(setopt elpaca-use-package-by-default t))
;; wait to get elpaca use-package integration
(elpaca-wait)
(use-package eldoc
:preface
;; avoid loading of built-in eldoc, see https://github.com/progfolio/elpaca/issues/236#issuecomment-1879838229
(unload-feature 'eldoc t)
(setq custom-delayed-init-variables '())
(defvar global-eldoc-mode nil)
:demand t
:config
(global-eldoc-mode))
(elpaca-wait) early-init.el(setq package-enable-at-startup nil)
(setq elpaca-menu-functions '(elpaca-menu-extensions elpaca-menu-gnu-devel-elpa)) |
Same for me, the |
Just checking in, use-package workaround doesn't work for me either |
Please refrain from "+1" type comments. They send an email to everyone subscribed to the issue. A thumbs up on the comment works just as well without doing so. |
Confirmation
Elpaca Version
Elpaca 3fd9def HEAD -> master, origin/master, origin/HEAD
installer: 0.6
emacs-version: GNU Emacs 29.1 (build 2, aarch64-apple-darwin23.2.0, NS appkit-2487.30 Version 14.2.1 (Build 23C71))
of 2024-01-03
git --version: git version 2.43.0
Operating System
macOS Sonoma 14.2.1 (23C71)
Description
Hi,
I'm having difficulty upgrading the built-in Eldoc on Emacs 29.1. I'm using a later version of Eglot from GNU-Devel ELPA that requires Eldoc 1.14.0 (I have version 1.13.0 built-in).
I am unloading Eldoc as described in #192 - i.e.:
However, the Eldoc functions aren't loaded and I get errors when my init file subsequently calls functions like
eldoc-add-command
:Following the more complicated build steps approach from #216 produced similar errors.
Appreciate the assistance.
The text was updated successfully, but these errors were encountered: