+ ;; Hack for tex files, where \include often excludes .tex.
+ ;; Maybe this is safe generally.
+ (if (and (> (length source-file-extension) 1)
+ (string-equal source-file-extension "tex"))
+ (format "%s\\(?:\\.%s\\)?"
+ (regexp-quote source-file-nonext)
+ (regexp-quote source-file-extension))
+ (regexp-quote source-file-nondir))))