Skip to content

Parse in boundaries #13

@volrath

Description

@volrath

I'm currently in the need of parsing just a fraction of a buffer, so I thought on changing the signature of parseclj-parse-clojure to something like:

(defun parseclj-parse-clojure (&optional bounds-or-string options)
  ...)

bounds-or-string can be either a list (or cons) with positions/markers, a string that will be put into a temp buffer and scanned from (point-min) to (point-max), or nil, in which case just scans from (point) til the end (current default behavior)

I wanted to hear your thoughts on it before implementing.

My temporary solution is to use narrowing:

(save-excursion
  (goto-char (car bounds))
  (apply #'narrow-to-region bounds)
  (prog1 (parseclj-parse-clojure)
    (widen)))

But I think it's not ideal.

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