# HG changeset patch # User Uwe Brauer # Date 1663159714 -7200 # Wed Sep 14 14:48:34 2022 +0200 # Node ID f3bacb6fa8fe43433c21cf0b38ad1750df95666e # Parent 4cf7e677f4a88a308e63da6af6812e708bfa88c3 Add filename as a prefix to the counter * style/catchfilebetweentags.el (LaTeX-env-catchfilebetweentags): Add filename as a prefix to the counter. diff --git a/style/catchfilebetweentags.el b/style/catchfilebetweentags.el --- a/style/catchfilebetweentags.el +++ b/style/catchfilebetweentags.el @@ -56,17 +56,20 @@ (let ((fn (string-to-number (match-string 1)))) (when (> fn LaTeX-catchfilebetweentags-counter) (setq LaTeX-catchfilebetweentags-counter fn)))))) - (setq LaTeX-catchfilebetweentags-counter + (setq LaTeX-catchfilebetweentags-counter (1+ LaTeX-catchfilebetweentags-counter))) (defun LaTeX-env-catchfilebetweentags (_environment) "Insert a tag-skeleton defined by `LaTeX-catchfilebetweentags'. ENVIRONMENT is ignored." - (let* ((fn (when LaTeX-catchfilebetweentags-use-numeric-label - (LaTeX-catchfilebetweentags-counter-inc))) - (tag (TeX-read-string - (if fn (format "Tag (default %s): " fn) "Tag: ") - nil nil (when fn (number-to-string fn))))) + (let* + ((myfile (file-name-sans-extension (file-name-nondirectory (buffer-file-name (current-buffer))))) + (fn (when LaTeX-catchfilebetweentags-use-numeric-label)) + (tag (concat myfile ":" + (TeX-read-string + (if fn (format "Tag (default %s): " fn) "Tag: ") + nil nil (when fn (number-to-string fn))) + (number-to-string LaTeX-catchfilebetweentags-counter)))) (unless (bolp) (newline) (delete-horizontal-space))