diff --git a/autoload/latex.vim b/autoload/latex.vim index 9febe87..049da6d 100644 --- a/autoload/latex.vim +++ b/autoload/latex.vim @@ -170,9 +170,9 @@ function! s:init_errorformat() setlocal efm+=%Cl.%l\ %m " Show warnings - if g:latex_errorformat_show_warnings + if ! g:latex_quickfix_ignore_all_warnings " Ignore some warnings - for w in g:latex_errorformat_ignore_warnings + for w in g:latex_quickfix_ignored_warnings let warning = escape(substitute(w, '[\,]', '%\\\\&', 'g'), ' ') exe 'setlocal efm+=%-G%.%#'. warning .'%.%#' endfor diff --git a/autoload/latex/latexmk.vim b/autoload/latex/latexmk.vim index 68889b7..1db7cae 100644 --- a/autoload/latex/latexmk.vim +++ b/autoload/latex/latexmk.vim @@ -112,24 +112,26 @@ function! latex#latexmk#compile() endfunction " {{{1 latex#latexmk#errors -function! latex#latexmk#errors(...) +function! latex#latexmk#errors(force) cclose let log = g:latex#data[b:latex.id].log() - if empty(log) && a:1 - echo "No log file found!" + if empty(log) + if a:force + echo "No log file found!" + endif return endif - if g:latex_latexmk_autojump + if g:latex_quickfix_autojump execute 'cfile ' . log else execute 'cgetfile ' . log endif - if g:latex_latexmk_quickfix || a:1 + if g:latex_quickfix_mode || a:force botright cwindow - if g:latex_latexmk_quickfix == 2 + if g:latex_quickfix_mode == 2 wincmd p endif redraw! @@ -210,7 +212,7 @@ endfunction function! s:server_callback() if g:latex_latexmk_callback && has('clientserver') let callback = 'vim --servername ' . v:servername - \ . ' --remote-expr ''latex\#latexmk\#errors()''' + \ . ' --remote-expr ''latex\#latexmk\#errors(0)''' return ' -e ' . shellescape('$success_cmd .= "' . callback . '"') \ . ' -e ' . shellescape('$failure_cmd .= "' . callback . '"') endif diff --git a/autoload/latex/util.vim b/autoload/latex/util.vim index 8a3204d..e366edb 100644 --- a/autoload/latex/util.vim +++ b/autoload/latex/util.vim @@ -78,6 +78,13 @@ let s:convert_back_list = map([ \ ['\\\~n}' , 'ñ'], \], '[''\C\(\\IeC\s*{\)\?'' . v:val[0], v:val[1]]') +" {{{1 latex#util#error_deprecated +function! latex#util#error_deprecated(variable) + echoerr "Deprecation error: " . a:variable + echoerr "Please red docs for more info!" + echoerr ":h vim-latex-changelog" +endfunction + " {{{1 latex#util#get_env function! latex#util#get_env(...) " latex#util#get_env([with_pos]) diff --git a/doc/latex.txt b/doc/latex.txt index 763b9bc..99b645b 100644 --- a/doc/latex.txt +++ b/doc/latex.txt @@ -39,6 +39,8 @@ CONTENTS *vim-latex-contents* 12. Utility functions .................... |vim-latex-util| 13. Function reference ................... |vim-latex-functions| 14. Limitations .......................... |vim-latex-limitations| + 15. Credits .............................. |vim-latex-credits| + 16. Changelog ............................ |vim-latex-changelog| ============================================================================== INTRO *vim-latex-intro* @@ -87,7 +89,7 @@ then performs a new initialization with |latex#init|. For each latex project that is opened, a |Dictionary| is created and added to the list |g:latex#data|. The dictionary is initialized with information tied to the current project, mainly the different associated file names. In -addition, a dictonary is created for every buffer |b:latex|. This contains +addition, a dictionary is created for every buffer |b:latex|. This contains data that is specific to the current buffer, most importantly it contains the ID of the main latex project. This combination of local and global data enables |vim-latex| to work properly for multi-file latex projects. It also @@ -96,7 +98,7 @@ buffers. *g:latex#data* A |List| of |Dictionaries|, each containing data specific to a given latex -project. The ID of a latex project is the index of its dictonary in the list. +project. The ID of a latex project is the index of its dictionary in the list. An example of a dictionary is given here: > { @@ -120,7 +122,7 @@ mapped to 'li'. *b:latex* For each buffer, |vim-latex| defines a |Dictionary| that contains buffer local -information. An example of such a dictonary is: > +information. An example of such a dictionary is: > { 'id': 0, @@ -205,7 +207,7 @@ n lT *@:call latex#toc#toggle() n ll *@:call latex#latexmk#compile() n lk *@:call latex#latexmk#stop(1) n lK *@:call latex#latexmk#stop_all() -n le *@:call latex#latexmk#errors() +n le *@:call latex#latexmk#errors(1) n lg *@:call latex#latexmk#status() n lG *@:call latex#latexmk#status(1) n lc *@:call latex#latexmk#clean() @@ -234,23 +236,23 @@ Overview:~ |g:latex_complete_enabled| |g:latex_complete_recursive_bib| |g:latex_complete_patterns| - |g:latex_errorformat_ignore_warnings| - |g:latex_errorformat_show_warnings| |g:latex_fold_enabled| |g:latex_fold_envs| |g:latex_fold_parts| |g:latex_fold_preamble| |g:latex_fold_sections| |g:latex_indent_enabled| - |g:latex_latexmk_autojump| |g:latex_latexmk_callback| |g:latex_latexmk_enabled| |g:latex_latexmk_options| |g:latex_latexmk_output| - |g:latex_latexmk_quickfix| |g:latex_mappings_enabled| |g:latex_motion_enabled| |g:latex_motion_matchparen| + |g:latex_quickfix_autojump| + |g:latex_quickfix_ignored_warnings| + |g:latex_quickfix_ignore_all_warnings| + |g:latex_quickfix_mode| |g:latex_toc_enabled| |g:latex_toc_fold_levels| |g:latex_toc_fold| @@ -293,18 +295,6 @@ triggered. > \ 'ref' : '\C\\v\?\(eq\|page\|[cC]\)\?ref\*\?\_\s*{[^{}]*', \ 'bib' : '\C\\\a*cite\a*\*\?\(\[[^\]]*\]\)*\_\s*{[^{}]*', \ }) -< - *g:latex_errorformat_ignore_warnings* -List of warning messages that should be ignored. > - let g:latex_errorformat_ignore_warnings = [ - \ 'Underfull', - \ 'Overfull', - \ 'specifier changed to', - \ ] -< - *g:latex_errorformat_show_warnings* -Show warnings in quickfix window. > - let g:latex_errorformat_show_warnings = 1 < *g:latex_fold_enabled* Use this option to disable/enable folding. > @@ -341,11 +331,6 @@ List of section constructs that should be folded. > Use |vim-latex| indentation function. Not as customizable as the official indentation function, but imho it is better. > let g:latex_indent_enabled = 1 -< - *g:latex_latexmk_autojump* -Whether to automatically jump to the first error when the error window is -opened with the default mapping or |latex#latexmk#errors|. > - let g:latex_latexmk_autojump = 0 < *g:latex_latexmk_callback* If enabled, this option tells `latexmk` to run |latex#latexmk#errors| after @@ -368,19 +353,38 @@ Set extra options for `latexmk` compilation. > Set desired output for `latexmk` compilation. > let g:latex_latexmk_output = 'pdf' < - *g:latex_latexmk_quickfix* -Adjust the behavior of the quickfix window when there are compilation errors or -warnings. The recognized options are: + *g:latex_quickfix_autojump* +Whether to automatically jump to the first error whenever the |quickfix| window +is opened. > + let g:latex_latexmk_autojump = 0 +< + *g:latex_quickfix_ignore_all_warnings* +If enabled, all LaTeX warnings are ignored and will not be listed in the +quickfix window. LaTeX errors will of course still be listed. > + let g:latex_quickfix_ignore_all_warnings = 0 +< + *g:latex_quickfix_ignored_warnings* +List of warning messages that should be ignored. By default, no warnings are +ignored. To ignore some common LaTeX warnings, try the following setting: > + let g:latex_quickfix_ignored_warnings = [ + \ 'Underfull', + \ 'Overfull', + \ 'specifier changed to', + \ ] +< + *g:latex_quickfix_mode* +This option controls the behaviour of the quickfix window in case errors +and/or warnings are found. The recognized options are: Value Effect ~ - 0 The quickfix window is not opened automatically. + 0 The quickfix window is never opened automatically. 1 The quickfix window is opened automatically when there are errors, and it becomes the active window. 2 The quickfix window is opened automatically when there are errors, but it does not become the active window. The default value is: > - let g:latex_latexmk_quickfix = 2 + let g:latex_quickfix_mode = 2 < *g:latex_mappings_enabled* Whether to load the default mappings. If this is set to 0, then no mappings @@ -556,7 +560,7 @@ The default mappings are: > nnoremap ll :call latex#latexmk#compile() nnoremap lk :call latex#latexmk#stop(1) nnoremap lK :call latex#latexmk#stop_all() - nnoremap le :call latex#latexmk#errors() + nnoremap le :call latex#latexmk#errors(1) nnoremap lg :call latex#latexmk#status(0) nnoremap lG :call latex#latexmk#status(1) nnoremap lc :call latex#latexmk#clean(0) @@ -601,10 +605,10 @@ $compiling_cmd = "xdotool search --name \"%D\" " . "set_window --name \"%D compiling...\""; $success_cmd = "xdotool search --name \"%D\" " . "set_window --name \"%D OK\"; " . - "gvim --remote-expr 'latex#latexmk#errors()'"; + "gvim --remote-expr 'latex#latexmk#errors(0)'"; $failure_cmd = "xdotool search --name \"%D\" " . "set_window --name \"%D FAILURE\"; " . - "gvim --remote-expr 'latex#latexmk#errors()'"; + "gvim --remote-expr 'latex#latexmk#errors(0)'"; < Here `xdotool` (http://www.semicomplete.com/projects/xdotool/) is used to change the title of the pdf viewer during and after compilation. In addition, @@ -617,7 +621,7 @@ commands if vim has the option |+clientserver|, and if the option |g:latex_latexmk_callback| is enabled. The command that is used by `latexmk` is then on the following form: > - gvim --servername v:servername --remote-expr 'latex#latexmk#errors()' + gvim --servername v:servername --remote-expr 'latex#latexmk#errors(0)' This command is then appended to the existing `$success_cmd` and `$failure_cmd`. Note that if the existing commands are not empty, then they @@ -807,9 +811,18 @@ output files. This will only be run if `latexmk` is not already running. Starts `latexmk -pvc ...` for the given buffer, if it is not already running. *latex#latexmk#errors* -Displays the log file in the quickfix window. The output may be controlled -slightly with the options |g:latex_errorformat_show_warnings| and -|g:latex_errorformat_ignore_warnings|. +Parse the log file for errors and warnings. If any errors or warnings are +found, they are displayed in the quickfix window. The exact behaviour is +controlled through the different quickfix specific option: + + |g:latex_quickfix_autojump| + |g:latex_quickfix_ignore_all_warnings| + |g:latex_quickfix_ignored_warnings| + |g:latex_quickfix_mode| + +Note: The function takes one argument, which if nonzero will force open the +quickfix window if any errors are present. This is used in the normal mode +mapping. *latex#latexmk#status* Show if `latexmk` has been started for the current buffer. An optional @@ -909,7 +922,23 @@ documentation. ============================================================================== CHANGELOG *vim-latex-changelog* -First public release: 2013/10/05~ +The following changelog only logs important changes, such as changes that +break backwards compatibility. See the git log for the detailed changelog. + +2014-06-13: Changed some option names~ +Some |vim-latex| option names were changed in an attempt to make the names +more consistent. These options are listed here for reference: + *g:latex_errorformat_ignore_warnings* + *g:latex_errorformat_show_warnings* + *g:latex_latexmk_autojump* + *g:latex_latexmk_quickfix* +The new names are, respectively: + |g:latex_quickfix_ignored_warnings| + |g:latex_quickfix_ignore_all_warnings| + |g:latex_quickfix_autojump| + |g:latex_quickfix_mode| + +2013-10-05: First public release~ ============================================================================== vim:tw=78:ts=8:ft=help:norl: diff --git a/ftplugin/tex.vim b/ftplugin/tex.vim index d7ed8ac..b176221 100644 --- a/ftplugin/tex.vim +++ b/ftplugin/tex.vim @@ -17,6 +17,11 @@ set commentstring=\%\ %s " {{{1 Options +call latex#util#error_deprecated('g:latex_errorformat_ignore_warnings') +call latex#util#error_deprecated('g:latex_errorformat_show_warnings') +call latex#util#error_deprecated('g:latex_latexmk_autojump') +call latex#util#error_deprecated('g:latex_latexmk_quickfix') + call latex#util#set_default('g:latex_build_dir', '.') call latex#util#set_default('g:latex_complete_enabled', 1) call latex#util#set_default('g:latex_complete_close_braces', 0) @@ -26,13 +31,6 @@ call latex#util#set_default('g:latex_complete_patterns', \ 'ref' : '\C\\v\?\(eq\|page\|[cC]\|labelc\)\?ref\*\?\_\s*{[^{}]*', \ 'bib' : '\C\\\a*cite\a*\*\?\(\[[^\]]*\]\)*\_\s*{[^{}]*', \ }) -call latex#util#set_default('g:latex_errorformat_show_warnings', 1) -call latex#util#set_default('g:latex_errorformat_ignore_warnings', - \ [ - \ 'Underfull', - \ 'Overfull', - \ 'specifier changed to', - \ ]) call latex#util#set_default('g:latex_fold_enabled', 1) call latex#util#set_default('g:latex_fold_preamble', 1) call latex#util#set_default('g:latex_fold_envs', 1) @@ -56,11 +54,13 @@ call latex#util#set_default('g:latex_latexmk_enabled', 1) call latex#util#set_default('g:latex_latexmk_callback', 1) call latex#util#set_default('g:latex_latexmk_options', '') call latex#util#set_default('g:latex_latexmk_output', 'pdf') -call latex#util#set_default('g:latex_latexmk_autojump', '0') -call latex#util#set_default('g:latex_latexmk_quickfix', '2') call latex#util#set_default('g:latex_mappings_enabled', 1) call latex#util#set_default('g:latex_motion_enabled', 1) call latex#util#set_default('g:latex_motion_matchparen', 1) +call latex#util#set_default('g:latex_quickfix_autojump', '0') +call latex#util#set_default('g:latex_quickfix_ignore_all_warnings', 0) +call latex#util#set_default('g:latex_quickfix_ignored_warnings', []) +call latex#util#set_default('g:latex_quickfix_mode', '2') call latex#util#set_default('g:latex_toc_enabled', 1) call latex#util#set_default('g:latex_toc_width', 30) call latex#util#set_default('g:latex_toc_split_side', 'leftabove')