Skip to content

counsel-set-variable fails for variables with non-symbol values #544

@kaushalmodi

Description

@kaushalmodi

I have counsel-find-file-ignore-regexp set as below:

    (setq counsel-find-file-ignore-regexp
          (concat
           ;; file names beginning with # or .
           "\\(?:\\`[#.]\\)"
           ;; file names ending with # or ~
           "\\|\\(?:[#~]\\'\\)"))

If I do, M-x counsel-set-variable for that variable, I get

Debugger entered--Lisp error: (wrong-type-argument symbolp "(?:`[#.]\)\|\(?:[#]\'\)")
symbol-name("\(?:\`[#.])|(?:[#
]')")
counsel-set-variable()
funcall-interactively(counsel-set-variable)
call-interactively(counsel-set-variable nil nil)
command-execute(counsel-set-variable)

I fixed it by commenting out the symbol-name call for now:

        (let ((res (ivy-read (format "Set (%S): " sym)
                             cands
                             ;; :preselect (symbol-name (symbol-value sym))
                             )))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions