chrisbarrett / skeletor.el

Powerful project skeletons for Emacs
GNU General Public License v3.0
126 stars 17 forks source link

Unintended replacement in template files #43

Open tendant opened 5 years ago

tendant commented 5 years ago

Is there a way to disable embedded elisp replacement in template files?

It tries to replace below minified JavaScript code (from highlight.js):

function(e){return{sL:"xml",c:[{cN:"meta",b:"^__(END|DATA)__$"},{b:"^\\s*%{1,2}={0,2}",e:"$",sL:"perl"},{b:"<%{1,2}={0,2}",e:"={0,1}%>",sL:"perl",eB:!0,eE:!0}]}});

__(END|DATA)__ doesn't need replacement. It is also kind of dangerous to try to replace blindly.

The replacement will cause error:

Error: (void-function END|DATA) replace-regexp-in-string: Wrong type argument: stringp, nil

tendant commented 5 years ago

In same js file "highlight.js", it contains a lot keywords like "__NAME__", "__DATE__" etc, which are not supposed to be replaced.

It will be great to be able to turn off replacement completely for certain files.

Any idea on possible solutions?

tendant commented 5 years ago

Tried to add template configuration(:skip-file) to skip certain files from string replacement.

Detail can be found in https://github.com/tendant/skeletor.el/commit/1c3e64088502c4f945c841284bc3154f1db25ce9

It solve this problem by skipping problematic files. This issue is also related to another pull request: https://github.com/chrisbarrett/skeletor.el/pull/39.

Please advice what's the best way to incorporate it in master branch.