0

I have this

  (defvar bootstrap-version)
  (setq straight-repository-branch "develop") ; Need this for new org-contrib location
  (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)

;By default, use-package uses package.el to install packages. To use straight.el instead of package.el:
  (use-package evil-commentary
    :straight t)


; Make sure this is nil, so we do not use package.el
  (setq use-package-always-ensure nil
  ; FIXME: use a debug var for all of config?
    use-package-verbose 'debug  
    )


..and get this

Debugger entered--Lisp error: (error "use-package: Unrecognized keyword: :straight")
  error("use-package: %s" "Unrecognized keyword: :straight")
  use-package-normalize-plist(evil-commentary (:straight t) nil use-package-merge-keys)
  use-package-normalize-keywords(evil-commentary (:straight t))
  #f(compiled-function (name &rest args) "Declare an Emacs package by specifying a group of configuration options.\n\nFor the full documentation, see Info node `(use-package) top'.\nUsage:\n\n  (use-package package-name\n     [:keyword [option]]...)\n\n:init            Code to run before PACKAGE-NAME has been loaded.\n:config          Code to run after PACKAGE-NAME has been loaded.  Note that\n                 if loading is deferred for any reason, this code does not\n                 execute until the lazy load has occurred.\n:preface         Code to be run before everything except `:disabled'; this\n                 can be used to define functions for use in `:if', or that\n                 should be seen by the byte-compiler.\n\n:mode            Form to be added to `auto-mode-alist'.\n:magic           Form to be added to `magic-mode-alist'.\n:magic-fallback  Form to be added to `magic-fallback-mode-alist'.\n:interpreter     Form to be added to `interpreter-mode-alist'.\n\n:commands        Define autoloads for commands that will be defined by the\n                 package.  This is useful if the package is being lazily\n                 loaded, and you wish to conditionally call functions in your\n                 `:init' block that are defined in the package.\n:autoload        Similar to :commands, but it for no-interactive one.\n:hook            Specify hook(s) to attach this package to.\n\n:bind            Bind keys, and define autoloads for the bound commands.\n:bind*           Bind keys, and define autoloads for the bound commands,\n                 *overriding all minor mode bindings*.\n:bind-keymap     Bind a key prefix to an auto-loaded keymap defined in the\n                 package.  This is like `:bind', but for keymaps.\n:bind-keymap*    Like `:bind-keymap', but overrides all minor mode bindings\n\n:defer           Defer loading of a package -- this is implied when using\n                 `:commands', `:bind', `:bind*', `:mode', `:magic', `:hook',\n                 `:magic-fallback', or `:interpreter'.  This can be an integer,\n                 to force loading after N seconds of idle time, if the package\n                 has not already been loaded.\n:demand          Prevent the automatic deferred loading introduced by constructs\n                 such as `:bind' (see `:defer' for the complete list).\n\n:after           Delay the effect of the use-package declaration\n                 until after the named libraries have loaded.\n                 Before they have been loaded, no other keyword\n                 has any effect at all, and once they have been\n                 loaded it is as if `:after' was not specified.\n\n:if EXPR         Initialize and load only if EXPR evaluates to a non-nil value.\n:disabled        The package is ignored completely if this keyword is present.\n:defines         Declare certain variables to silence the byte-compiler.\n:functions       Declare certain functions to silence the byte-compiler.\n:load-path       Add to the `load-path' before attempting to load the package.\n:diminish        Support for diminish.el (if installed).\n:delight         Support for delight.el (if installed).\n:custom          Call `Custom-set' or `set-default' with each variable\n                 definition without modifying the Emacs `custom-file'.\n                 (compare with `custom-set-variables').\n:custom-face     Call `custom-set-faces' with each face definition.\n:ensure          Loads the package using package.el if necessary.\n:pin             Pin the package to an archive." #<bytecode -0x1d24114e05fd6909>)(evil-commentary :straight t)
  macroexpand((use-package evil-commentary :straight t) nil)
  macroexp-macroexpand((use-package evil-commentary :straight t) nil)
  macroexp--expand-all((use-package evil-commentary :straight t))
  macroexp--all-forms((if d/on-droid nil (defvar bootstrap-version) (setq straight-repository-branch "develop") (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/straigh..." 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'use-package) (use-package evil-commentary :straight t) (setq use-package-always-ensure nil use-package-verbose 'debug)) 1)
  macroexp--expand-all((if d/on-droid nil (defvar bootstrap-version) (setq straight-repository-branch "develop") (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/straigh..." 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'use-package) (use-package evil-commentary :straight t) (setq use-package-always-ensure nil use-package-verbose 'debug)))
  macroexpand--all-toplevel((if d/on-droid nil (defvar bootstrap-version) (setq straight-repository-branch "develop") (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/straigh..." 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'use-package) (use-package evil-commentary :straight t) (setq use-package-always-ensure nil use-package-verbose 'debug)))
  internal-macroexpand-for-load((if d/on-droid nil (defvar bootstrap-version) (setq straight-repository-branch "develop") (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/straigh..." 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'use-package) (use-package evil-commentary :straight t) (setq use-package-always-ensure nil use-package-verbose 'debug)) t)
  load-with-code-conversion("/home/b0ef/.emacs.d/init.el" "/home/b0ef/.emacs.d/init.el" t t)
  load("/home/b0ef/.emacs.d/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode -0x546ac11e495cb80>) #f(compiled-function () #<bytecode -0x1f3c61addc0b8a75>) t)
  command-line()
  normal-top-level()

5
  • Do you want to evaluate this on android only? Perhaps you mean when instead of unless?
    – NickD
    Commented Mar 26 at 15:21
  • No, when not on Android, cause Android does not support Straight. Commented Mar 26 at 15:28
  • And on what kind of system do you get the backtrace? Maybe that system does not support straight eiher?
    – NickD
    Commented Mar 26 at 15:31
  • 1
    Needless to say, all of these details should be part of the question.
    – NickD
    Commented Mar 26 at 15:32
  • Is the question detailed enough, now?;) I feel this question is very basic, but it seems very involved, with so much text. Maybe some shorter test example code would help. Commented Apr 2 at 12:43

1 Answer 1

2

"use-package: Unrecognized keyword: :straight"

(The problem has nothing to do with platform (x86, droid etc))

Turn on straight-use-package-mode .

IOW, use this instead of

(straight-use-package-mode 1)
(use-package evil-commentary
    :straight t)

instead of


(use-package evil-commentary
    :straight t)

In so far as Emacs is concerned, the key to a possible solution is most likely found by consulting the docs and docstrings .

From use-package: Usage with other package managers

By overriding use-package-ensure-function and/or use-package-pre-ensure-function, other package managers can override :ensure to use them instead of package.el. At the present time, the only package manager that does this is straight.el.


straight-use-package-mode is an interactive compiled-function in ../../repos/straight.el/straight.el.


(straight-use-package-mode &optional ARG)

Minor mode to enable use-package support in straight.el.

The behavior is controlled by variables straight-use-package-version and straight-use-package-by-default. If these variables are changed, you must toggle the mode function to update the integration.

This mode is enabled or disabled automatically when straight.el is loaded, according to the value of straight-enable-use-package-integration.

This is a global minor mode. If called interactively, toggle the Straight-Use-Package 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 (default-value straight-use-package-mode)`.

The mode`s hook is called both when the mode is enabled and when it is disabled.

straight-use-package-mode is a variable defined in ../../repos/straight.el/straight.el.

Its value is t Original value was nil

Non-nil if Straight-Use-Package mode is enabled. See the straight-use-package-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 straight-use-package-mode.

You can customize this variable.

[back]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.