Skip to content

Commit

Permalink
Latex support: newcommand, setlength, newcounter, newenvironment (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarogonzalezsotillo authored and jacktasia committed Feb 25, 2018
1 parent 3b172e2 commit 78e325e
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion dumb-jump.el
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,33 @@ or most optimal searcher."
"structure test : MYTEST ="
"signature test ="
"functor test (T:TEST) ="
"functor test(T:TEST) =")))
"functor test(T:TEST) ="))

;; latex
(:type "command" :supports ("ag" "grep" "rg" "git-grep") :language "tex"
:regex "\\\\.*newcommand\\\*?\\s*\\\{\\s*(\\\\)JJJ\\s*}"
:tests ("\\newcommand{\\test}" "\\renewcommand{\\test}" "\\renewcommand*{\\test}" "\\newcommand*{\\test}" "\\renewcommand{ \\test }")
:not("\\test" "test"))

(:type "command" :supports ("ag" "grep" "rg" "git-grep") :language "tex"
:regex "\\\\.*newcommand\\\*?\\s*(\\\\)JJJ\\j"
:tests ("\\newcommand\\test {}" "\\renewcommand\\test{}" "\\newcommand \\test")
:not("\\test" "test"))

(:type "length" :supports ("ag" "grep" "rg" "git-grep") :language "tex"
:regex "\\\\(s)etlength\\s*\\\{\\s*(\\\\)JJJ\\s*}"
:tests ("\\setlength { \\test}" "\\setlength{\\test}" "\\setlength{\\test}{morecommands}" )
:not("\\test" "test"))

(:type "counter" :supports ("ag" "grep" "rg" "git-grep") :language "tex"
:regex "\\\\newcounter\\\{\\s*JJJ\\s*}"
:tests ("\\newcounter{test}" )
:not("\\test" "test"))

(:type "environment" :supports ("ag" "grep" "rg" "git-grep") :language "tex"
:regex "\\\\.*newenvironment\\s*\\\{\\s*JJJ\\s*}"
:tests ("\\newenvironment{test}" "\\newenvironment {test}{morecommands}" "\\lstnewenvironment{test}" "\\newenvironment {test}" )
:not("\\test" "test" )))

"List of regex patttern templates organized by language and type to use for generating the grep command."
:group 'dumb-jump
Expand Down Expand Up @@ -1131,6 +1157,7 @@ or most optimal searcher."
(:language "shell" :ext "tcsh" :agtype nil :rgtype nil)
(:language "sml" :ext "sml" :agtype "sml" :rgtype "sml")
(:language "swift" :ext "swift" :agtype nil :rgtype "swift")
(:language "tex" :ext "tex" :agtype "tex" :rgtype "tex")
(:language "elixir" :ext "ex" :agtype "elixir" :rgtype "elixir")
(:language "elixir" :ext "exs" :agtype "elixir" :rgtype "elixir")
(:language "elixir" :ext "eex" :agtype "elixir" :rgtype "elixir")
Expand Down Expand Up @@ -1721,6 +1748,7 @@ current file."
(:comment "//" :language "swift")
(:comment "#" :language "elixir")
(:comment "%" :language "erlang")
(:comment "%" :language "tex")
(:comment "//" :language "scss"))
"List of one-line comments organized by language."
:group 'dumb-jump
Expand Down

0 comments on commit 78e325e

Please sign in to comment.