Hot answers tagged

3

Use up-list or backward-up-list to move forward or backward to the first enclosing bracket, then forward-list or backward-list to locate the matching bracket. Delete the closing bracket then the opening bracket (in this order, because deleting the opening bracket moves the position of the closing bracket. (defun delete-enclosing-parentheses (&optional ...


1

Adding an answer based on @gilles-so-stop-being-evil 's current answer which works when the point is on the opening bracket as well as the last bracket, it also error checks and prints useful status upon completion. (defun find-surrounding-brackets (pos) "Return a pair of buffer positions for the opening & closing bracket positions. Or nil when ...


Only top voted, non community-wiki answers of a minimum length are eligible