Getting "Lisp error: (void-variable function)" if I use :custom
stanza in use-package gptel
#173
Unanswered
ParetoOptimalDev
asked this question in
Q&A
Replies: 2 comments 4 replies
-
Ah, I've set the customize type for gptel-default-mode to 'symbol, it
should be 'function. Or both should be valid. I'll fix it. Try changing it
from #'org-mode to 'org-mode
…On Fri, Jan 5, 2024, 8:56 AM ParetoOptimalDev ***@***.***> wrote:
It's possible this is related to some autoloads changes in NixOS and not
related to gptel as I recently updated emacs.
But posting here because it only seems to be happening with the gptel
package using:
(use-package gptel
:custom
(gptel-default-mode . #'org-mode))
system info:
NixOS unstable
GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38,
cairo version 1.18.0)
traceback:
Debugger entered--Lisp error: (void-variable function)
eval(function)
custom-initialize-reset(gptel-default-mode (funcall #'#f(compiled-function () #<bytecode 0x102d828c94ec7585>)))
custom-declare-variable(gptel-default-mode (funcall #'#f(compiled-function () #<bytecode 0x102d828c94ec7585>)) "The default major mode for dedicated chat buffers.\n\nIf `markdown-mode' is available, it is used. Otherwise gptel\ndefaults to `text-mode'." :group gptel :type symbol)
byte-code("\300\301\302\303\304DD\305\306\307\310\311&\7\210\300\312\302\303\313DD\314\306\307\310\315&\7\210\300\316\302\303\317DD\320\306\307\310\321&\7\210\300\322\302\303\323DD\324\310\325\306\307&\7\210\300\326\302\303\327DD\330\306\307\310\331&\7\210\332\333\334\"\210\332\335\336\"\210\300\337\302\303\340DD\341\306\307\342\335\310\343&\11\207" [custom-declare-variable gptel-default-mode funcall function #f(compiled-function () #<bytecode 0x102d828c94ec7585>) "The default major mode for dedicated chat buffers.\n\nIf `markdown-mode' is available, it is used. Otherwise gptel\ndefaults to `text-mode'." :group gptel :type symbol gptel-prompt-prefix-alist #f(compiled-function () #<bytecode 0x19800016fe914>) "String used as a prefix to the query being sent to the LLM.\n\nThis is meant for the user to distinguish between queries and\nresponses, and is removed from the query before it is sent.\n\nThis is an alist mapping major modes to the prefix strings. This\nis only inserted in dedicated gptel buffers." (alist :key-type symbol :value-type string) gptel-response-prefix-alist #f(compiled-function () #<bytecode 0x19800016fe914>) "String inserted before the response from the LLM.\n\nThis is meant for the user to distinguish between queries and\nresponses.\n\nThis is an alist mapping major modes to the reply prefix strings. This\nis only inserted in dedicated gptel buffers before the AI's response." (alist :key-type symbol :value-type string) gptel-use-header-line #f(compiled-function () #<bytecode 0x19800016fe5d4>) "Whether `gptel-mode' should use header-line for status\ninformation.\n\nWhen set to nil, use the mode line for (minimal) status\ninformation and the echo area for messages." boolean gptel-crowdsourced-prompts-file #f(compiled-function () #<bytecode 0xc127647dd850e5d>) "File used to store crowdsourced system prompts.\n\nThese are prompts cached from an online source (see\n`gptel--crowdsourced-prompts-url'), and can be set from the\ntransient menu interface provided by `gptel-menu'." file defalias gptel--button-buttonize button-buttonize gptel--always always gptel-directives #f(compiled-function () #<bytecode 0x19800016fe914>) "System prompts (directives) for ChatGPT.\n\nThese are system instructions sent at the beginning of each\nrequest to ChatGPT.\n\nEach entry in this alist maps a symbol naming the directive to\nthe string that is sent. To set the directive for a chat session\ninteractively call `gptel-send' with a prefix argument." :safe (alist :key-type symbol :value-type string)] 10)
require(gptel nil t)
(not (require 'gptel nil t))
(if (not (require 'gptel nil t)) (display-warning 'use-package (format "Cannot load %s" 'gptel) :error))
(progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil (list)) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(gptel-default-mode function nil nil "Customized with use-package gptel"))) (if (not (require 'gptel nil t)) (display-warning 'use-package (format "Cannot load %s" 'gptel) :error)))
(condition-case err (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil (list)) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(gptel-default-mode function nil nil "Customized with use-package gptel"))) (if (not (require 'gptel nil t)) (display-warning 'use-package (format "Cannot load %s" 'gptel) :error))) ((debug error) (funcall use-package--warning422 :catch err)))
(progn (defvar use-package--warning422 #'(lambda (keyword err) (let ((msg (format "%s/%s: %s" ... keyword ...))) (display-warning 'use-package msg :error)))) (condition-case err (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil (list)) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(gptel-default-mode function nil nil "Customized with use-package gptel"))) (if (not (require 'gptel nil t)) (display-warning 'use-package (format "Cannot load %s" 'gptel) :error))) ((debug error) (funcall use-package--warning422 :catch err))))
eval((progn (defvar use-package--warning422 #'(lambda (keyword err) (let ((msg ...)) (display-warning 'use-package msg :error)))) (condition-case err (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil (list)) (enable-theme 'use-package) (setq custom-enabled-themes (remq ... custom-enabled-themes))) (custom-theme-set-variables 'use-package '(gptel-default-mode function nil nil "Customized with use-package gptel"))) (if (not (require 'gptel nil t)) (display-warning 'use-package (format "Cannot load %s" 'gptel) :error))) ((debug error) (funcall use-package--warning422 :catch err)))) nil)
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
command-execute(eval-last-sexp)
—
Reply to this email directly, view it on GitHub
<#173>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBVOLFLDWVRBJLRGW5H72LYNAWD7AVCNFSM6AAAAABBOWFY72VHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGAZTEOBYHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Looks like the :custom directive in use-package automatically quotes
things, so it should be just org-mode then.
…On Fri, Jan 5, 2024, 9:04 AM ParetoOptimalDev ***@***.***> wrote:
Oh.. that's right I forgot the difference between the two.
However... I'm still getting an error after making that change and
starting a new emacs. Here is a traceback:
Debugger entered--Lisp error: (void-variable quote)
eval(quote)
custom-initialize-reset(gptel-default-mode (funcall #'#f(compiled-function () #<bytecode 0x102da82e06f8a985>)))
custom-declare-variable(gptel-default-mode (funcall #'#f(compiled-function () #<bytecode 0x102da82e06f8a985>)) "The default major mode for dedicated chat buffers.\n\nIf `markdown-mode' is available, it is used. Otherwise gptel\ndefaults to `text-mode'." :group gptel :type symbol)
byte-code("\300\301\302\303\304DD\305\306\307\310\311&\7\210\300\312\302\303\313DD\314\306\307\310\315&\7\210\300\316\302\303\317DD\320\306\307\310\321&\7\210\300\322\302\303\323DD\324\310\325\306\307&\7\210\300\326\302\303\327DD\330\306\307\310\331&\7\210\332\333\334\"\210\332\335\336\"\210\300\337\302\303\340DD\341\306\307\342\335\310\343&\11\207" [custom-declare-variable gptel-default-mode funcall function #f(compiled-function () #<bytecode 0x102da82e06f8a985>) "The default major mode for dedicated chat buffers.\n\nIf `markdown-mode' is available, it is used. Otherwise gptel\ndefaults to `text-mode'." :group gptel :type symbol gptel-prompt-prefix-alist #f(compiled-function () #<bytecode 0x19800016fe914>) "String used as a prefix to the query being sent to the LLM.\n\nThis is meant for the user to distinguish between queries and\nresponses, and is removed from the query before it is sent.\n\nThis is an alist mapping major modes to the prefix strings. This\nis only inserted in dedicated gptel buffers." (alist :key-type symbol :value-type string) gptel-response-prefix-alist #f(compiled-function () #<bytecode 0x19800016fe914>) "String inserted before the response from the LLM.\n\nThis is meant for the user to distinguish between queries and\nresponses.\n\nThis is an alist mapping major modes to the reply prefix strings. This\nis only inserted in dedicated gptel buffers before the AI's response." (alist :key-type symbol :value-type string) gptel-use-header-line #f(compiled-function () #<bytecode 0x19800016fe5d4>) "Whether `gptel-mode' should use header-line for status\ninformation.\n\nWhen set to nil, use the mode line for (minimal) status\ninformation and the echo area for messages." boolean gptel-crowdsourced-prompts-file #f(compiled-function () #<bytecode -0x104cec90227af1a3>) "File used to store crowdsourced system prompts.\n\nThese are prompts cached from an online source (see\n`gptel--crowdsourced-prompts-url'), and can be set from the\ntransient menu interface provided by `gptel-menu'." file defalias gptel--button-buttonize button-buttonize gptel--always always gptel-directives #f(compiled-function () #<bytecode 0x19800016fe914>) "System prompts (directives) for ChatGPT.\n\nThese are system instructions sent at the beginning of each\nrequest to ChatGPT.\n\nEach entry in this alist maps a symbol naming the directive to\nthe string that is sent. To set the directive for a chat session\ninteractively call `gptel-send' with a prefix argument." :safe (alist :key-type symbol :value-type string)] 10)
require(gptel nil t)
(not (require 'gptel nil t))
(if (not (require 'gptel nil t)) (display-warning 'use-package (format "Cannot load %s" 'gptel) :error))
(progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil (list)) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(gptel-default-mode quote nil nil "Customized with use-package gptel"))) (if (not (require 'gptel nil t)) (display-warning 'use-package (format "Cannot load %s" 'gptel) :error)))
(condition-case err (progn (let ((custom--inhibit-theme-enable nil)) (if (memq 'use-package custom-known-themes) nil (custom-declare-theme 'use-package 'use-package-theme nil (list)) (enable-theme 'use-package) (setq custom-enabled-themes (remq 'use-package custom-enabled-themes))) (custom-theme-set-variables 'use-package '(gptel-default-mode quote nil nil "Customized with use-package gptel"))) (if (not (require 'gptel nil t)) (display-warning 'use-package (format "Cannot load %s" 'gptel) :error))) ((debug error) (funcall use-package--warning69 :catch err)))
load-with-code-conversion("/home/pod/.config/emacs/system.el" "/home/pod/.config/emacs/system.el" nil nil)
load-file("/home/pod/.config/emacs/system.el")
org-babel-load-file("/home/pod/.config/emacs/system.org")
load-with-code-conversion("/home/pod/.config/emacs/init.el" "/home/pod/.config/emacs/init.el" t t)
load("/home/pod/.config/emacs/init" noerror nomessage)
startup--load-user-init-file(#f(compiled-function () #<bytecode 0x1a6d2bf8ffe78b3a>) #f(compiled-function () #<bytecode 0x4d131ce0e73b44b>) t)
command-line()
normal-top-level()
—
Reply to this email directly, view it on GitHub
<#173 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBVOLGEIUZR3QTRREZI25TYNAXB5AVCNFSM6AAAAABBOWFY72VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DAMRVGIYDC>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's possible this is related to some autoloads changes in NixOS and not related to gptel as I recently updated emacs.
But posting here because it only seems to be happening with the gptel package using:
system info:
NixOS unstable
GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0)
traceback:
Beta Was this translation helpful? Give feedback.
All reactions