Parse key binding commands. More...
#include "config.h"#include <stdbool.h>#include <stdint.h>#include <stdio.h>#include <string.h>#include "mutt/lib.h"#include "core/lib.h"#include "gui/lib.h"#include "mutt.h"#include "lib.h"#include "menu/lib.h"#include "parse/lib.h"
Include dependency graph for commands.c:Go to the source code of this file.
Macros | |
| #define | MAX_SEQ 8 |
| Maximum length of a key binding sequence used for buffer in km_bind. | |
Functions | |
| enum CommandResult | km_bind (const char *s, enum MenuType mtype, int op, char *macro, char *desc, struct Buffer *err) |
| Set up a key binding. | |
| static void | km_unbind_all (struct KeymapList *km_list, unsigned long mode) |
| Free all the keys in the supplied Keymap. | |
| static char * | parse_keymap (enum MenuType *mtypes, struct Buffer *s, int max_menus, int *num_menus, struct Buffer *err, bool bind) |
| Parse a user-config key binding. | |
| static void * | parse_menu (bool *menus, char *s, struct Buffer *err) |
| Parse menu-names into an array. | |
| static enum CommandResult | try_bind (char *key, enum MenuType mtype, char *func, const struct MenuFuncOp *funcs, struct Buffer *err) |
| Try to make a key binding. | |
| enum CommandResult | parse_push (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
| Parse the 'push' command - Implements Command::parse() -. | |
| enum CommandResult | parse_bind (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
| Parse the 'bind' command - Implements Command::parse() -. | |
| enum CommandResult | parse_unbind (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
| Parse the 'unbind' command - Implements Command::parse() -. | |
| enum CommandResult | parse_macro (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
| Parse the 'macro' command - Implements Command::parse() -. | |
| enum CommandResult | parse_exec (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
| Parse the 'exec' command - Implements Command::parse() -. | |
Parse key binding commands.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file commands.c.
| #define MAX_SEQ 8 |
Maximum length of a key binding sequence used for buffer in km_bind.
Definition at line 43 of file commands.c.
| enum CommandResult km_bind | ( | const char * | s, |
| enum MenuType | mtype, | ||
| int | op, | ||
| char * | macro, | ||
| char * | desc, | ||
| struct Buffer * | err ) |
Set up a key binding.
| s | Key string |
| mtype | Menu type, e.g. MENU_EDITOR |
| op | Operation, e.g. OP_DELETE |
| macro | Macro string |
| desc | Description of macro (OPTIONAL) |
| err | Buffer for error message |
| CommandResult | Result e.g. MUTT_CMD_SUCCESS |
Insert a key sequence into the specified map. The map is sorted by ASCII value (lowest to highest)
Definition at line 58 of file commands.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Free all the keys in the supplied Keymap.
| km_list | Keymap mapping |
| mode | Undo bind or macro, e.g. MUTT_UNBIND, MUTT_UNMACRO |
Iterate through Keymap and free keys defined either by "macro" or "bind".
Definition at line 163 of file commands.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Parse a user-config key binding.
| mtypes | Array for results |
| s | Buffer containing config string |
| max_menus | Total number of menus |
| num_menus | Number of menus this config applies to |
| err | Buffer for error messages |
| bind | If true 'bind', otherwise 'macro' |
| ptr | Key string for the binding |
Expects to see: <menu-string>,<menu-string>,... <key-string>
Definition at line 191 of file commands.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Parse menu-names into an array.
| menus | Array for results |
| s | String containing menu-names |
| err | Buffer for error messages |
| NULL | Always |
Expects to see: <menu-string>[,<menu-string>]
Definition at line 255 of file commands.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Try to make a key binding.
| key | Key name |
| mtype | Menu type, e.g. MENU_PAGER |
| func | Function name |
| funcs | Functions table |
| err | Buffer for error message |
| CommandResult | Result e.g. MUTT_CMD_SUCCESS |
Definition at line 288 of file commands.c.
Here is the call graph for this function:
Here is the caller graph for this function: