# HG changeset patch
# User mikael@frmp8452
# Date 1120258023 -3600
# Node ID 33e1a05864a63281a9fb0fe48f9d0824cfc6c835
# Parent 594e73bc96105e2400b19faf743c21d0c3150088
Add "verbatim multi-line" mode, with commands disabled
"/msay verbatim" enters multi-line mode with all commands disabled
but "/msay", so that lines beginning with a slash '/' can be sent.
Note:
-mcabber [ -f configfile ] [ —help | -h ] -
+mcabber [ -f configfile ] [ --help | -h ]
-mcabber(1) is a small Jabber console client.
+
mcabber(1) is a small Jabber console client.
For now it needs a configuration file to start, so please copy the sample
-mcabberrc file and adapt your connection settings.
-
-The mcabber(1) screen is divided into 4 regions. +mcabberrc file and adapt your connection settings.
+The mcabber(1) screen is divided into 4 regions. The roster, alias buddylist, is on the left. The chat window, or chat buffer, is on the right. The input line lies at the bottom of the screen, -under a small log window. -
--To display buddies chat buffers, you will have to enter chat mode. +under a small log window.
+To display buddies chat buffers, you will have to enter chat mode. You can enter chat mode by pressing enter, and leave chat mode with the ESC -key. Simply sending a message will also enable chat mode. -
--Here are some of the features of mcabber: -
+key. Simply sending a message will also enable chat mode. +Here are some of the features of mcabber:
@@ -70,48 +60,34 @@
-Text typing occurs in the input line; basic operations are supported -(left arrow, right arrow, home/end keys, insert, delete, backspace…). -
--PageUp and PageDown keys are used to move in the roster. -
--To send a message, move to the choosen buddy in the buddylist, type your +
Text typing occurs in the input line; basic operations are supported +(left arrow, right arrow, home/end keys, insert, delete, backspace…).
+PageUp and PageDown keys are used to move in the roster.
+To send a message, move to the choosen buddy in the buddylist, type your message and hit enter. If the line begins with a slash, this will be interpreted as a command (see the COMMAND section below). Hit escape to -leave the chat mode. -
--Here is a quick description of the key bindings: -
+leave the chat mode. +Here is a quick description of the key bindings:
Ctrl-a | - Go to the beginning of the input line - |
- Go to the end of the input line - | |
- Force a resize - | |
- Move inside the roster (buddylist) - | |
- Complete current word, in the input line - | |
- Cancel completion / ctrl-g - | |
- Scroll up/down half a screen in the buffer window (chat mode) - | |
- Delete from beginning of the line to the cursor - | |
- Delete from the cursor to the end of line - | |
- Backward kill word - | |
- Transpose chars - | |
- Jump to the next unread message - |
clear | - clear the current buddy chat window - |
- jump to the top of the current buddy chat buffer - | |
- jump to the bottom of the current buddy chat buffer - |
fold | - fold (shrink) the current group tree in the roster - |
- unfold (expand) the current group tree in the roster - | |
- toggle the state (fold/unfold) of the current tree - |
begin | - enter multi-line mode - + | +
+verbatim + | ++enter verbatim multi-line mode |
- send the current multi-line message to the currently selected buddy - | |
- leave multi-line mode without sending the message - |
hide_offline | - hide offline buddies - |
- show offline buddies - | |
- jump to the top of the roster - | |
- jump to the bottom of the roster - | |
- jump to the first unread message - | |
- jump to the next unread message - |
-See the provided sample configuration file, which should be self-documented. -
+See the provided sample configuration file, which should be self-documented.
-The following files can be used by mcabber(1): -
--$HOME/.mcabber/mcabberrc Default configuration file +The following files can be used by mcabber(1):
++$HOME/.mcabber/histo/ Default directory for storing chat history files, if enabled$HOME/.mcabber/mcabberrc Default configuration file $HOME/.mcabberrc Configuration file used if no other has been found -$HOME/.mcabber/histo/ Default directory for storing chat history files, if enabled -
-Certainly a lot. Please tell me if you find one! :-) -
+Certainly a lot. Please tell me if you find one! :-)
-Written by Mikael BERTHE.
+
Written by Mikael BERTHE.
Originally based on Cabber, please
-consult the AUTHORS file for details.
-
-Copyright © 2005 Mikael Berthe.
-Some portions are Copyright © 2002-2004 cabber@ajmacias.com.
-
-Free use of this software is granted under the terms of the GNU General Public -License (GPL). -
+Copyright © 2005 Mikael Berthe.
+Some portions are Copyright © 2002-2004 cabber@ajmacias.com.
Free use of this software is granted under the terms of the GNU General Public +License (GPL).
diff -r 594e73bc9610 -r 33e1a05864a6 mcabber/doc/mcabber.1.txt --- a/mcabber/doc/mcabber.1.txt Fri Jul 01 20:25:03 2005 +0100 +++ b/mcabber/doc/mcabber.1.txt Fri Jul 01 23:47:03 2005 +0100 @@ -111,15 +111,18 @@ specified, then the buddy is moved to the default group. This command only works with users (not agents), at the moment. -/msay begin|send|abort:: +/msay begin|verbatim|send|abort:: Send a multi-line message. To write a single message with several lines, the 'multi-line mode' should be used. In multi-line mode, each line (except command lines) typed in the input line will be added to the multi-line message. Once the message is finished, it can be sent to the current selected buddy with the "msay /send" - command. + command. The 'verbatim' multi-line mode disables commands, so that it + is possible to enter lines starting with a slash. Only the "/msay" + command (with send or abort parameters) can be used to exit verbatim mode. 'begin';; enter multi-line mode + 'verbatim';; enter verbatim multi-line mode 'send';; send the current multi-line message to the currently selected buddy 'abort';; leave multi-line mode without sending the message diff -r 594e73bc9610 -r 33e1a05864a6 mcabber/src/TODO --- a/mcabber/src/TODO Fri Jul 01 20:25:03 2005 +0100 +++ b/mcabber/src/TODO Fri Jul 01 23:47:03 2005 +0100 @@ -9,7 +9,6 @@ TODO: -* Multi-line "verbatim" mode (with commands disabled) * Presence notification is always accepted. We should ask... * Resource priority * UTF-8 support diff -r 594e73bc9610 -r 33e1a05864a6 mcabber/src/commands.c --- a/mcabber/src/commands.c Fri Jul 01 20:25:03 2005 +0100 +++ b/mcabber/src/commands.c Fri Jul 01 23:47:03 2005 +0100 @@ -124,6 +124,7 @@ compl_add_category_word(COMPL_MULTILINE, "abort"); compl_add_category_word(COMPL_MULTILINE, "begin"); compl_add_category_word(COMPL_MULTILINE, "send"); + compl_add_category_word(COMPL_MULTILINE, "verbatim"); } // cmd_get @@ -203,6 +204,7 @@ } if (*line != '/') { + // This isn't a command if (scr_get_multimode()) scr_append_multiline(line); else @@ -218,10 +220,17 @@ *p = 0; // Command "quit"? - if (!strncasecmp(line, "/quit", 5)) + if ((!strncasecmp(line, "/quit", 5)) && (scr_get_multimode() != 2) ) if (!line[5] || line[5] == ' ') return 255; + // If verbatim multi-line mode, we check if another /msay command is typed + if ((scr_get_multimode() == 2) && (strncasecmp(line, "/msay ", 6))) { + // It isn't an /msay command + scr_append_multiline(line); + return 0; + } + // Commands handling curcmd = cmd_get(line); @@ -401,14 +410,18 @@ void do_msay(char *arg) { - /* begin abort send */ + /* Parameters: begin verbatim abort send */ gpointer bud; if (!strcasecmp(arg, "abort")) { scr_set_multimode(FALSE); return; - } else if (!strcasecmp(arg, "begin")) { - scr_set_multimode(TRUE); + } else if ((!strcasecmp(arg, "begin")) || (!strcasecmp(arg, "verbatim"))) { + if (!strcasecmp(arg, "verbatim")) + scr_set_multimode(2); + else + scr_set_multimode(1); + scr_LogPrint("Entered multi-line message mode."); scr_LogPrint("Select a buddy and use \"/msay send\" " "when your message is ready."); diff -r 594e73bc9610 -r 33e1a05864a6 mcabber/src/screen.c --- a/mcabber/src/screen.c Fri Jul 01 20:25:03 2005 +0100 +++ b/mcabber/src/screen.c Fri Jul 01 23:47:03 2005 +0100 @@ -1097,20 +1097,19 @@ // scr_set_multimode() // Public fonction to (un)set multimode... +// Convention: +// 0 = disabled / 1 = multimode / 2 = multimode verbatim (commands disabled) inline void scr_set_multimode(int enable) { if (multiline) { g_free(multiline); multiline = NULL; } - if (enable) - multimode = TRUE; - else - multimode = FALSE; + multimode = enable; } // scr_get_multiline() -// Public fonction to get multimode status... +// Public fonction to get the current multi-line. inline const char *scr_get_multiline() { if (multimode && multiline)