radian-software/el-patch

Overriding concat definition

haji-ali opened this issue · 1 comments

The following lines:

(cl-letf* ((old-concat (symbol-function 'concat))
((symbol-function 'concat)
(lambda (&rest args)
(if (cl-some (lambda (x) (equal x '...)) args)
(cons 'el-patch-template--concat args)

produce a warning in the development version of emacs 29. In general, redefining primitives like concat is not recommended (even advising concat produces the same error).
This is required in el-patch-template in case one of the argument of el-patch-concat is an expandable ... in which case el-patch-template--concat should be called instead.

One way to avoid this is to modify el-patch-resolve to call a custom variable or function instead of concat (which defaults to concat) and which I can then set to a different value when resolving a template.

Is that an acceptable solution? Is a custom function or variable preferred?

Using a variable sounds like a fine solution, based on what I understand from my current understanding of the template implementation. I don't think there is any need for the user to customize this, so it can be an internal variable.