summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-11-14 14:56:28 +0100
committerhut <hut@lepus.uberspace.de>2015-11-14 15:00:47 +0100
commit740261f127d52bc612674a2bb7a9794c587d5b0a (patch)
tree12fd0fa57149b8ae7bc451047d12b059e69e0108
parent84247cffc5ecc3d20bb332718d4d9543be74e869 (diff)
downloadranger-740261f127d52bc612674a2bb7a9794c587d5b0a.tar.gz
Added :echo command, disabled :notify command
-rw-r--r--doc/ranger.16
-rw-r--r--doc/ranger.pod5
-rw-r--r--ranger/config/commands.py10
-rw-r--r--ranger/core/main.py2
4 files changed, 21 insertions, 2 deletions
diff --git a/doc/ranger.1 b/doc/ranger.1
index f426d5c6..6ec463b6 100644
--- a/doc/ranger.1
+++ b/doc/ranger.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RANGER 1"
-.TH RANGER 1 "ranger-1.7.2" "10/04/2015" "ranger manual"
+.TH RANGER 1 "ranger-1.7.2" "11/14/2015" "ranger manual"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -855,6 +855,7 @@ ranger.  For your convenience, this is a list of the \*(L"public\*(R" commands i
 \& cunmap keys...
 \& default_linemode [path=regexp | tag=tags] linemodename
 \& delete
+\& echo [text]
 \& edit [filename]
 \& eval [\-q] python_code
 \& filter [string]
@@ -981,6 +982,9 @@ Set the default linemode for all files in ~/books/ to \*(L"metatitle\*(R":
 Destroy all files in the selection with a roundhouse kick.  ranger will ask for
 a confirmation if you attempt to delete multiple (marked) files or non-empty
 directories.  This can be changed by modifying the setting \*(L"confirm_on_delete\*(R".
+.IP "echo \fItext\fR" 2
+.IX Item "echo text"
+Display the text in the statusbar.
 .IP "edit [\fIfilename\fR]" 2
 .IX Item "edit [filename]"
 Edit the current file or the file in the argument.
diff --git a/doc/ranger.pod b/doc/ranger.pod
index 6c66f817..e1a8d032 100644
--- a/doc/ranger.pod
+++ b/doc/ranger.pod
@@ -873,6 +873,7 @@ ranger.  For your convenience, this is a list of the "public" commands including
  cunmap keys...
  default_linemode [path=regexp | tag=tags] linemodename
  delete
+ echo [text]
  edit [filename]
  eval [-q] python_code
  filter [string]
@@ -1015,6 +1016,10 @@ Destroy all files in the selection with a roundhouse kick.  ranger will ask for
 a confirmation if you attempt to delete multiple (marked) files or non-empty
 directories.  This can be changed by modifying the setting "confirm_on_delete".
 
+=item echo I<text>
+
+Display the text in the statusbar.
+
 =item edit [I<filename>]
 
 Edit the current file or the file in the argument.
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 4f7f109a..0dc22147 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -98,6 +98,16 @@ class alias(Command):
         else:
             self.fm.commands.alias(self.arg(1), self.rest(2))
 
+
+class echo(Command):
+    """:echo <text>
+
+    Display the text in the statusbar.
+    """
+    def execute(self):
+        self.fm.notify(self.rest(1))
+
+
 class cd(Command):
     """:cd [-r] <dirname>
 
diff --git a/ranger/core/main.py b/ranger/core/main.py
index 55102dc2..96f56bf1 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -245,7 +245,7 @@ def load_settings(fm, clean):
 
     # Load default commands
     fm.commands = ranger.api.commands.CommandContainer()
-    exclude = ['settings']
+    exclude = ['settings', 'notify']
     include = [name for name in dir(Actions) if name not in exclude]
     fm.commands.load_commands_from_object(fm, include)
     fm.commands.load_commands_from_module(commands)