Function: cider-stacktrace--apply-filters

cider-stacktrace--apply-filters is a byte-compiled function defined in cider-stacktrace.el.

Signature

(cider-stacktrace--apply-filters NEG-FILTERS POS-FILTERS)

Documentation

Set visibility on stack frames.

Should be called by cider-stacktrace-apply-filters which has the logic of how to interpret the combinations of the positive and negative filters. For instance, the presence of the positive filter project requires all of the other negative filters to be applied so that only project frames are shown. NEG-FILTERS are the tags that should be hidden. POS-FILTERS are the tags that must be shown.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-stacktrace.el
(defun cider-stacktrace--apply-filters (neg-filters pos-filters)
  "Set visibility on stack frames.
Should be called by `cider-stacktrace-apply-filters' which has the logic of
how to interpret the combinations of the positive and negative filters.
For instance, the presence of the positive filter `project' requires all of
the other negative filters to be applied so that only project frames are
shown.  NEG-FILTERS are the tags that should be hidden.  POS-FILTERS are
the tags that must be shown."
  (with-current-buffer cider-error-buffer
    (save-excursion
      (goto-char (point-min))
      (let ((inhibit-read-only t)
            (hidden 0))
        (while (not (eobp))
          (when (and (cider-stacktrace-frame-p)
                     (not (cider-stacktrace-collapsed-p)))
            (let* ((flags (get-text-property (point) 'flags))
                   (hide (cider-stacktrace--should-hide-p neg-filters
                                                          pos-filters
                                                          flags)))
              (when hide (setq hidden (1+ hidden)))
              (put-text-property (point) (line-beginning-position 2)
                                 'invisible hide)))
          (forward-line 1))
        (setq cider-stacktrace-hidden-frame-count hidden)))
    (cider-stacktrace-indicate-filters neg-filters pos-filters)))