This is a simple logic test that makes use of
down-list and asks if another nested pair of parenthesis exits or not.
(not (eql (point) (progn (ignore-errors (down-list)) (point))))
A weird thing occurred when this is re-written as a function that accepts another function as argument.
(defun next-pair-exists-in (func) "Check if inner or outer pair exists. Function employs `(up-list)` or `(down-list)` as argument to work." (not (eql (point) (progn (ignore-errors (func)) (point)))))
eql point test code returns
t for positions to the left of 1, 2 and 3, the function, while moving the cursor inwards as expected, returns
nil for all positions.
How do we get the function to work?