4

Possible solutions: (mapcar (lambda (entry) (+ entry 2)) x) (mapcar (apply-partially #'+ 2) x) And if you need to update x, then setq it to the result of one of the above forms, e.g.: (setq x (mapcar (apply-partially #'+ 2) x))


3

identity is a built-in function that returns its argument unchanged: (identity ARG)


2

You are trying to use the values returned by functions outer-paren and sp-forward-sexp, instead of the positions they move to. The error message tells you that narrow-to-region expects buffer positions - numbers or markers. So clearly your values of start and end aren't such. They aren't numbers or markers because functions outer-paren and sp-forward-sexp ...


1

I think you need to access the property values that narrow to region needs. (use-package smartparens) (defun outer-paren () "Move point to the outermost parenthesis." (interactive) (ignore-errors (while t (up-list))) (sp-backward-sexp)) (defun func () (let ((start (outer-paren)) (end (sp-forward-sexp))) (...


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