r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.35k stars 160 forks source link

emacs update error - Symbol’s function definition is void: quelpa #757

Closed muralikodali closed 2 years ago

muralikodali commented 3 years ago

while upgrading emacs, topgrade gave following error and skipped the update :

Loading server...
Symbol’s function definition is void: quelpa
r-darwish commented 2 years ago

It's been a few years since I last used Emacs, so we'll need to wait for someone else to fix it.

stefanhusmann commented 2 years ago

Emacs-user here. Does the topgrade emacs-related code rely on paradox? I got this

Loading /home/haawda/.emacs.d/recentf...
Cleaning up the recentf list...
Cleaning up the recentf list...done (0 removed)
Debugger entered--Lisp error: (error "Defining as dynamic an already lexical var")
  custom-declare-variable(package-menu-async (funcall #'#f(compiled-function () #<bytecode 0x1f4000153e5d>
)) "If non-nil, package-menu will use async operations..." :type boolean :version "25.1")
  byte-code("\300\301\302\303\304DD\305\306\307\310\311\312\313&\11\210\300\314\302\303\315DD\316\312\317\
306\320&\7\210\300\321\302\303\322DD\323\306\324\310\311\312\325&\11\210\300..." [custom-declare-variable
package-unsigned-archives funcall function #f(compiled-function () #<bytecode 0x1f4000153e91>) "List of ar
chives where we do not check for package..." :type (repeat (string :tag "Archive name")) :risky t :version
 "24.4" package-selected-packages #f(compiled-function () #<bytecode 0x1f4000153e91>) "Store here packages
 installed explicitly by user.\n..." "25.1" (repeat symbol) package-native-compile #f(compiled-function ()
 #<bytecode 0x1f4000153e91>) "Non-nil means to native compile packages on instal..." (boolean) "28.1" pack
age-menu-async #f(compiled-function () #<bytecode 0x1f4000153e5d>) "If non-nil, package-menu will use asyn
c operations..." boolean package-name-column-width #f(compiled-function () #<bytecode 0x1f4000153245>) "Co
lumn width for the Package name in the package m..." number package-version-column-width #f(compiled-funct
ion () #<bytecode 0x1f4000153e75>) "Column width for the Package version in the packag..." package-status-
column-width #f(compiled-function () #<bytecode 0x1f4000153e5d>) "Column width for the Package status in t
he package..." package-archive-column-width #f(compiled-function () #<bytecode 0x1f4000153e19>)] 10)
  (package-list-packages)
  (let ((package-menu-async nil)) (package-list-packages))
  (progn (let ((package-menu-async nil)) (package-list-packages)) (package-menu-mark-upgrades) (condition-
case nil (package-menu-execute 'noquery) (user-error nil)))
  (if (fboundp 'paradox-upgrade-packages) (progn (unless (boundp 'paradox-github-token) (setq paradox-gith
ub-token t)) (paradox-upgrade-packages) (princ (if (get-buffer "*Paradox Report*") (with-current-buffer "*
Paradox Report*" (buffer-string)) "\nNothing to upgrade\n"))) (progn (let ((package-menu-async nil)) (pack
age-list-packages)) (package-menu-mark-upgrades) (condition-case nil (package-menu-execute 'noquery) (user
-error nil))))
  command-line-1(("-l" "/home/haawda/.emacs.d/init.el" "--eval" "(if (fboundp 'paradox-upgrade-packages)  
   (progn..."))
  command-line()
  normal-top-level()

but after installing paradox this went away.

stefanhusmann commented 2 years ago

Do you know straight.el?

https://github.com/raxod502/straight.el.git

I prefer this over the standard package.el, and I think it woulde be much easier to support from your side.

r-darwish commented 2 years ago

@muralikodali is this still relevant?

stefanhusmann commented 2 years ago

Yes.

r-darwish commented 2 years ago

Can you guys please share your Emacs configuration?

stefanhusmann commented 2 years ago

~/.emacs.d/init.el

(setq native-comp-eln-load-path '("/home/haawda/.emacs.d/eln-cache/"))
(defvar bootstrap-version)
(unless (fboundp 'x-select-font) 
  (defalias 'x-select-font 'pgtk-popup-font-panel "Pop up the font panel. This function has been overloaded in Nextstep."))
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))
(straight-use-package 'geiser-guile)
(straight-use-package 'chess)
(straight-use-package 'icicles)
(straight-use-package 'auctex)
(straight-use-package 'magit)
(straight-use-package 'org)
(straight-use-package 'vc-fossil)
(straight-use-package 'jabber)
(straight-use-package 'pdf-tools)
(straight-use-package 'ahg)
(straight-use-package 'tramp)
(straight-use-package 'doxygen)
(straight-use-package 'ess)
(straight-use-package 'goby)

(require 'mu4e)
(setq
       mu4e-sent-folder   "/sent"       ;; folder for sent messages
       mu4e-drafts-folder "/drafts"     ;; unfinished messages
       mu4e-trash-folder  "/trash"      ;; trashed messages
       mu4e-refile-folder "/archive")   ;; saved messages
(setq mu4e-get-mail-command "fetchmail"
      mu4e-update-interval 120)
(setq mu4e-view-use-gnus nil)
(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-smtp-server "securesmtp.t-online.de")
(global-set-key (kbd "C-c s") 'sort-lines)
(autoload 'paredit-mode "paredit"
  "Minor mode for pseudo-structurally editing Lisp code." t)
(autoload 'imaxima "imaxima" "Image support for Maxima." t)
    (autoload 'imath "imath" "Interactive Math minor mode." t)
(autoload 'imath-mode "imath" "Interactive Math minor mode." t)
(recentf-mode)
(global-set-key (kbd "C-c r") 'revert-buffer)
(global-set-key (kbd "C-c s") 'sort-lines)
(fset 'yes-or-no-p 'y-or-n-p)
;; w3m
(setq browse-url-browser-function 'w3m-browse-url)
(autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t)
 ;; optional keyboard short-cut
(global-set-key "\C-xm" 'browse-url-at-point)
;;/w3m
;; Sicherungskopien ins /tmp
(defvar user-temporary-file-directory
  (concat temporary-file-directory user-login-name "/"))
(make-directory user-temporary-file-directory t)
(setq backup-by-copying t)
(setq backup-directory-alist
      `(("." . ,user-temporary-file-directory)))
(setq auto-save-list-file-prefix
      (concat user-temporary-file-directory ".auto-saves-"))
(setq auto-save-file-name-transforms
      `((".*" ,user-temporary-file-directory t)))
;; /Sicherungskopien ins /tmp
;;pkgbuild-mode
(autoload 'pkgbuild-mode "pkgbuild-mode.el" "PKGBUILD mode." t)
(setq auto-mode-alist (append '(("/PKGBUILD$" . pkgbuild-mode))
                  auto-mode-alist))
(setq pkgbuild-user-full-name "Stefan Husmann")
(setq pkgbuild-user-mail-address "stefan-husmann@t-online.de")
;; /pkgbuild-mode
(define-skeleton latex-scrartcl-skel
  "put out a convenient LaTeX skeleton for komascript's scrartcl"
  nil
  "\\documentclass[a4paper,DIVcalc,BCOR8mm,twoside]{scrartcl}
 \\usepackage[T1]{fontenc}
 \\usepackage[utf8]{inputenc}
 \\usepackage{lmodern,german,microtype,wrapfig}
 \\usepackage[pdftex]{graphicx}
 \\widowpenalty10000\\raggedbottom
 \\begin{document}
 \\title{}\\author{}\\date{}\\maketitle
\\intextsep -4pt plus 1pt minus 1pt
\\end{document}"
)

(define-skeleton latex-brief-skel
  "put out a convenient LaTeX skeleton for g-brief-local"
  nil
  "\\documentclass[a4paper,ngerman,12pt]{g-brief-local}
\\usepackage[T1]{fontenc}
\\usepackage[utf8]{inputenc}
\\usepackage{bera}
\\fenstermarken
\\faltmarken
\\trennlinien

%\klassisch

(setq TeX-parse-self t) ; Enable parse on load.
(setq TeX-auto-save t) ; Enable parse on save.

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(TeX-output-view-style
   '(("^dvi$"
      ("^landscape$" "^pstricks$\\|^pst-\\|^psfrag$")
      "%(o?)dvips -t landscape %d -o && gv %f")
     ("^dvi$" "^pstricks$\\|^pst-\\|^psfrag$" "%(o?)dvips %d -o && gv %f")
     ("^dvi$"
      ("^\\(?:a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4\\)$" "^landscape$")
      "%(o?)xdvi %dS -paper a4r -s 0 %d")
     ("^dvi$" "^\\(?:a4\\(?:dutch\\|paper\\|wide\\)\\|sem-a4\\)$" "%(o?)xdvi %dS -paper a4 %d")
     ("^dvi$"
      ("^\\(?:a5\\(?:comb\\|paper\\)\\)$" "^landscape$")
      "%(o?)xdvi %dS -paper a5r -s 0 %d")
     ("^dvi$" "^\\(?:a5\\(?:comb\\|paper\\)\\)$" "%(o?)xdvi %dS -paper a5 %d")
     ("^dvi$" "^b5paper$" "%(o?)xdvi %dS -paper b5 %d")
     ("^dvi$" "^letterpaper$" "%(o?)xdvi %dS -paper us %d")
     ("^dvi$" "^legalpaper$" "%(o?)xdvi %dS -paper legal %d")
     ("^dvi$" "^executivepaper$" "%(o?)xdvi %dS -paper 7.25x10.5in %d")
     ("^dvi$" "." "%(o?)xdvi %dS %d")
     ("^pdf$" "." "emacs \"(find-file \\\"%o\\\")\"")
     ("^html?$" "." "lariza %o")))
 '(TeX-view-program-selection
   '(((output-dvi style-pstricks)
      "dvips and gv")
     (output-dvi "xdvi")
     (output-pdf "xpdf")
     (engine-omega "dvips and gv")
     (output-html "xdg-open")))
 '(ansi-color-faces-vector
   [default default default italic underline success warning error])
 '(ansi-color-names-vector
   ["#2d3743" "#ff4242" "#74af68" "#dbdb95" "#34cae2" "#008b8b" "#00ede1" "#e1e1e0"])
 '(arch-packer-default-command "pacaur")
 '(beacon-color "#d33682")
 '(blink-cursor-mode nil)
 '(browse-url-browser-function 'browse-url-generic)
 '(browse-url-generic-program "qutebrowser")
 '(chess-images-default-size 72)
 '(compilation-message-face 'default)
 '(ecb-options-version "2.40")
 '(fancy-splash-image "/home/haawda/Desktop/Bilder/unbekannt/chain/0022.jpg")
 '(fci-rule-color "#3C3D37")
 '(flycheck-color-mode-line-face-to-color 'mode-line-buffer-id)
 '(frame-background-mode 'light)
 '(highlight-changes-colors '("#FD5FF0" "#AE81FF"))
 '(highlight-tail-colors
   '(("#3C3D37" . 0)
     ("#679A01" . 20)
     ("#4BBEAE" . 30)
     ("#1DB4D0" . 50)
     ("#9A8F21" . 60)
     ("#A75B00" . 70)
     ("#F309DF" . 85)
     ("#3C3D37" . 100)))
 '(inhibit-startup-screen nil)
 '(jabber-account-list
   '(("stefanhusmann@jabber.archlinux.de"
      (:port . 443)
      (:connection-type . starttls))))
 '(jabber-connection-ssl-program nil)
 '(magit-diff-use-overlays nil)
 '(org-file-apps
   '((auto-mode . system)
     ("\\.mm\\'" . system)
     ("\\.x?html?\\'" . "lariza %s")
     ("\\.pdf\\'" . system)))
 '(org-html-doctype "xhtml-strict")
 '(pkgbuild-makepkg-command "makepkg -ms --noconfirm")
 '(pkgbuild-read-makepkg-command t)
 '(pkgbuild-sums-command "makepkg -g 2> /dev/null")
 '(pkgbuild-update-sums-on-save t)
 '(pos-tip-background-color "#FFFACE")
 '(pos-tip-foreground-color "#272822")
 '(quote (notmuch-always-prompt-for-sender t))
 '(safe-local-variable-values
   '((c-file-offsets
      (innamespace . 0)
      (inline-open . 0)
      (case-label . +))))
 '(send-mail-function 'smtpmail-send-it)
 '(sendmail-program "postfix")
 '(smtpmail-smtp-server "securesmtp.t-online.de")
 '(smtpmail-smtp-service 587)
 '(tabbar-background-color "medium violet red")
 '(tabbar-mode t)
 '(tabbar-mwheel-mode t)
 '(tool-bar-mode nil)
 '(vc-annotate-background nil)
 '(vc-annotate-color-map
   '((20 . "#F92672")
     (40 . "#CF4F1F")
     (60 . "#C26C0F")
     (80 . "#E6DB74")
     (100 . "#AB8C00")
     (120 . "#A18F00")
     (140 . "#989200")
     (160 . "#8E9500")
     (180 . "#A6E22E")
     (200 . "#729A1E")
     (220 . "#609C3C")
     (240 . "#4E9D5B")
     (260 . "#3C9F79")
     (280 . "#A1EFE4")
     (300 . "#299BA6")
     (320 . "#2896B5")
     (340 . "#2790C3")
     (360 . "#66D9EF")))
 '(vc-annotate-very-old-color nil)
 '(warning-suppress-types '((comp)))
 '(weechat-color-list
   '(unspecified "#272822" "#3C3D37" "#F70057" "#F92672" "#86C30D" "#A6E22E" "#BEB244" "#E6DB74" "#40CAE4" "#66D9EF" "#FB35EA" "#FD5FF0" "#74DBCD" "#A1EFE4" "#F8F8F2" "#F8F8F0"))
 '(widget-menu-minibuffer-flag t))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:family "Luxi Mono" :foundry "B&H " :slant normal :weight normal :height 113 :width normal))))
 '(bmkp-local-file-with-region ((t (:foreground "light goldenrod"))))
 '(menu ((t (:height 9 :family "Noto Sans"))))
 '(tabbar-button ((t (:family "Noto Sans"))))
 '(tabbar-default ((t (:inherit variable-pitch :background "dark gray" :foreground "light gray" :family "Noto Sans"))))
 '(tabbar-highlight ((t nil)))
 '(tabbar-selected ((t (:foreground "deep sky blue" :box nil :family "Noto Sans"))))
 '(tabbar-unselected ((t (:inherit tabbar-default :box (:line-width 1 :color "white smoke" :style released-button))))))

Emacs version

$ emacs --version
GNU Emacs 29.0.50
Copyright (C) 2022 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
muralikodali commented 2 years ago

topgrade is not working with straight.el package.

my emacs configuration is:

;; straigh.el configuaration
(defvar bootstrap-version)
(let ((bootstrap-file
      (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
        "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
        'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package 'use-package)

(setq straight-use-package-by-default t)

topgrade is contacting the servers and showing no packages to upgrade.

―― 15:22:26 - Emacs ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Loading server...
Loading recentf...
Loading /home/murali/.emacs.d/recentf...
Cleaning up the recentf list...
Cleaning up the recentf list...done (0 removed)
Loading company-flx...
Loading /home/murali/.emacs.d/elisp/messages-are-flowing.el (source)...
[yas] Prepared just-in-time loading of snippets successfully.
[yas] Prepared just-in-time loading of snippets successfully.
Clearing removed files...
Clearing removed files...done
Processing modified files...
Processing modified files...done
Importing package-keyring.gpg...
Importing package-keyring.gpg...done
Contacting host: elpa.gnu.org:443
Contacting host: elpa.gnu.org:443
Contacting host: elpa.nongnu.org:443
Package refresh done
No packages to upgrade
stefanhusmann commented 2 years ago

The problem is that paradox seems to be mandatory whereas the wiki says it is optional. And it should be optional.

r-darwish commented 2 years ago

https://github.com/r-darwish/topgrade/blob/547df8d346e8a7689213299f6fbb1d5807988b44/src/steps/emacs.el#L1-L16

Paradox is invoked if it's present. I suppose that paradox is installed in your system but shouldn't be used because you use straight. Do you have any suggestion for how this file should be changed to support straight.el? It's been a few years since I last used Emacs so I don't really remember.

stefanhusmann commented 2 years ago

The point is that I get a an error message if paradox is not installed, and the update fails. If I install paradox, the error vanishes. This means for me that paradox is always invoked (well topgrade tries do invoke it), even if it is not installed.

Supporting straight.el is not really necessary: The git step could do the pull, if you put

# Additional git repositories to pull
repos = [
    "~/.emacs.d/straight/repos/*/",
]

into your topgrade config file, and emacs will itself do the (byte- or native) compilation next time it starts.

muralikodali commented 2 years ago

thanks for your suggestion @stefanhusmann it is an easy way to pull git repos

r-darwish commented 2 years ago

@stefanhusmann not sure why paradox is invoked. Does (fboundp 'paradox-upgrade-packages)) evaluate to t in your configuration even though Paradox isn't installed?

stefanhusmann commented 2 years ago

No, it evaluates to nil.

stefanhusmann commented 2 years ago

I think I found my problem. If I evaluate the statement in emacs.el in emacs without running topgrade, It installs one package (and it's dependencies) depending on where the point (curser) stands in the Packages buffer created by package.el. Normally this is the first package in that buffer, which is quite random. This makes me believe that in fact the above error message does not come from the first part of the if statement in emacs.el but from the second one. So not paradox is the culprit, but package.el.

And indeed this behaviour is exactly what package-menu-execute does.

package-menu-execute is an interactive native compiled Lisp function
in ‘package.el’.

(package-menu-execute &optional NOQUERY)

Perform marked Package Menu actions.
Packages marked for installation are downloaded and installed,
packages marked for deletion are removed, and packages marked for
upgrading are downloaded and upgraded.

If no packages are marked, the action taken depends on the state
of the package under point.  If it’s not already installed, this
command will install the package, and if it’s installed, it will
delete the package.

Optional argument NOQUERY non-nil means do not ask the user to confirm.

The function was changed in emacs 28. in 27.2, the description is different.

package-menu-execute is an interactive compiled Lisp function in
‘package.el’.

(package-menu-execute &optional NOQUERY)

Perform marked Package Menu actions.
Packages marked for installation are downloaded and installed;
packages marked for deletion are removed.
Optional argument NOQUERY non-nil means do not ask the user to confirm.

and the error vanishes.

r-darwish commented 2 years ago

Good catch @stefanhusmann. I'll remove the packages.el part

stefanhusmann commented 2 years ago

Maybe this is the best solution until emacs 29 is out. Some days ago package.el got a new function package-update-all (in git master). If this gets commonly installed among emacs-users, it would most probably do exactly the right thing for topgrade.