smartparens icon indicating copy to clipboard operation
smartparens copied to clipboard

check-paren like functionality

Open rgemulla opened this issue 8 years ago • 2 comments

It would be great if smartparen could provide the functionality of Emacs check-paren command (which is unware of the paren pairs defined by smartparen).

rgemulla avatar Aug 28 '17 12:08 rgemulla

Something like this should theoretically work

(defun sp-check-parens ()
  (interactive)
  (goto-char (point-min))
  (while (sp-forward-sexp))
  (sp-skip-forward-to-symbol))

unless there are of course bugs in the parser (there are some issues in comments... which we should probably eagerly skip instead of trying to walk them).

Fuco1 avatar Aug 29 '17 12:08 Fuco1

Yes, that's a already helpful!

It seems to move overly aggressively, though: Nested mismatched parens are not found, e.g., it will accept (}).

rgemulla avatar Aug 29 '17 12:08 rgemulla