about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorToon Nolten <toon.nolten@student.kuleuven.be>2019-08-18 15:05:08 +0200
committerToon Nolten <toon.nolten@student.kuleuven.be>2019-08-18 15:15:50 +0200
commit9511bd6e6b0d8a3e8ce04b723cf4903b81db1b61 (patch)
treeb2cc8b2a46b9f65eda963aaac852e1a918502643
parent498ac4ffa7b90d385de6078a9162606a6bc524c3 (diff)
downloadranger-9511bd6e6b0d8a3e8ce04b723cf4903b81db1b61.tar.gz
Drop truth values; rename warning setting
-rw-r--r--doc/ranger.129
-rw-r--r--doc/ranger.pod8
-rw-r--r--examples/rc_emacs.conf2
-rw-r--r--ranger/config/rc.conf2
-rw-r--r--ranger/container/settings.py3
-rw-r--r--ranger/core/main.py6
6 files changed, 32 insertions, 18 deletions
diff --git a/doc/ranger.1 b/doc/ranger.1
index bccbfa98..af13e690 100644
--- a/doc/ranger.1
+++ b/doc/ranger.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
+.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
 .\"
 .\" Standard preamble:
 .\" ========================================================================
@@ -46,7 +46,7 @@
 .ie \n(.g .ds Aq \(aq
 .el       .ds Aq '
 .\"
-.\" If the F register is >0, we'll generate index entries on stderr for
+.\" If the F register is turned on, we'll generate index entries on stderr for
 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
 .\" entries marked with X<> in POD.  Of course, you'll have to process the
 .\" output yourself in some meaningful fashion.
@@ -56,12 +56,12 @@
 ..
 .nr rF 0
 .if \n(.g .if rF .nr rF 1
-.if (\n(rF:(\n(.g==0)) \{\
-.    if \nF \{\
+.if (\n(rF:(\n(.g==0)) \{
+.    if \nF \{
 .        de IX
 .        tm Index:\\$1\t\\n%\t"\\$2"
 ..
-.        if !\nF==2 \{\
+.        if !\nF==2 \{
 .            nr % 0
 .            nr F 2
 .        \}
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RANGER 1"
-.TH RANGER 1 "ranger-1.9.2" "25/07/19" "ranger manual"
+.TH RANGER 1 "ranger-1.9.2" "18-08-2019" "ranger manual"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -173,7 +173,7 @@ plugins, sample configuration files and some programs for integrating ranger
 with other software.  They are usually installed to
 \&\fI/usr/share/doc/ranger/examples\fR.
 .PP
-The man page of \fBrifle\fR\|(1) describes the functions of the file opener
+The man page of \fIrifle\fR\|(1) describes the functions of the file opener
 .PP
 The section \fI\s-1LINKS\s0\fR of this man page contains further resources.
 .SH "POSITIONAL ARGUMENTS"
@@ -342,7 +342,7 @@ To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR t
 \fIkitty\fR
 .IX Subsection "kitty"
 .PP
-This only works on Kitty. It requires \s-1PIL\s0 (or pillow) to work.
+This only works on Kitty. It requires \s-1PIL \s0(or pillow) to work.
 Allows remote image previews, for example in an ssh session.
 .PP
 To enable this feature, set the option \f(CW\*(C`preview_images_method\*(C'\fR to kitty.
@@ -666,7 +666,7 @@ Toggle the mark-status of all files
 .IP "V" 14
 .IX Item "V"
 Starts the visual mode, which selects all files between the starting point and
-the cursor until you press \s-1ESC.\s0  To unselect files in the same way, use \*(L"uV\*(R".
+the cursor until you press \s-1ESC. \s0 To unselect files in the same way, use \*(L"uV\*(R".
 .IP "/" 14
 Search for files in the current directory.
 .IP ":" 14
@@ -971,6 +971,13 @@ all directories above the current one as well?
 .IP "mouse_enabled [bool] <zm>" 4
 .IX Item "mouse_enabled [bool] <zm>"
 Enable mouse input?
+.IP "nested_ranger_warning [string]" 4
+.IX Item "nested_ranger_warning [string]"
+Warn at startup if \f(CW\*(C`RANGER_LEVEL\*(C'\fR is greater than 0, in other words give a
+warning when you nest ranger in a subshell started by ranger. Allowed values
+are \f(CW\*(C`true\*(C'\fR, \f(CW\*(C`false\*(C'\fR and \f(CW\*(C`error\*(C'\fR. The special value \f(CW\*(C`error\*(C'\fR promotes the
+warning to an error, this is usually shown as red text but will crash ranger
+when run with the \f(CW\*(C`\-\-debug\*(C'\fR flag.
 .IP "one_indexed [bool]" 4
 .IX Item "one_indexed [bool]"
 Start line numbers from 1.  Possible values are:
@@ -1684,7 +1691,7 @@ Specifies the theme to be used for syntax highlighting when \fIpygmentize\fR is
 installed, unless \fIhighlight\fR is also installed. Find out possible values by
 running:
  python \-c 'import pygments.styles; [print(stl) for stl in
- pygments.styles.\fBget_all_styles()\fR]'
+ pygments.styles.\fIget_all_styles()\fR]'
 .IP "\s-1HIGHLIGHT_STYLE\s0" 8
 .IX Item "HIGHLIGHT_STYLE"
 Specifies the theme to be used for syntax highlighting when \fIhighlight\fR is
@@ -1743,7 +1750,7 @@ copy, run:
 .Ve
 .SH "SEE ALSO"
 .IX Header "SEE ALSO"
-\&\fBrifle\fR\|(1)
+\&\fIrifle\fR\|(1)
 .SH "BUGS"
 .IX Header "BUGS"
 Report bugs here: <https://github.com/ranger/ranger/issues>
diff --git a/doc/ranger.pod b/doc/ranger.pod
index 0fd5cc47..4b44fc92 100644
--- a/doc/ranger.pod
+++ b/doc/ranger.pod
@@ -985,6 +985,14 @@ all directories above the current one as well?
 
 Enable mouse input?
 
+=item nested_ranger_warning [string]
+
+Warn at startup if C<RANGER_LEVEL> is greater than 0, in other words give a
+warning when you nest ranger in a subshell started by ranger. Allowed values
+are C<true>, C<false> and C<error>. The special value C<error> promotes the
+warning to an error, this is usually shown as red text but will crash ranger
+when run with the C<--debug> flag.
+
 =item one_indexed [bool]
 
 Start line numbers from 1.  Possible values are:
diff --git a/examples/rc_emacs.conf b/examples/rc_emacs.conf
index a2e81892..e3596ba5 100644
--- a/examples/rc_emacs.conf
+++ b/examples/rc_emacs.conf
@@ -208,7 +208,7 @@ set metadata_deep_search false
 
 # Warn at startup if RANGER_LEVEL env var is greater than 0, in other words
 # give a warning when you nest ranger in a subshell started by ranger.
-# Special value "bad" makes the warning more visible.
+# Special value "error" makes the warning more visible.
 set nested_ranger_warning true
 
 # ===================================================================
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index 70701edf..00a20def 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -303,7 +303,7 @@ set size_in_bytes false
 
 # Warn at startup if RANGER_LEVEL env var is greater than 0, in other words
 # give a warning when you nest ranger in a subshell started by ranger.
-# Special value "bad" makes the warning more visible.
+# Special value "error" makes the warning more visible.
 set nested_ranger_warning true
 
 # ===================================================================
diff --git a/ranger/container/settings.py b/ranger/container/settings.py
index 58e9df2e..0b098659 100644
--- a/ranger/container/settings.py
+++ b/ranger/container/settings.py
@@ -106,8 +106,7 @@ ALLOWED_VALUES = {
     'confirm_on_delete': ['multiple', 'always', 'never'],
     'draw_borders': ['none', 'both', 'outline', 'separators'],
     'line_numbers': ['false', 'absolute', 'relative'],
-    'nested_ranger_warning': ['true', 'false', 'yes', 'no', 'enabled',
-                              'disabled', 'bad'],
+    'nested_ranger_warning': ['true', 'false', 'error'],
     'one_indexed': [False, True],
     'preview_images_method': ['w3m', 'iterm2', 'terminology',
                               'urxvt', 'urxvt-full', 'kitty',
diff --git a/ranger/core/main.py b/ranger/core/main.py
index bc0b742a..aefaacbc 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -183,10 +183,10 @@ def main(
         if int(os.environ[level]) > 1:
             warning = 'Warning:'
             nested_warning = "You're in a nested ranger instance!"
-            nrw = fm.settings.nested_ranger_warning.lower()
-            if nrw in ['true', 'yes', 'enabled']:
+            warn_when_nested = fm.settings.nested_ranger_warning.lower()
+            if warn_when_nested == 'true':
                 fm.notify(' '.join((warning, nested_warning)), bad=False)
-            elif nrw == 'bad':
+            elif warn_when_nested == 'error':
                 fm.notify(' '.join((warning.upper(), nested_warning + '!!')),
                           bad=True)