Skip to content

better api for programmatic use #2

@wbolster

Description

@wbolster

right now the only api is the copy-as-format function which inspects the prefix argument and relies on the region being active.

it would be nice to have a public function that would take two positions (begin and end) and a format argument (string, t to prompt for format, nil for default format) that would copy the text in between those two positions using the specified format.

something like this:

(defun copy-as-format-positions (beg end &optional format)
  ...)

this would allow for better use in custom commands, and also for better integration with evil-mode, which has its own concepts to define various regions (e.g. with text objects).

even better, there should be an option to not copy but only return the formatted text, which would mean it can be used in other functions.

what do you think about this? i could come up with a pr if you agree this makes sense to have.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions