Skip to content

False assumption in cider-popup-buffer-display (with fix) #3672

Closed
@PhilHudson

Description

@PhilHudson

Expected behavior

Invoke cider-doc in the REPL, pop to fully-populated buffer *cider-doc*

Actual behavior

Error message:

eval-expression: Wrong type argument: bufferp, "*cider-doc*"

(where *cider-doc* is the first non-list element of special-display-buffer-names)

This is because code in function cider-popup-display-buffer falsely assumes that each element of special-display-buffer-names is a list. In fact and as documented, each element can be either a string or a list (the car of which is a string).

Steps to reproduce the problem

Type eg (str) at the REPL prompt, then C-c C-d C-d.

Fix

Change line 67 of cider-popup.el from:

(equal (car entry) buffer-name))

to:

(equal (if (listp entry) (car entry) entry) buffer-name))

I will submit a PR.

Environment & Version information

CIDER version information

;; CIDER 1.14.0-snapshot (package: 20240514.1334), nREPL 1.1.1
;; Clojure 1.11.1, Java 1.8.0_402

Lein / Clojure CLI version

Leiningen 2.10.0 on Java 1.8.0_402 OpenJDK 64-Bit Server VM

Emacs version

GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.0, Xaw3d scroll bars) of 2024-01-11

Operating system

Linux **** 6.7.12-1-MANJARO #1 SMP PREEMPT_DYNAMIC Thu Apr 4 04:31:03 UTC 2024 x86_64 GNU/Linux

JDK distribution

openjdk version "1.8.0_402"
OpenJDK Runtime Environment (build 1.8.0_402-b06)
OpenJDK 64-Bit Server VM (build 25.402-b06, mixed mode)

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