summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--doc/ranger.118
-rw-r--r--doc/ranger.pod5
-rw-r--r--doc/rifle.12
-rw-r--r--ranger/__init__.py11
-rwxr-xr-xranger/config/commands.py4
-rw-r--r--ranger/config/rc.conf6
-rwxr-xr-xranger/ext/rifle.py8
7 files changed, 36 insertions, 18 deletions
diff --git a/doc/ranger.1 b/doc/ranger.1
index e810e7c6..ee487e1e 100644
--- a/doc/ranger.1
+++ b/doc/ranger.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RANGER 1"
-.TH RANGER 1 "ranger-1.7.2" "01/01/2016" "ranger manual"
+.TH RANGER 1 "ranger-1.7.2" "02/24/2016" "ranger manual"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -299,16 +299,17 @@ bottom right indicates that there are marked files in this directory.
 .IX Subsection "MACROS"
 Macros can be used in commands to abbreviate things.
 .PP
-.Vb 5
+.Vb 6
 \& %f   the highlighted file
 \& %d   the path of the current directory
-\& %s   the selected files in the current directory.
+\& %s   the selected files in the current directory
 \& %t   all tagged files in the current directory
 \& %c   the full paths of the currently copied/cut files
+\& %p   the full paths of selected files
 .Ve
 .PP
-The macros \f(CW%f\fR, \f(CW%d\fR and \f(CW%s\fR also have upper case variants, \f(CW%F\fR, \f(CW%D\fR and \f(CW%S\fR,
-which refer to the next tab.  To refer to specific tabs, add a number in
+The macros \f(CW%f\fR, \f(CW%d\fR, \f(CW%p\fR, and \f(CW%s\fR also have upper case variants, \f(CW%F\fR, \f(CW%D\fR, \f(CW%P\fR, and
+\&\f(CW%S\fR, which refer to the next tab.  To refer to specific tabs, add a number in
 between.  (%7s = selection of the seventh tab.)
 .PP
 \&\f(CW%c\fR is the only macro which ranges out of the current directory. So you may
@@ -1180,6 +1181,13 @@ doesn't work for functions and regular expressions. Valid values are:
 Assigns a new value to an option, but locally for the directories that are
 marked with \fItag\fR.  This means, that this option only takes effect when
 visiting that directory.
+.Sp
+For example, to change the sorting order in your downloads directory, tag it
+with the \fIv\fR tag by typing \fI"v\fR, then use this command:
+.Sp
+.Vb 1
+\& setintag v sort ctime
+.Ve
 .IP "setlocal [path=\fIpath\fR] \fIoption\fR \fIvalue\fR" 2
 .IX Item "setlocal [path=path] option value"
 Assigns a new value to an option, but locally for the directory given by
diff --git a/doc/ranger.pod b/doc/ranger.pod
index 60deedf3..91ba904a 100644
--- a/doc/ranger.pod
+++ b/doc/ranger.pod
@@ -1237,6 +1237,11 @@ Assigns a new value to an option, but locally for the directories that are
 marked with I<tag>.  This means, that this option only takes effect when
 visiting that directory.
 
+For example, to change the sorting order in your downloads directory, tag it
+with the I<v> tag by typing I<"v>, then use this command:
+
+ setintag v sort ctime
+
 =item setlocal [path=I<path>] I<option> I<value>
 
 Assigns a new value to an option, but locally for the directory given by
diff --git a/doc/rifle.1 b/doc/rifle.1
index 32501ee0..0b67edcc 100644
--- a/doc/rifle.1
+++ b/doc/rifle.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RIFLE 1"
-.TH RIFLE 1 "rifle-1.7.2" "10/04/2015" "rifle manual"
+.TH RIFLE 1 "rifle-1.7.2" "02/24/2016" "rifle manual"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/ranger/__init__.py b/ranger/__init__.py
index 20c8ab35..b562ebf5 100644
--- a/ranger/__init__.py
+++ b/ranger/__init__.py
@@ -25,11 +25,20 @@ TIME_BEFORE_FILE_BECOMES_GARBAGE = 1200
 MAX_RESTORABLE_TABS = 3
 MACRO_DELIMITER = '%'
 DEFAULT_PAGER = 'less'
-LOGFILE = tempfile.gettempdir()+'/ranger_errorlog'
 CACHEDIR = os.path.expanduser("~/.cache/ranger")
 USAGE = '%prog [options] [path]'
 VERSION = 'ranger-master %s\n\nPython %s' % (__version__, sys.version)
 
+try:
+    ExceptionClass = FileNotFoundError
+except NameError:
+    ExceptionClass = IOError
+try:
+    LOGFILE = tempfile.gettempdir()+'/ranger_errorlog'
+except ExceptionClass:
+    LOGFILE = '/dev/null'
+del ExceptionClass
+
 # If the environment variable XDG_CONFIG_HOME is non-empty, CONFDIR is ignored
 # and the configuration directory will be $XDG_CONFIG_HOME/ranger instead.
 CONFDIR = '~/.config/ranger'
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 9aee9f29..f734d64a 100755
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -209,11 +209,7 @@ class shell(Command):
             flags = ''
             command = self.rest(1)
 
-        if not command and 'p' in flags:
-            command = 'cat %f'
         if command:
-            if '%' in command:
-                command = self.fm.substitute_macros(command, escape=True)
             self.fm.execute_command(command, flags=flags)
 
     def tab(self, tabnum):
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index d719da20..3b8ee333 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -330,9 +330,9 @@ map g? cd /usr/share/doc/ranger
 map E  edit
 map du shell -p du --max-depth=1 -h --apparent-size
 map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
-map yp shell -f echo -n %%d/%%f | xsel -i; xsel -o | xsel -i -b
-map yd shell -f echo -n %%d     | xsel -i; xsel -o | xsel -i -b
-map yn shell -f echo -n %%f     | xsel -i; xsel -o | xsel -i -b
+map yp shell -f echo -n %d/%f | xsel -i; xsel -o | xsel -i -b
+map yd shell -f echo -n %d    | xsel -i; xsel -o | xsel -i -b
+map yn shell -f echo -n %f    | xsel -i; xsel -o | xsel -i -b
 
 # Filesystem Operations
 map =  chmod
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py
index c43de24f..a8d8bee7 100755
--- a/ranger/ext/rifle.py
+++ b/ranger/ext/rifle.py
@@ -154,11 +154,12 @@ class Rifle(object):
             config_file = self.config_file
         f = open(config_file, 'r')
         self.rules = []
-        lineno = 1
+        lineno = 0
         for line in f:
-            if line.startswith('#') or line == '\n':
-                continue
+            lineno += 1
             line = line.strip()
+            if line.startswith('#') or line == '':
+                continue
             try:
                 if self.delimiter1 not in line:
                     raise Exception("Line without delimiter")
@@ -170,7 +171,6 @@ class Rifle(object):
             except Exception as e:
                 self.hook_logger("Syntax error in %s line %d (%s)" % \
                     (config_file, lineno, str(e)))
-            lineno += 1
         f.close()
 
     def _eval_condition(self, condition, files, label):