mineo / yatemplate

File templates for Emacs with YASnippet
https://github.com/mineo/yatemplate
GNU General Public License v3.0
68 stars 11 forks source link

Find new way to store regular expressions #31

Open mpfeifer opened 1 year ago

mpfeifer commented 1 year ago

Currently regular expressions are stored in filename. this seems to be not working well on some os (yes, windows.). May there be a new way considered to store regular expressions? Maybe in the snippet file? I currently have changed "yatemplate-regex-from-filename" to this:

;;;###autoload
(defun yatemplate-fill-alist ()
  "Fill `auto-insert-alist'."
  (yatemplate-remove-old-yatemplates-from-alist)
  (dolist (filename (reverse (yatemplate-sorted-files-in-dir)) nil)
    (let ((file-regex (yatemplate-regex-from-filename filename)))
      (if file-regex
          (push `(,(concat ".*" file-regex) . [,filename yatemplate-expand-yas-buffer]) ;; <----- here is change
                auto-insert-alist)))))

so i can use it too... of course now i lack some expressivness when defining which files to define a template for.

piknik commented 1 year ago

See #32 for a solution to this