summaryrefslogtreecommitdiffstats
path: root/debian/patches/debian
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/debian')
-rw-r--r--debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch27
-rw-r--r--debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch28
-rw-r--r--debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch29
-rw-r--r--debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch101
4 files changed, 185 insertions, 0 deletions
diff --git a/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch b/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch
new file mode 100644
index 0000000..2d703d1
--- /dev/null
+++ b/debian/patches/debian/Add-recognition-of-more-LaTeX-commands-for-tex-filetype-d.patch
@@ -0,0 +1,27 @@
+From: Stefano Zacchiroli <zack@debian.org>
+Date: Fri, 25 Aug 2006 13:33:04 +0200
+Subject: Add recognition of more LaTeX commands for tex filetype detection
+
+Since filetype detection of TeX files defaults to plaintex, we've added
+detection of some additional LaTeX commands to help sway the detection
+to LaTeX.
+
+Closes: #384479
+Signed-off-by: James McCoy <jamessan@debian.org>
+---
+ runtime/autoload/dist/ft.vim | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
+index bfc325d..7d1e15f 100644
+--- a/runtime/autoload/dist/ft.vim
++++ b/runtime/autoload/dist/ft.vim
+@@ -935,7 +935,7 @@ export def FTtex()
+ var firstNC = search('^\s*[^[:space:]%]', 'c', 1000)
+ if firstNC > 0
+ # Check the next thousand lines for a LaTeX or ConTeXt keyword.
+- var lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>'
++ var lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>\|renewcommand\>\|part\>\|chapter\>\|section\>\|subsection\>\|subsubsection\>\|paragraph\>\|subparagraph\>\|subsubparagraph'
+ var cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>'
+ var kwline = search('^\s*\\\%(' .. lpat .. '\)\|^\s*\\\(' .. cpat .. '\)',
+ 'cnp', firstNC + 1000)
diff --git a/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch b/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch
new file mode 100644
index 0000000..f535de8
--- /dev/null
+++ b/debian/patches/debian/Detect-the-rst-filetype-using-the-contents-of-the-file.patch
@@ -0,0 +1,28 @@
+From: James Vega <jamessan@debian.org>
+Date: Fri, 18 Aug 2006 09:06:20 -0400
+Subject: Detect the rst filetype using the contents of the file
+
+Closes: #382541
+---
+ runtime/autoload/dist/script.vim | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim
+index f86c428..a1162b1 100644
+--- a/runtime/autoload/dist/script.vim
++++ b/runtime/autoload/dist/script.vim
+@@ -380,6 +380,14 @@ def DetectFromText(line1: string)
+ elseif line1 =~ 'exec\s\+\S*scheme' || line2 =~ 'exec\s\+\S*scheme'
+ set ft=scheme
+
++ # rst files
++ elseif line1 =~ '^\.\.\s\|^\s*restindex\s*$'
++ || line2 =~ '^\.\.\s\|^\s*restindex\s*$'
++ || line3 =~ '^\.\.\s\|^\s*restindex\s*$'
++ || line4 =~ '^\.\.\s\|^\s*restindex\s*$'
++ || line5 =~ '^\.\.\s\|^\s*restindex\s*$'
++ set ft=rst
++
+ # Git output
+ elseif line1 =~ '^\(commit\|tree\|object\) \x\{40,\}\>\|^tag \S\+$'
+ set ft=git
diff --git a/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch b/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch
new file mode 100644
index 0000000..6be3a21
--- /dev/null
+++ b/debian/patches/debian/Document-Debian-s-decision-to-disable-modelines-by-defaul.patch
@@ -0,0 +1,29 @@
+From: James Vega <jamessan@debian.org>
+Date: Thu, 27 Mar 2008 03:42:02 +0000
+Subject: Document Debian's decision to disable modelines by default
+
+Modelines have historically been a source of vulnerabilities in Vim.
+As long as it remains a "blacklist suspected/proven dangerous options"
+instead of a "whitelist allowed options" piece of functionality,
+Debian's system-wide vimrc will maintain this setting. As such, the
+documentation needs to be updated to reflect the induced behavior.
+
+Closes: #472522
+Signed-off-by: James McCoy <jamessan@debian.org>
+---
+ runtime/doc/options.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
+index 4f0ac45..29991e2 100644
+--- a/runtime/doc/options.txt
++++ b/runtime/doc/options.txt
+@@ -5510,7 +5510,7 @@ A jump table for the options with a short description can be found at |Q_op|.
+
+ *'modeline'* *'ml'* *'nomodeline'* *'noml'*
+ 'modeline' 'ml' boolean (Vim default: on (off for root),
+- Vi default: off)
++ Debian: off, Vi default: off)
+ local to buffer
+ If 'modeline' is on 'modelines' gives the number of lines that is
+ checked for set commands. If 'modeline' is off or 'modelines' is zero
diff --git a/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch b/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch
new file mode 100644
index 0000000..74c2f85
--- /dev/null
+++ b/debian/patches/debian/Support-sourcing-a-vimrc.tiny-when-Vim-is-invoked-as-vi.patch
@@ -0,0 +1,101 @@
+From: James McCoy <jamessan@debian.org>
+Date: Tue, 6 Oct 2015 23:46:30 -0400
+Subject: Support sourcing a vimrc.tiny when Vim is invoked as vi
+
+This is used only in the vim-tiny package to allow a specific
+configuration for vim-tiny's vi. The vim-tiny package is substantially
+different from other Vim packages, so it does not make sense to
+share the same config.
+
+Closes: #222138
+Signed-off-by: Stefano Zacchiroli <zack@debian.org>
+Signed-off-by: James Vega <jamessan@debian.org>
+---
+ src/main.c | 23 ++++++++++++++++++++++-
+ src/os_unix.h | 3 +++
+ src/structs.h | 3 +++
+ 3 files changed, 28 insertions(+), 1 deletion(-)
+
+diff --git a/src/main.c b/src/main.c
+index d1c42ed..c3e6bda 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -1929,6 +1929,10 @@ parse_command_name(mparm_T *parmp)
+ }
+ else if (STRNICMP(initstr, "vim", 3) == 0)
+ initstr += 3;
++#ifdef SYS_TINYRC_FILE
++ else if (STRNICMP(initstr, "vi", 2) == 0)
++ parmp->vi_mode = TRUE;
++#endif
+
+ // Catch "[r][g]vimdiff" and "[r][g]viewdiff".
+ if (STRICMP(initstr, "diff") == 0)
+@@ -3224,7 +3228,12 @@ source_startup_scripts(mparm_T *parmp)
+ * Get system wide defaults, if the file name is defined.
+ */
+ #ifdef SYS_VIMRC_FILE
+- (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE, NULL);
++# if defined(SYS_TINYRC_FILE) && defined(TINY_VIMRC)
++ if (parmp->vi_mode)
++ (void)do_source((char_u *)SYS_TINYRC_FILE, FALSE, DOSO_NONE, NULL);
++ else
++# endif
++ (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE, NULL);
+ #endif
+ #ifdef MACOS_X
+ (void)do_source((char_u *)"$VIMRUNTIME/macmap.vim", FALSE,
+@@ -3263,13 +3272,25 @@ source_startup_scripts(mparm_T *parmp)
+ #ifdef USR_EXRC_FILE2
+ && do_source((char_u *)USR_EXRC_FILE2, FALSE,
+ DOSO_NONE, NULL) == FAIL
++#endif
++#if defined(SYS_TINYRC_FILE) && defined(TINY_VIMRC)
++ && !parmp->vi_mode
+ #endif
+ && !has_dash_c_arg)
+ {
+ // When no .vimrc file was found: source defaults.vim.
+ if (do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE,
+ NULL) == FAIL)
++ {
++ /*
++ * If running as the vim.tiny executable, regardless how what argv[0] is, we
++ * don't want to error due to missing defaults.vim. That's provided by
++ * vim-runtime, which isn't typically installed with vim-tiny.
++ */
++#ifndef TINY_VIMRC
+ emsg(e_failed_to_source_defaults);
++#endif
++ }
+ }
+ }
+
+diff --git a/src/os_unix.h b/src/os_unix.h
+index d87ec90..3f5ce0f 100644
+--- a/src/os_unix.h
++++ b/src/os_unix.h
+@@ -205,6 +205,9 @@ typedef struct dsc$descriptor DESC;
+ /*
+ * Unix system-dependent file names
+ */
++#ifndef SYS_TINYRC_FILE
++# define SYS_TINYRC_FILE "$VIM/vimrc.tiny"
++#endif
+ #ifndef SYS_VIMRC_FILE
+ # define SYS_VIMRC_FILE "$VIM/vimrc"
+ #endif
+diff --git a/src/structs.h b/src/structs.h
+index 46a71cb..ac661a6 100644
+--- a/src/structs.h
++++ b/src/structs.h
+@@ -4468,6 +4468,9 @@ typedef struct
+ #ifdef FEAT_DIFF
+ int diff_mode; // start with 'diff' set
+ #endif
++#ifdef SYS_TINYRC_FILE
++ int vi_mode; /* started as "vi" */
++#endif
+ } mparm_T;
+
+ /*