Skip to content

Feature: command(s) for inserting/deleting #_ ignore forms #567

Closed
@yuhan0

Description

@yuhan0

It would be useful to have some convenient way of inserting/deleting #_ forms built into clojure-mode, but its implementation may depend on personal preference. I hope this issue attracts some discussion as to what would suit the majority of users.

My personal implementation of this idea can be found here, which I've been tweaking over the past year: https://gist.github.com/yuhan0/38ac43c764017917fc3f3e5dc9104f1b
There are two interactive commands defined there, clojure-toggle-ignore-form and clojure-toggle-ignore-surrounding-form- see docstrings for their usage.

I made some usability choices in the way it interprets numeric and universal arguments, and there's some degree of DWIM by wrapping an active region in (comment) forms and inserting blank lines before top-level forms to reduce diffs.

But it's clear that this may not suit everyone, in particular see
https://github.com/dotemacs/clojure-comment-dwim.el/issues which takes a more DWIM approach with a single entry point and more logic to determine what the command should do in different contexts and when repeatedly called.

See also BetterThanTomorrow/calva#505
for another interpretation of what such a command may do in different scenarios (note it's more selection-based as VSCode doesn't have numeric command arguments)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions