Skip to content

--edit-command (-e) in cider-start-menu is ignored when cider.el is natively compiled #4201

Closed

Description

@byronclark

Expected behavior

Typing -e in cider-start-menu (C-c C-x) followed by jj will let me edit the command in the minibuffer before it is executed

Actual behavior

The edit command in minibuffer step is skipped

Steps to reproduce the problem

With any version of cider 2.0 or later installed

  1. Open a clojure file
  2. Type C-c C-x (or run cider-start-menu)
  3. Type -e
  4. Observed that --edit-command is highlighted
  5. Type jj to start the REPL
  6. BUG Command is shown and executed immediately, no chance for editing

Environment & Version information

CIDER version information

;; Connected to nREPL server - nrepl://localhost:43463
;; CIDER 2.1.0-snapshot (package: 20260910.1543), nREPL 1.7.0
;; Clojure 1.11.1, Java 21.0.12

Lein / Clojure CLI version

$ clj --version
Clojure CLI version 1.12.6.1673 

Emacs version

GNU Emacs 30.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.52, cairo version 1.18.4)
 of 2026-08-28

Also observed on 31.1

Both versions built with native compilation.

Operating system

Fedora Linux 44. Also observed on macOS Tahoe

JDK distribution

openjdk version "21.0.12" 2026-07-21 LTS
OpenJDK Runtime Environment Temurin-21.0.12+8 (build 21.0.12+8-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.12+8 (build 21.0.12+8-LTS, mixed mode, sharing)

Activity

  1. byronclark commented on Sep 15, 2026

    @byronclark
    ContributorAuthor

    If it helps, here's the minimal config (LLM generated) I used to make sure this wasn't caused by my configuration:

    (setq package-user-dir (expand-file-name "elpa" (file-name-directory load-file-name)))
    (setq package-enable-at-startup nil)
    
    (require 'package)
    (setq package-archives
          '(("gnu"   . "https://elpa.gnu.org/packages/")
            ("melpa" . "https://melpa.org/packages/")))
    (package-initialize)
    
    (unless package-archive-contents
      (package-refresh-contents))
    
    (unless (package-installed-p 'cider)
      (package-install 'cider))
    
    (require 'cider)
    
    (message "CIDER version: %s" (cider-version))

    Saved as minimal-init.el and emacs started with emacs -Q -l minimal-init.el

  2. changed the title [-]--edit-command (-e) in cider-start-menu appears to do nothing[/-] [+]--edit-command (-e) in cider-start-menu is ignored when cider.el is natively compiled[/+] on Sep 27, 2026
  3. byronclark commented on Sep 27, 2026

    @byronclark
    ContributorAuthor

    Updated the title and emacs version in the description; this appears to only happen when native compilation is enabled.

    Here's a minimal config where the issue does not happen:

    (setq package-user-dir (expand-file-name "elpa" (file-name-directory load-file-name)))
    (setq package-enable-at-startup nil)
    
    ;; Don't natively compile, and don't use native code cached in ~/.emacs.d
    (setq native-comp-jit-compilation nil)
    (setq native-comp-eln-load-path
          (list (expand-file-name "eln-cache/" (file-name-directory load-file-name))
                (car (last native-comp-eln-load-path))))
    
    (require 'package)
    (setq package-archives
          '(("gnu"   . "https://elpa.gnu.org/packages/")
            ("melpa" . "https://melpa.org/packages/")))
    (package-initialize)
    
    (unless package-archive-contents
      (package-refresh-contents))
    
    (unless (package-installed-p 'cider)
      (package-install 'cider))
    
    (require 'cider)
    
    (message "CIDER version: %s" (cider-version))

    And then if I comment out the (setq native-comp-jit-compilation nil) form and restart I get the -e ignored behavior once native compilation finishes.

  4. added a commit that references this issue on Sep 28, 2026
    33306d6
  5. bbatsov commented on Sep 29, 2026

    @bbatsov
    Member

    Thanks for narrowing it down to native compilation, that was the key. cider-edit-jack-in-command is defined further down in cider.el than the menu code that let-binds it, and native-comp compiles each file in a fresh Emacs, so the binding came out lexical and never reached the jack-in code. Fixed in #4205.

  6. byronclark commented on Sep 29, 2026

    @byronclark
    ContributorAuthor

    thank you for the fix!

  7. added a commit that references this issue on Oct 19, 2026
    597ca22
  8. added a commit that references this issue on Oct 19, 2026
    388d95c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions