2008-01-18 17:03:35 +00:00
|
|
|
/*
|
2008-01-18 17:04:58 +00:00
|
|
|
* Module for handling variables in QEmacs
|
2008-01-18 17:03:35 +00:00
|
|
|
*
|
2026-06-06 00:24:47 +02:00
|
|
|
* Copyright (c) 2000-2026 Charlie Gordon.
|
2008-01-18 17:03:35 +00:00
|
|
|
*
|
2023-03-05 02:04:02 +01:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
* furnished to do so, subject to the following conditions:
|
2008-01-18 17:03:35 +00:00
|
|
|
*
|
2023-03-05 02:04:02 +01:00
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
|
* all copies or substantial portions of the Software.
|
2008-01-18 17:03:35 +00:00
|
|
|
*
|
2023-03-05 02:04:02 +01:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
|
* THE SOFTWARE.
|
2008-01-18 17:03:35 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "qe.h"
|
|
|
|
|
#include "variables.h"
|
|
|
|
|
|
2022-09-05 20:27:48 +02:00
|
|
|
static QVarType qe_variable_set_value_offset(EditState *s, VarDef *vp, void *ptr,
|
|
|
|
|
const char *value, int num);
|
|
|
|
|
static QVarType qe_variable_set_value_generic(EditState *s, VarDef *vp, void *ptr,
|
|
|
|
|
const char *value, int num);
|
2026-06-04 09:51:43 +02:00
|
|
|
static QVarType qe_variable_set_value_style(EditState *s, VarDef *vp, void *ptr,
|
|
|
|
|
const char *value, int num);
|
2022-09-04 20:15:37 +02:00
|
|
|
|
2008-04-29 18:55:14 +00:00
|
|
|
const char * const var_domain[] = {
|
|
|
|
|
"global", /* VAR_GLOBAL */
|
|
|
|
|
"state", /* VAR_STATE */
|
|
|
|
|
"buffer", /* VAR_BUFFER */
|
|
|
|
|
"window", /* VAR_WINDOW */
|
|
|
|
|
"mode", /* VAR_MODE */
|
|
|
|
|
"self", /* VAR_SELF */
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-15 13:43:50 +02:00
|
|
|
static const char * const var_domain_desc[] = {
|
|
|
|
|
"Global", /* VAR_GLOBAL */
|
|
|
|
|
"State", /* VAR_STATE */
|
|
|
|
|
"Buffer", /* VAR_BUFFER */
|
|
|
|
|
"Window", /* VAR_WINDOW */
|
|
|
|
|
"Mode", /* VAR_MODE */
|
|
|
|
|
"Other", /* VAR_SELF */
|
|
|
|
|
};
|
|
|
|
|
|
2022-08-27 20:11:38 +02:00
|
|
|
static int use_full_version = 1;
|
|
|
|
|
|
2008-01-18 17:03:35 +00:00
|
|
|
static VarDef var_table[] = {
|
|
|
|
|
|
2020-10-24 12:44:23 +00:00
|
|
|
S_VAR( "screen-width", width, VAR_NUMBER, VAR_RO,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Number of columns available for display on screen." )
|
2020-10-24 12:44:23 +00:00
|
|
|
S_VAR( "screen-height", height, VAR_NUMBER, VAR_RO,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Number of lines available for display on screen." )
|
2020-10-24 12:44:23 +00:00
|
|
|
S_VAR( "is-full-screen", is_full_screen, VAR_NUMBER, VAR_RO,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Set if this window is displayed in full screen (without borders)." )
|
2020-10-24 12:44:23 +00:00
|
|
|
S_VAR( "flag-split-window-change-focus", flag_split_window_change_focus, VAR_NUMBER, VAR_RW_SAVE,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Set if `split-window` should set focus to the new window." )
|
2026-05-10 16:41:55 +02:00
|
|
|
S_VAR( "shell-buffer-read-only", shell_buffer_read_only, VAR_NUMBER, VAR_RW_SAVE,
|
|
|
|
|
"Set if shell buffers should become read-only." )
|
|
|
|
|
S_VAR( "shell-mode-auto-interactive", shell_mode_auto_interactive, VAR_NUMBER, VAR_RW_SAVE,
|
|
|
|
|
"Set if moving to end of buffer switches to interactive mode." )
|
2026-05-16 22:08:48 +02:00
|
|
|
S_VAR( "shell-command-other-window", shell_command_other_window, VAR_NUMBER, VAR_RW_SAVE,
|
|
|
|
|
"Set if shell command should use another window." )
|
|
|
|
|
|
2022-09-05 20:27:48 +02:00
|
|
|
// XXX: need set_value function to perform side effect
|
2020-10-24 12:44:23 +00:00
|
|
|
S_VAR( "backspace-is-control-h", backspace_is_control_h, VAR_NUMBER, VAR_RW_SAVE,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Set if the Delete key sends a control-H." )
|
2022-09-05 20:27:48 +02:00
|
|
|
S_VAR( "ungot-key", ungot_key, VAR_NUMBER, VAR_RW, NULL ) // XXX: need set_value function
|
2020-10-24 12:44:23 +00:00
|
|
|
S_VAR( "QEPATH", res_path, VAR_CHARS, VAR_RO,
|
2022-08-17 21:11:13 +02:00
|
|
|
"List of directories to search for standard files to load." )
|
2020-10-24 12:44:23 +00:00
|
|
|
//S_VAR( "it", it, VAR_NUMBER, VAR_RW, NULL )
|
|
|
|
|
S_VAR( "ignore-spaces", ignore_spaces, VAR_NUMBER, VAR_RW_SAVE,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Set to ignore spaces in compare-windows." )
|
2020-10-24 12:44:23 +00:00
|
|
|
S_VAR( "ignore-comments", ignore_comments, VAR_NUMBER, VAR_RW_SAVE,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Set to ignore comments in compare-windows." )
|
|
|
|
|
S_VAR( "ignore-case", ignore_case, VAR_NUMBER, VAR_RW_SAVE,
|
|
|
|
|
"Set to ignore case in compare-windows." )
|
2024-02-10 20:41:53 +01:00
|
|
|
S_VAR( "ignore-preproc", ignore_preproc, VAR_NUMBER, VAR_RW_SAVE,
|
|
|
|
|
"Set to ignore preprocessing directives in compare-windows." )
|
Add *equivalents* for `compare-windows` (#27)
*equivalents* are strings that should compare equal in a `compare-windows`
session. You can define such strings in a **.qerc** file in the directory of
one of the files being compared. This helps ignoring known changes such as
type of function renaming... Here is an example to help compare files between
the `bellard/quickjs` and the `quickjs-ng/quickjs` repositories:
```
define_equivalent("JS_DupValue(ctx, ", "js_dup(");
define_equivalent("JSValue", "JSValueConst");
define_equivalent("JS_NewInt32(ctx, ", "js_int32(");
define_equivalent("JS_NewInt32(ctx,\n", "js_int32(");
define_equivalent("JS_NewUint32(ctx, ", "js_uint32(");
define_equivalent("JS_NewUint32(ctx,\n", "js_uint32(");
define_equivalent("JS_NewBool(ctx, ", "js_bool(");
define_equivalent("JS_NewFloat64(ctx, ", "js_float64(");
define_equivalent("JS_EXTERN ", "");
define_equivalent("JS_EXTERN JS", "JS");
define_equivalent("JS_EXTERN JS_", "JS_");
ignore_equivalent = 1;
```
Other changes were necessary for proper utf8 skipping:
- add `utf8_prefix_len(str1, str2)` to compute the length of a common initial
prefix not falling inside UTF-8 encoded codepoints.
- add `utf8_decode_prev` to get the previous codepoint
- add `eb_match_str_utf8_reverse`
2024-05-19 21:16:37 +02:00
|
|
|
S_VAR( "ignore-equivalent", ignore_equivalent, VAR_NUMBER, VAR_RW_SAVE,
|
|
|
|
|
"Set to ignore equivalent strings defined by define-equivalent." )
|
2020-10-24 12:44:23 +00:00
|
|
|
S_VAR( "hilite-region", hilite_region, VAR_NUMBER, VAR_RW_SAVE,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Set to highlight the region after setting the mark." )
|
2022-09-05 20:27:48 +02:00
|
|
|
S_VAR( "mmap-threshold", mmap_threshold, VAR_NUMBER, VAR_RW_SAVE, // XXX: need set_value function
|
2022-08-17 21:11:13 +02:00
|
|
|
"Size from which files are mmapped instead of loaded in memory." )
|
2022-09-05 20:27:48 +02:00
|
|
|
S_VAR( "max-load-size", max_load_size, VAR_NUMBER, VAR_RW_SAVE, // XXX: need set_value function
|
2022-08-17 21:11:13 +02:00
|
|
|
"Maximum size for files to be loaded or mmapped into a buffer." )
|
2022-09-05 20:27:48 +02:00
|
|
|
S_VAR( "show-unicode", show_unicode, VAR_NUMBER, VAR_RW_SAVE, // XXX: need set_value function
|
2022-08-17 21:11:13 +02:00
|
|
|
"Set to show non-ASCII characters as unicode escape sequences." )
|
2022-09-05 20:27:48 +02:00
|
|
|
S_VAR( "default-tab-width", default_tab_width, VAR_NUMBER, VAR_RW_SAVE, // XXX: need set_value function
|
2022-08-17 21:11:13 +02:00
|
|
|
"Default value of `tab-width` for buffers that do not override it." )
|
2022-09-05 20:27:48 +02:00
|
|
|
S_VAR( "default-fill-column", default_fill_column, VAR_NUMBER, VAR_RW_SAVE, // XXX: need set_value function
|
2022-08-17 21:11:13 +02:00
|
|
|
"Default value of `fill-column` for buffers that do not override it" )
|
2020-10-24 12:44:23 +00:00
|
|
|
S_VAR( "backup-inhibited", backup_inhibited, VAR_NUMBER, VAR_RW_SAVE,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Set to prevent automatic backups of modified files" )
|
2020-10-24 12:44:23 +00:00
|
|
|
S_VAR( "c-label-indent", c_label_indent, VAR_NUMBER, VAR_RW_SAVE,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Number of columns to adjust indentation of C labels." )
|
Improve macro handling
* add `macro-counter` variable
* add `QEState` fields `nb_macro_keys_run`, `macro_counter`, `macro_format`.
* add `int find_key_suffix(const char *str, char c)`
* pass `argval` to `do_call_last_kbd_macro` to handle early exit
* add `clear_macro`, `stop_macro`
* add `int check_format_string(const char *fmt, const char *template)`
* do not use `alloca` for `eb_vprintf`
* add `dbuf_str(db)`: null terminate the buffer and return a string pointer.
* add macro commands:
`edit-last-kbd-macro`, `name-last-kbd-macro`, `insert-kbd-macro`,
`read-kbd-macro`, `macro-add-counter`, `macro-set-counter`,
`macro-insert-counter`, `macro-set-format`
* `start-keyboard-macro` restarts macro learning mode if learning already
* add documentation on macro commands
* stop macros upon errors (when ringing the bell)
* stop macros if prompting the user for confirmation
2024-07-25 14:08:13 +02:00
|
|
|
S_VAR( "macro-counter", macro_counter, VAR_NUMBER, VAR_RW_SAVE,
|
|
|
|
|
"Macro counter: insert with C-x C-k TAB, set with C-x C-k C-c." )
|
2020-10-24 12:44:23 +00:00
|
|
|
|
|
|
|
|
//B_VAR( "screen-charset", charset, VAR_NUMBER, VAR_RW, NULL )
|
|
|
|
|
|
2022-09-05 20:27:48 +02:00
|
|
|
B_VAR_F( "mark", mark, VAR_NUMBER, VAR_RW, qe_variable_set_value_offset,
|
2022-08-17 21:11:13 +02:00
|
|
|
"The position of the beginning of the current region." )
|
2020-10-24 12:44:23 +00:00
|
|
|
B_VAR( "bufsize", total_size, VAR_NUMBER, VAR_RO,
|
2022-08-17 21:11:13 +02:00
|
|
|
"The number of bytes in the current buffer." )
|
2020-10-24 12:44:23 +00:00
|
|
|
B_VAR( "bufname", name, VAR_CHARS, VAR_RO,
|
2022-08-17 21:11:13 +02:00
|
|
|
"The name of the current buffer." )
|
2020-10-24 12:44:23 +00:00
|
|
|
B_VAR( "filename", filename, VAR_CHARS, VAR_RO,
|
2022-08-17 21:11:13 +02:00
|
|
|
"The name of the file associated with the current buffer." )
|
2022-09-05 20:27:48 +02:00
|
|
|
B_VAR( "tab-width", tab_width, VAR_NUMBER, VAR_RW, // XXX: need set_value function
|
2022-08-17 21:11:13 +02:00
|
|
|
"Distance between tab stops (for display of tab characters), in columns." )
|
2022-09-05 20:27:48 +02:00
|
|
|
B_VAR( "fill-column", fill_column, VAR_NUMBER, VAR_RW, // XXX: need set_value function
|
2022-08-17 21:11:13 +02:00
|
|
|
"Column beyond which automatic line-wrapping should happen." )
|
2020-10-24 12:44:23 +00:00
|
|
|
|
2022-09-05 20:27:48 +02:00
|
|
|
W_VAR_F( "point", offset, VAR_NUMBER, VAR_RW, qe_variable_set_value_offset, /* should be window-point */
|
2022-08-17 21:11:13 +02:00
|
|
|
"Current value of point in this window." )
|
2024-10-08 21:58:26 +02:00
|
|
|
W_VAR( "indent-width", indent_width, VAR_NUMBER, VAR_RW, // XXX: need set_value function
|
2022-08-17 21:11:13 +02:00
|
|
|
"Number of columns to indent by for a syntactic level." )
|
2020-10-24 12:44:23 +00:00
|
|
|
W_VAR( "indent-tabs-mode", indent_tabs_mode, VAR_NUMBER, VAR_RW,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Set if indentation can insert tabs." )
|
2026-06-04 09:51:43 +02:00
|
|
|
W_VAR_F( "default-style", default_style, VAR_STYLE, VAR_RW, qe_variable_set_value_style,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Default text style for this window." )
|
2026-06-04 09:51:43 +02:00
|
|
|
W_VAR_F( "region-style", region_style, VAR_STYLE, VAR_RW, qe_variable_set_value_style,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Text style for the current region in this window." )
|
2026-06-04 09:51:43 +02:00
|
|
|
W_VAR_F( "curline-style", curline_style, VAR_STYLE, VAR_RW, qe_variable_set_value_style,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Text style for the current line in this window." )
|
2022-09-05 20:27:48 +02:00
|
|
|
W_VAR( "window-width", width, VAR_NUMBER, VAR_RW, // XXX: need set_value function
|
2022-08-17 21:11:13 +02:00
|
|
|
"Number of display columns in this window." )
|
2022-09-05 20:27:48 +02:00
|
|
|
W_VAR( "window-height", height, VAR_NUMBER, VAR_RW, // XXX: need set_value function
|
2022-08-17 21:11:13 +02:00
|
|
|
"Number of display lines in this window." )
|
2022-09-05 20:27:48 +02:00
|
|
|
W_VAR( "window-left", xleft, VAR_NUMBER, VAR_RW, // XXX: need set_value function
|
2022-08-17 21:11:13 +02:00
|
|
|
"Display column of the left edge of this window." )
|
2022-09-05 20:27:48 +02:00
|
|
|
W_VAR( "window-top", ytop, VAR_NUMBER, VAR_RW, // XXX: need set_value function
|
2022-08-17 21:11:13 +02:00
|
|
|
"Display line of the top edge of this window." )
|
2020-10-24 12:44:23 +00:00
|
|
|
W_VAR( "window-prompt", prompt, VAR_STRING, VAR_RW,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Prompt string to show for this window." )
|
2022-09-05 20:27:48 +02:00
|
|
|
W_VAR( "dump-width", dump_width, VAR_NUMBER, VAR_RW, NULL ) // XXX: need set_value function
|
2020-10-24 12:44:23 +00:00
|
|
|
|
|
|
|
|
M_VAR( "mode-name", name, VAR_STRING, VAR_RO,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Name of the current major mode." )
|
2020-10-24 12:44:23 +00:00
|
|
|
M_VAR( "auto-indent", auto_indent, VAR_NUMBER, VAR_RW,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Set for automatic indentation on new lines." )
|
2022-09-19 15:16:59 +02:00
|
|
|
#ifdef CONFIG_SESSION
|
2020-10-24 12:44:23 +00:00
|
|
|
G_VAR( "use-session-file", use_session_file, VAR_NUMBER, VAR_RW, NULL )
|
2022-09-19 15:16:59 +02:00
|
|
|
#endif
|
2020-10-24 12:44:23 +00:00
|
|
|
G_VAR( "force-tty", force_tty, VAR_NUMBER, VAR_RW,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Set to prevent graphics display." )
|
2020-10-24 12:44:23 +00:00
|
|
|
G_VAR( "disable-crc", disable_crc, VAR_NUMBER, VAR_RW_SAVE,
|
2022-08-17 21:11:13 +02:00
|
|
|
"Set to prevent CRC based display cache." )
|
2020-10-24 12:44:23 +00:00
|
|
|
G_VAR( "use-html", use_html, VAR_NUMBER, VAR_RW, NULL )
|
2022-08-28 00:40:58 +02:00
|
|
|
G_VAR( "is-player", is_player, VAR_NUMBER, VAR_RW, NULL )
|
2022-08-27 20:11:38 +02:00
|
|
|
G_VAR( "full-version", use_full_version, VAR_NUMBER, VAR_RW, NULL )
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
|
2008-01-18 17:03:35 +00:00
|
|
|
/* more buffer fields: modified, readonly, binary, charset */
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
|
2015-08-13 23:26:59 +00:00
|
|
|
/* more window fields: mode_line, color, input_method...
|
2008-01-18 17:03:35 +00:00
|
|
|
*/
|
|
|
|
|
|
2020-10-24 12:44:23 +00:00
|
|
|
//G_VAR( "text-mode-line", text_mode.mode_line, VAR_STRING, VAR_RW, NULL )
|
|
|
|
|
//G_VAR( "binary-mode-line", binary_mode.mode_line, VAR_STRING, VAR_RW, NULL )
|
|
|
|
|
//G_VAR( "hex-mode-line", hex_mode.mode_line, VAR_STRING, VAR_RW, NULL )
|
|
|
|
|
//G_VAR( "unicode-mode-line", unihex_mode.mode_line, VAR_STRING, VAR_RW, NULL )
|
2008-01-18 17:03:35 +00:00
|
|
|
|
|
|
|
|
//Dispatch these to the appropriate modules
|
2020-10-24 12:44:23 +00:00
|
|
|
//G_VAR( "c-mode-extensions", c_mode.extensions, VAR_STRING, VAR_RW, NULL )
|
|
|
|
|
//G_VAR( "c-mode-keywords", c_mode.keywords, VAR_STRING, VAR_RW, NULL )
|
|
|
|
|
//G_VAR( "c-mode-types", c_mode.types, VAR_STRING, VAR_RW, NULL )
|
|
|
|
|
//G_VAR( "html-src-mode-extensions", htmlsrc_mode.extensions, VAR_STRING, VAR_RW, NULL )
|
|
|
|
|
//G_VAR( "html-mode-extensions", html_mode.extensions, VAR_STRING, VAR_RW, NULL )
|
|
|
|
|
//G_VAR( "perl-mode-extensions", perl_mode.extensions, VAR_STRING, VAR_RW, NULL )
|
2008-01-18 17:03:35 +00:00
|
|
|
};
|
|
|
|
|
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
static VarDef *qe_find_variable(QEmacsState *qs, const char *name)
|
2008-01-18 17:03:35 +00:00
|
|
|
{
|
|
|
|
|
VarDef *vp;
|
|
|
|
|
|
|
|
|
|
for (vp = qs->first_variable; vp; vp = vp->next) {
|
|
|
|
|
if (strequal(vp->name, name))
|
|
|
|
|
return vp;
|
|
|
|
|
}
|
|
|
|
|
/* Should have a list of local variables for buffer/window/mode
|
|
|
|
|
* instances
|
|
|
|
|
*/
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-19 15:16:59 +02:00
|
|
|
void variable_complete(CompleteState *cp, CompleteFunc enumerate) {
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
QEmacsState *qs = cp->s->qs;
|
2008-01-18 17:03:35 +00:00
|
|
|
const VarDef *vp;
|
|
|
|
|
|
|
|
|
|
for (vp = qs->first_variable; vp; vp = vp->next) {
|
2026-05-18 12:26:57 +02:00
|
|
|
(*enumerate)(cp, vp->name, CT_STRX);
|
2008-01-18 17:03:35 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVarType qe_get_variable(EditState *s, const char *name,
|
2008-04-29 18:55:14 +00:00
|
|
|
char *buf, int size, int *pnum, int as_source)
|
2008-01-18 17:03:35 +00:00
|
|
|
{
|
|
|
|
|
const VarDef *vp;
|
|
|
|
|
int num = 0;
|
2026-06-09 19:07:05 +02:00
|
|
|
QETermStyle style = 0;
|
2008-01-18 17:03:35 +00:00
|
|
|
const char *str = NULL;
|
|
|
|
|
const void *ptr;
|
2022-09-05 20:27:48 +02:00
|
|
|
const char *endp;
|
2008-01-18 17:03:35 +00:00
|
|
|
|
2022-09-05 20:27:48 +02:00
|
|
|
/* find standard variable and user variables */
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
vp = qe_find_variable(s->qs, name);
|
2008-01-18 17:03:35 +00:00
|
|
|
if (!vp) {
|
|
|
|
|
/* Try environment */
|
|
|
|
|
str = getenv(name);
|
2022-09-05 20:27:48 +02:00
|
|
|
if (!str) {
|
|
|
|
|
if (size > 0)
|
|
|
|
|
*buf = '\0';
|
|
|
|
|
return VAR_UNKNOWN;
|
|
|
|
|
}
|
|
|
|
|
num = strtol_c(str, &endp, 0);
|
|
|
|
|
if (pnum && endp != str && *endp == '\0') {
|
|
|
|
|
*pnum = num;
|
|
|
|
|
return VAR_NUMBER;
|
|
|
|
|
}
|
2008-04-29 18:55:14 +00:00
|
|
|
if (as_source)
|
2026-06-17 19:12:41 +02:00
|
|
|
strquote(buf, size, str, -1, SQB_USE_EXTENDED);
|
2008-04-29 18:55:14 +00:00
|
|
|
else
|
2022-09-05 20:27:48 +02:00
|
|
|
pstrcpy(buf, size, str);
|
|
|
|
|
return VAR_STRING;
|
2008-01-18 17:03:35 +00:00
|
|
|
}
|
|
|
|
|
switch (vp->domain) {
|
|
|
|
|
case VAR_SELF:
|
|
|
|
|
ptr = &vp->value;
|
|
|
|
|
break;
|
|
|
|
|
case VAR_GLOBAL:
|
|
|
|
|
ptr = vp->value.ptr;
|
|
|
|
|
break;
|
|
|
|
|
case VAR_STATE:
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
ptr = (const u8*)s->qs + vp->value.offset;
|
2008-01-18 17:03:35 +00:00
|
|
|
break;
|
|
|
|
|
case VAR_BUFFER:
|
|
|
|
|
ptr = (const u8*)s->b + vp->value.offset;
|
|
|
|
|
break;
|
|
|
|
|
case VAR_WINDOW:
|
|
|
|
|
ptr = (const u8*)s + vp->value.offset;
|
|
|
|
|
break;
|
|
|
|
|
case VAR_MODE:
|
|
|
|
|
ptr = (const u8*)s->mode + vp->value.offset;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
if (size > 0)
|
|
|
|
|
*buf = '\0';
|
|
|
|
|
return VAR_UNKNOWN;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (vp->type) {
|
|
|
|
|
case VAR_STRING:
|
2022-11-11 17:49:50 +01:00
|
|
|
memcpy(&str, ptr, sizeof(str));
|
2008-04-29 18:55:14 +00:00
|
|
|
if (as_source)
|
2026-06-17 19:12:41 +02:00
|
|
|
strquote(buf, size, str, -1, SQB_USE_EXTENDED);
|
2008-04-29 18:55:14 +00:00
|
|
|
else
|
|
|
|
|
pstrcpy(buf, size, str ? str : "");
|
2008-01-18 17:03:35 +00:00
|
|
|
break;
|
|
|
|
|
case VAR_CHARS:
|
|
|
|
|
str = (const char*)ptr;
|
2008-04-29 18:55:14 +00:00
|
|
|
if (as_source)
|
2026-06-17 19:12:41 +02:00
|
|
|
strquote(buf, size, str, -1, SQB_USE_EXTENDED);
|
2008-04-29 18:55:14 +00:00
|
|
|
else
|
|
|
|
|
pstrcpy(buf, size, str);
|
2008-01-18 17:03:35 +00:00
|
|
|
break;
|
|
|
|
|
case VAR_NUMBER:
|
2022-11-11 17:49:50 +01:00
|
|
|
memcpy(&num, ptr, sizeof(num));
|
2026-06-15 13:43:50 +02:00
|
|
|
if (pnum) {
|
2008-01-18 17:03:35 +00:00
|
|
|
*pnum = num;
|
2026-06-15 13:43:50 +02:00
|
|
|
} else
|
|
|
|
|
if (num < 10) {
|
|
|
|
|
snprintf(buf, size, "%d", num);
|
|
|
|
|
} else
|
|
|
|
|
if (num % (1 << 20) == 0) {
|
|
|
|
|
snprintf(buf, size, "%d (0x%x, %d MB)",
|
|
|
|
|
num, (unsigned)num, num >> 20);
|
|
|
|
|
} else
|
|
|
|
|
if (num % (1 << 10) == 0) {
|
|
|
|
|
snprintf(buf, size, "%d (0x%x, %d KB)",
|
|
|
|
|
num, (unsigned)num, num >> 10);
|
|
|
|
|
} else {
|
|
|
|
|
snprintf(buf, size, "%d (0x%x)", num, (unsigned)num);
|
|
|
|
|
}
|
2026-06-09 19:07:05 +02:00
|
|
|
break;
|
|
|
|
|
case VAR_STYLE:
|
|
|
|
|
memcpy(&style, ptr, sizeof(style));
|
|
|
|
|
if (pnum) {
|
|
|
|
|
*pnum = (int)style;
|
|
|
|
|
} else {
|
|
|
|
|
int len = snprintf(buf, size, "0x%x (", style);
|
|
|
|
|
len += qe_term_style_string(buf + len, size - len, num);
|
|
|
|
|
snprintf(buf + len, size - len, ")");
|
|
|
|
|
}
|
2008-01-18 17:03:35 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
if (size > 0)
|
|
|
|
|
*buf = '\0';
|
|
|
|
|
return VAR_UNKNOWN;
|
|
|
|
|
}
|
|
|
|
|
return vp->type;
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-05 20:27:48 +02:00
|
|
|
static QVarType qe_variable_set_value_offset(EditState *s, VarDef *vp, void *ptr,
|
|
|
|
|
const char *value, int num)
|
2022-09-04 20:15:37 +02:00
|
|
|
{
|
|
|
|
|
if (value) {
|
|
|
|
|
/* XXX: should have default, min and max values */
|
|
|
|
|
return VAR_INVALID;
|
|
|
|
|
} else {
|
2022-11-11 17:49:50 +01:00
|
|
|
int *pnum = (int *)ptr;
|
Various improvements for consistency
* add -Wno-packed compiler option
* add CONFIG_REGEX flag, undefined for tiny build
* disable regex commands in tiny build
* add documentation for some search commands and APIs
* reorder search tags for readability
* add isearch_yank_char
* use emacs names for:
isearch-repeat-backward, isearch-repeat-forward,
isearch-ring-advance, isearch-ring-retreat,
isearch-yank-word-or-char
* add occur alias for list-matching-lines
* add char32_to_utf8()
* restored some macros in cutils.h:
likely(x), unlikely(x), __maybe_unused, BOOL, FALSE, TRUE
* remove max(), min(), maxp(), minp(), clampp()
* add typed arithmetic functions:
min_int(), max_int(), clamp_int(), min3_int(), max3_int()
min_offset(), max_offset(), clamp_offset()
* use typed functions everywhere
* bump version to 5.4.1d
2022-11-21 00:20:18 +01:00
|
|
|
*pnum = clamp_offset(num, 0, s->b->total_size);
|
2022-09-04 20:15:37 +02:00
|
|
|
return VAR_NUMBER;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-04 09:51:43 +02:00
|
|
|
static QVarType qe_variable_set_value_style(EditState *s, VarDef *vp, void *ptr,
|
|
|
|
|
const char *value, int num)
|
|
|
|
|
{
|
|
|
|
|
QETermStyle style = num;
|
2026-06-09 19:07:05 +02:00
|
|
|
if (value && qe_term_get_style(&style, value)) {
|
2026-06-04 09:51:43 +02:00
|
|
|
const char *p;
|
|
|
|
|
style = strtol_c(value, &p, 0);
|
|
|
|
|
if (*p)
|
|
|
|
|
return VAR_INVALID;
|
|
|
|
|
}
|
|
|
|
|
memcpy(ptr, &style, sizeof(style));
|
|
|
|
|
return VAR_STYLE;
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-05 20:27:48 +02:00
|
|
|
static QVarType qe_variable_set_value_generic(EditState *s, VarDef *vp, void *ptr,
|
|
|
|
|
const char *value, int num)
|
2015-08-30 12:03:46 +00:00
|
|
|
{
|
|
|
|
|
char buf[32];
|
|
|
|
|
char **pstr;
|
2022-11-11 17:49:50 +01:00
|
|
|
int *pnum;
|
2015-08-30 12:03:46 +00:00
|
|
|
|
|
|
|
|
switch (vp->type) {
|
|
|
|
|
case VAR_STRING:
|
|
|
|
|
if (!value) {
|
|
|
|
|
snprintf(buf, sizeof(buf), "%d", num);
|
|
|
|
|
value = buf;
|
|
|
|
|
}
|
2022-09-05 20:27:48 +02:00
|
|
|
pstr = (char **)ptr;
|
|
|
|
|
if (!strequal(*pstr, value)) {
|
|
|
|
|
if (vp->str_alloc)
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
qe_free(pstr);
|
|
|
|
|
*pstr = qe_strdup(value);
|
2022-09-05 20:27:48 +02:00
|
|
|
vp->str_alloc = 1;
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
vp->modified = 1;
|
|
|
|
|
}
|
2015-08-30 12:03:46 +00:00
|
|
|
break;
|
|
|
|
|
case VAR_CHARS:
|
|
|
|
|
if (!value) {
|
|
|
|
|
snprintf(buf, sizeof(buf), "%d", num);
|
|
|
|
|
value = buf;
|
|
|
|
|
}
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
if (!strequal(ptr, value)) {
|
|
|
|
|
pstrcpy(ptr, vp->size, value);
|
|
|
|
|
vp->modified = 1;
|
|
|
|
|
}
|
2015-08-30 12:03:46 +00:00
|
|
|
break;
|
|
|
|
|
case VAR_NUMBER:
|
2026-06-04 09:51:43 +02:00
|
|
|
case VAR_STYLE:
|
|
|
|
|
/* XXX: should have default, min and max values? */
|
|
|
|
|
if (value) {
|
|
|
|
|
const char *p;
|
|
|
|
|
num = strtol_c(value, &p, 0);
|
|
|
|
|
if (*p) {
|
|
|
|
|
return VAR_INVALID;
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
}
|
2026-06-04 09:51:43 +02:00
|
|
|
}
|
|
|
|
|
pnum = (int *)ptr;
|
|
|
|
|
if (*pnum != num) {
|
|
|
|
|
*pnum = num;
|
|
|
|
|
vp->modified = 1;
|
2015-08-30 12:03:46 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return VAR_UNKNOWN;
|
|
|
|
|
}
|
|
|
|
|
return vp->type;
|
|
|
|
|
}
|
|
|
|
|
|
2008-01-18 17:03:35 +00:00
|
|
|
QVarType qe_set_variable(EditState *s, const char *name,
|
|
|
|
|
const char *value, int num)
|
|
|
|
|
{
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
QEmacsState *qs = s->qs;
|
2008-01-18 17:03:35 +00:00
|
|
|
void *ptr;
|
|
|
|
|
VarDef *vp;
|
|
|
|
|
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
vp = qe_find_variable(qs, name);
|
2008-01-18 17:03:35 +00:00
|
|
|
if (!vp) {
|
|
|
|
|
/* Create user variable (global/buffer/window/mode?) */
|
|
|
|
|
vp = qe_mallocz(VarDef);
|
|
|
|
|
vp->name = qe_strdup(name);
|
2022-09-05 20:27:48 +02:00
|
|
|
vp->var_alloc = 1;
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
vp->modified = 1;
|
2008-01-18 17:03:35 +00:00
|
|
|
vp->domain = VAR_SELF;
|
2015-08-13 23:00:26 +00:00
|
|
|
vp->rw = VAR_RW_SAVE;
|
2008-01-18 17:03:35 +00:00
|
|
|
if (value) {
|
2022-09-05 20:27:48 +02:00
|
|
|
vp->str_alloc = 1;
|
2008-01-18 17:03:35 +00:00
|
|
|
vp->value.str = qe_strdup(value);
|
|
|
|
|
vp->type = VAR_STRING;
|
|
|
|
|
} else {
|
|
|
|
|
vp->value.num = num;
|
|
|
|
|
vp->type = VAR_NUMBER;
|
|
|
|
|
}
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
qe_register_variables(qs, vp, 1);
|
2008-01-18 17:03:35 +00:00
|
|
|
return vp->type;
|
|
|
|
|
} else
|
|
|
|
|
if (vp->rw == VAR_RO) {
|
2015-08-30 12:03:46 +00:00
|
|
|
return VAR_READONLY;
|
2008-01-18 17:03:35 +00:00
|
|
|
} else {
|
|
|
|
|
switch (vp->domain) {
|
|
|
|
|
case VAR_SELF:
|
|
|
|
|
ptr = &vp->value;
|
|
|
|
|
break;
|
|
|
|
|
case VAR_GLOBAL:
|
|
|
|
|
ptr = vp->value.ptr;
|
|
|
|
|
break;
|
|
|
|
|
case VAR_STATE:
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
ptr = (u8*)qs + vp->value.offset;
|
2008-01-18 17:03:35 +00:00
|
|
|
break;
|
|
|
|
|
case VAR_BUFFER:
|
|
|
|
|
ptr = (u8*)s->b + vp->value.offset;
|
|
|
|
|
break;
|
|
|
|
|
case VAR_WINDOW:
|
|
|
|
|
ptr = (u8*)s + vp->value.offset;
|
|
|
|
|
break;
|
|
|
|
|
case VAR_MODE:
|
|
|
|
|
ptr = (u8*)s->mode + vp->value.offset;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return VAR_UNKNOWN;
|
|
|
|
|
}
|
2015-08-30 12:03:46 +00:00
|
|
|
return vp->set_value(s, vp, ptr, value, num);
|
2008-01-18 17:03:35 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void do_show_variable(EditState *s, const char *name)
|
|
|
|
|
{
|
|
|
|
|
char buf[MAX_FILENAME_SIZE];
|
|
|
|
|
|
2026-06-09 19:07:05 +02:00
|
|
|
switch (qe_get_variable(s, name, buf, sizeof(buf), NULL, 1)) {
|
|
|
|
|
case VAR_UNKNOWN:
|
2024-12-03 22:52:55 +01:00
|
|
|
put_error(s, "No variable %s", name);
|
2026-06-09 19:07:05 +02:00
|
|
|
break;
|
|
|
|
|
default:
|
2008-01-18 17:03:35 +00:00
|
|
|
put_status(s, "%s -> %s", name, buf);
|
2026-06-09 19:07:05 +02:00
|
|
|
break;
|
|
|
|
|
}
|
2008-01-18 17:03:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void do_set_variable(EditState *s, const char *name, const char *value)
|
|
|
|
|
{
|
2015-08-30 12:03:46 +00:00
|
|
|
switch (qe_set_variable(s, name, value, 0)) {
|
|
|
|
|
case VAR_UNKNOWN:
|
2024-12-03 22:52:55 +01:00
|
|
|
put_error(s, "Variable %s is invalid", name);
|
2015-08-30 12:03:46 +00:00
|
|
|
break;
|
|
|
|
|
case VAR_READONLY:
|
2024-12-03 22:52:55 +01:00
|
|
|
put_error(s, "Variable %s is read-only", name);
|
2015-08-30 12:03:46 +00:00
|
|
|
break;
|
|
|
|
|
case VAR_INVALID:
|
2024-12-03 22:52:55 +01:00
|
|
|
put_error(s, "Invalid value for variable %s: %s", name, value);
|
2015-08-30 12:03:46 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
do_show_variable(s, name);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-05 20:27:48 +02:00
|
|
|
static void do_describe_variable(EditState *s, const char *name) {
|
|
|
|
|
EditBuffer *b;
|
|
|
|
|
VarDef *vp;
|
|
|
|
|
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
if ((vp = qe_find_variable(s->qs, name)) == NULL) {
|
2024-12-03 22:52:55 +01:00
|
|
|
put_error(s, "No variable %s", name);
|
2022-09-05 20:27:48 +02:00
|
|
|
return;
|
|
|
|
|
}
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
b = new_help_buffer(s);
|
2022-09-05 20:27:48 +02:00
|
|
|
if (!b)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
eb_putc(b, '\n');
|
2026-06-15 13:43:50 +02:00
|
|
|
/* print name, class, current value and short description */
|
|
|
|
|
eb_variable_print_entry(b, vp, s, 1);
|
2022-09-05 20:27:48 +02:00
|
|
|
// XXX: should look up markdown documentation
|
|
|
|
|
show_popup(s, b, "Help");
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-15 13:43:50 +02:00
|
|
|
static void do_show_all_variables(EditState *s) {
|
|
|
|
|
EditBuffer *b;
|
|
|
|
|
VarDef *vp;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
b = new_help_buffer(s);
|
|
|
|
|
if (!b)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// XXX: should create links to markdown documentation
|
|
|
|
|
for (i = 0; i < countof(var_domain); i++) {
|
2026-06-17 19:12:41 +02:00
|
|
|
eb_print_style(b, DESCRIBE_STYLE_HEAD,
|
|
|
|
|
"%s variables:\n", var_domain_desc[i]);
|
2026-06-15 13:43:50 +02:00
|
|
|
for (vp = s->qs->first_variable; vp; vp = vp->next) {
|
|
|
|
|
if (vp->domain == i) {
|
|
|
|
|
/* print name, class, current value and short description */
|
|
|
|
|
eb_variable_print_entry(b, vp, s, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
eb_putc(b, '\n');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
show_popup(s, b, "Variables");
|
|
|
|
|
}
|
|
|
|
|
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
void qe_register_variables(QEmacsState *qs, VarDef *vars, int count)
|
2015-08-30 12:03:46 +00:00
|
|
|
{
|
|
|
|
|
VarDef *vp;
|
|
|
|
|
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
for (vp = vars; vp < vars + count; vp++) {
|
2015-08-30 12:03:46 +00:00
|
|
|
if (!vp->set_value)
|
2022-09-05 20:27:48 +02:00
|
|
|
vp->set_value = qe_variable_set_value_generic;
|
2015-08-30 12:03:46 +00:00
|
|
|
vp->next = vp + 1;
|
|
|
|
|
}
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
vp[-1].next = qs->first_variable;
|
2015-08-30 12:03:46 +00:00
|
|
|
qs->first_variable = vars;
|
2008-01-18 17:03:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* should register this as help function */
|
|
|
|
|
void qe_list_variables(EditState *s, EditBuffer *b)
|
|
|
|
|
{
|
|
|
|
|
char buf[MAX_FILENAME_SIZE];
|
2008-04-30 07:18:34 +00:00
|
|
|
char typebuf[32];
|
|
|
|
|
const char *type;
|
2008-01-18 17:03:35 +00:00
|
|
|
const VarDef *vp;
|
|
|
|
|
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
eb_puts(b, "\n variables:\n\n");
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
for (vp = s->qs->first_variable; vp; vp = vp->next) {
|
2020-10-17 15:41:31 +00:00
|
|
|
/* XXX: merge with variable_print_entry() */
|
2008-04-30 07:18:34 +00:00
|
|
|
switch (vp->type) {
|
|
|
|
|
case VAR_NUMBER:
|
|
|
|
|
type = "int";
|
|
|
|
|
break;
|
2026-06-04 09:51:43 +02:00
|
|
|
case VAR_STYLE:
|
|
|
|
|
type = "style";
|
|
|
|
|
break;
|
2008-04-30 07:18:34 +00:00
|
|
|
case VAR_STRING:
|
|
|
|
|
type = "string";
|
|
|
|
|
break;
|
|
|
|
|
case VAR_CHARS:
|
|
|
|
|
type = typebuf;
|
|
|
|
|
snprintf(typebuf, sizeof(typebuf), "char[%d]", vp->size);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
type = "var";
|
|
|
|
|
break;
|
|
|
|
|
}
|
2008-04-29 18:55:14 +00:00
|
|
|
qe_get_variable(s, vp->name, buf, sizeof(buf), NULL, 1);
|
2008-04-30 07:18:34 +00:00
|
|
|
eb_printf(b, " %s %s %s%s -> %s\n",
|
|
|
|
|
var_domain[vp->domain], type,
|
|
|
|
|
vp->rw ? "" : "read-only ",
|
2008-01-18 17:03:35 +00:00
|
|
|
vp->name, buf);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
void qe_save_variables(EditState *s, EditBuffer *b)
|
2015-08-13 23:00:26 +00:00
|
|
|
{
|
|
|
|
|
char buf[MAX_FILENAME_SIZE];
|
|
|
|
|
char varname[32], *p;
|
|
|
|
|
const VarDef *vp;
|
|
|
|
|
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
eb_puts(b, "// variables:\n");
|
|
|
|
|
/* Only save customized variables */
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
for (vp = s->qs->first_variable; vp; vp = vp->next) {
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
if (vp->rw != VAR_RW_SAVE || !vp->modified)
|
2015-08-13 23:00:26 +00:00
|
|
|
continue;
|
|
|
|
|
pstrcpy(varname, countof(varname), vp->name);
|
|
|
|
|
for (p = varname; *p; p++) {
|
|
|
|
|
if (*p == '-')
|
|
|
|
|
*p = '_';
|
|
|
|
|
}
|
|
|
|
|
qe_get_variable(s, vp->name, buf, sizeof(buf), NULL, 1);
|
|
|
|
|
eb_printf(b, "%s = %s;\n", varname, buf);
|
|
|
|
|
}
|
sessions: implement session saving/restoring
- add qe_save_variables(s, b)
- add use_session_file global variable
- add VarDef::modified flag to detect customized variables
- set modified flag upon variable modifications
- dired: set modified flag when changing in dired variables
- fix BUG in qe_register_variables, did not set set_value handler
on last VarDef element
- make qe_save_variables() public
- remove do_save_variables(), move save_session() to parser.c
- add eb_puts() and eb_putc() for consistency
- add WF_HIDDEN window flag to temporarily flag windows to be deleted
- add do_hide_window(), do_delete_all_windows() and do_delete_hidden_windows()
- add qe_save_window_layout() to save window layout to session file
- add do_create_window(s, filename, layout) to restore window layout
- add qe_save_macros() to save keyboard macros to session file
- detect keyboard macro redefinitions and avoid duplicates
- add qe_save_open_files() to save list of open files and directories
- pass `all` flag to do_delete_other_windows() to force complete deletion
- add qe_load_session() and do_save_session():
* qe_load_session() is invoked before parsing the command line if
use_session_file is set, via the config file or command line option (-s)
* do_save_session() is invoked just before closing qemacs. It can also
be invoked as a command and shows a popup window with the contents of
the session file produced instead of saving it.
- fix CRASH BUG in command definitions, missing argument specifier caused
spurious crashes when invoking commands from script files. This affected:
find-file(), find-file-other-window(), find-alternate-file(), kill-buffer()
load-file-from-path().
- insert newly created windows in list in top-down left-right order
- update WF_RSEPARATOR flag upon deletion of vertically split window
2015-09-10 00:25:23 +00:00
|
|
|
eb_putc(b, '\n');
|
2015-08-13 23:00:26 +00:00
|
|
|
}
|
|
|
|
|
|
2026-06-15 13:43:50 +02:00
|
|
|
int eb_variable_print_entry(EditBuffer *b, VarDef *vp, EditState *s, int long_format) {
|
2020-10-17 15:41:31 +00:00
|
|
|
char buf[256];
|
|
|
|
|
char typebuf[32];
|
|
|
|
|
const char *type = typebuf;
|
2026-06-15 14:00:05 +02:00
|
|
|
int len = 0;
|
2020-10-17 15:41:31 +00:00
|
|
|
|
|
|
|
|
if (!vp)
|
2022-08-18 14:59:10 +02:00
|
|
|
return 0;
|
|
|
|
|
|
2024-09-01 09:14:33 +02:00
|
|
|
*typebuf = '\0';
|
2020-10-17 15:41:31 +00:00
|
|
|
switch (vp->type) {
|
|
|
|
|
case VAR_NUMBER:
|
|
|
|
|
type = "int";
|
|
|
|
|
break;
|
2026-06-04 09:51:43 +02:00
|
|
|
case VAR_STYLE:
|
|
|
|
|
type = "style";
|
|
|
|
|
break;
|
2020-10-17 15:41:31 +00:00
|
|
|
case VAR_STRING:
|
|
|
|
|
type = "string";
|
|
|
|
|
break;
|
|
|
|
|
case VAR_CHARS:
|
2024-09-01 09:14:33 +02:00
|
|
|
type = "char";
|
|
|
|
|
snprintf(typebuf, sizeof(typebuf), "[%d]", vp->size);
|
2020-10-17 15:41:31 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
type = "var";
|
|
|
|
|
break;
|
|
|
|
|
}
|
2026-06-15 14:00:05 +02:00
|
|
|
|
2026-06-15 13:43:50 +02:00
|
|
|
if (long_format) {
|
|
|
|
|
len += eb_puts(b, " ");
|
|
|
|
|
if (!vp->rw) {
|
2026-06-17 19:12:41 +02:00
|
|
|
len += eb_print_style(b, QE_STYLE_KEYWORD, "const ");
|
2026-06-15 13:43:50 +02:00
|
|
|
}
|
2026-06-17 19:12:41 +02:00
|
|
|
len += eb_print_style(b, QE_STYLE_TYPE, "%s ", type);
|
2026-06-15 13:43:50 +02:00
|
|
|
}
|
2026-06-17 19:12:41 +02:00
|
|
|
len += eb_print_style(b, QE_STYLE_VARIABLE, "%s", vp->name);
|
2026-06-15 13:43:50 +02:00
|
|
|
if (long_format)
|
|
|
|
|
len += eb_puts(b, typebuf);
|
2024-09-07 12:30:16 +02:00
|
|
|
len += eb_puts(b, " = ");
|
2020-10-17 15:41:31 +00:00
|
|
|
qe_get_variable(s, vp->name, buf, sizeof(buf), NULL, 1);
|
2026-06-17 19:12:41 +02:00
|
|
|
len += eb_print_style(b, *buf == '\"' ? QE_STYLE_STRING : QE_STYLE_NUMBER, "%s", buf);
|
2026-06-15 13:43:50 +02:00
|
|
|
if (long_format) {
|
|
|
|
|
eb_putc(b, '\n');
|
|
|
|
|
if (vp->desc && *vp->desc) {
|
|
|
|
|
/* print short description */
|
2026-06-17 19:12:41 +02:00
|
|
|
eb_print_style(b, QE_STYLE_COMMENT, " %s\n", vp->desc);
|
2026-06-15 13:43:50 +02:00
|
|
|
}
|
2020-10-17 15:41:31 +00:00
|
|
|
} else {
|
2026-06-15 13:43:50 +02:00
|
|
|
if (len + 2 <= 40) {
|
|
|
|
|
b->tab_width = max_int(len + 2, b->tab_width);
|
|
|
|
|
len += eb_putc(b, '\t');
|
|
|
|
|
} else {
|
|
|
|
|
b->tab_width = 40;
|
|
|
|
|
}
|
2026-06-17 19:12:41 +02:00
|
|
|
len += eb_print_style(b, QE_STYLE_COMMENT, " %s%s",
|
|
|
|
|
vp->rw ? "" : "read-only ", var_domain[vp->domain]);
|
|
|
|
|
len += eb_print_style(b, QE_STYLE_TYPE, " %s%s", type, typebuf);
|
2020-10-17 15:41:31 +00:00
|
|
|
}
|
|
|
|
|
return len;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-18 14:59:10 +02:00
|
|
|
int variable_print_entry(CompleteState *cp, EditState *s, const char *name) {
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
VarDef *vp = qe_find_variable(s->qs, name);
|
2022-08-18 14:59:10 +02:00
|
|
|
if (vp) {
|
|
|
|
|
// XXX: should pass the target window
|
2026-06-15 13:43:50 +02:00
|
|
|
return eb_variable_print_entry(s->b, vp, s, 0);
|
2022-08-18 14:59:10 +02:00
|
|
|
} else {
|
|
|
|
|
return eb_puts(s->b, name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-17 15:41:31 +00:00
|
|
|
static CompletionDef variable_completion = {
|
2024-09-08 01:45:19 +02:00
|
|
|
.name = "variable",
|
|
|
|
|
.enumerate = variable_complete,
|
|
|
|
|
.print_entry = variable_print_entry,
|
2026-06-15 13:43:50 +02:00
|
|
|
.get_entry = command_get_entry,
|
2020-10-17 15:41:31 +00:00
|
|
|
};
|
|
|
|
|
|
2026-06-04 09:51:43 +02:00
|
|
|
static void value_complete(CompleteState *cp, CompleteFunc enumerate) {
|
|
|
|
|
style_complete(cp, enumerate);
|
|
|
|
|
color_complete(cp, enumerate);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int value_print_entry(CompleteState *cp, EditState *s, const char *name) {
|
|
|
|
|
if (find_style(name))
|
|
|
|
|
return style_print_entry(cp, s, name);
|
|
|
|
|
else
|
|
|
|
|
return color_print_entry(cp, s, name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static CompletionDef value_completion = {
|
|
|
|
|
.name = "value",
|
|
|
|
|
.enumerate = value_complete,
|
|
|
|
|
.print_entry = value_print_entry,
|
|
|
|
|
.flags = CF_SPACE_OK,
|
|
|
|
|
};
|
|
|
|
|
|
2008-01-18 17:03:35 +00:00
|
|
|
/*---------------- commands ----------------*/
|
|
|
|
|
|
2022-08-16 22:39:51 +02:00
|
|
|
static const CmdDef var_commands[] = {
|
|
|
|
|
CMD2( "show-variable", "",
|
2022-08-19 12:13:52 +02:00
|
|
|
"Show the value of a given variable",
|
2022-08-16 22:39:51 +02:00
|
|
|
do_show_variable, ESs,
|
2022-08-19 12:13:52 +02:00
|
|
|
"s{Show variable: }[variable]|variable|")
|
2022-08-16 22:39:51 +02:00
|
|
|
CMD2( "set-variable", "f8",
|
2022-08-19 12:13:52 +02:00
|
|
|
"Set the value of a variable",
|
2022-08-16 22:39:51 +02:00
|
|
|
do_set_variable, ESss,
|
2026-06-04 09:51:43 +02:00
|
|
|
"s{Set variable: }[variable]|variable|s{to value: }[value]|value|")
|
2022-09-05 20:27:48 +02:00
|
|
|
CMD2( "describe-variable", "C-h v",
|
|
|
|
|
"Show information for a variable",
|
|
|
|
|
do_describe_variable, ESs,
|
|
|
|
|
"s{Describe variable: }[variable]|variable|")
|
2026-06-15 13:43:50 +02:00
|
|
|
CMD0( "show-all-variables", "C-h C-v",
|
|
|
|
|
"Show value and information for all variables",
|
|
|
|
|
do_show_all_variables)
|
2008-01-18 17:03:35 +00:00
|
|
|
};
|
|
|
|
|
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
static int variables_init(QEmacsState *qs) {
|
|
|
|
|
qe_register_variables(qs, var_table, countof(var_table));
|
|
|
|
|
qe_register_commands(qs, NULL, var_commands, countof(var_commands));
|
|
|
|
|
qe_register_completion(qs, &variable_completion);
|
2026-06-04 09:51:43 +02:00
|
|
|
qe_register_completion(qs, &value_completion);
|
2008-01-18 17:03:35 +00:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
Remove references to global `qe_state` (#45)
* Remove references to global `qe_state`
Add `QEmacsState *qs` field in context and object structures:
- `QEditScreen`, `EditState` (renamed from `qe_state`), `QuitState`
- `WinWindow` (win32.c), `X11State` (x11.c), `QEArgs` (cmd line arguments)
- `CmdLineOptionDef::func_arg()`, `QEModeData`
- move `QEKeyContext` to `QEmacsState`
Pass `QEmacsState *qs` to configuration and state functions:
- all `module_xxx_init` and static `xxx_init` functions
- `QEDisplay::dpy_init()`, `qe_register_display()`, `screen_init()̀`
- `load_input_methods()`, `unload_input_methods()`
- `register_input_method()`, `find_input_method()`
- `find_resource_file()`, `open_resource_file()`
- `qe_find_current_binding()`, `qe_list_bindings()`
- `qe_register_mode()`, `qe_find_mode()`, `qe_find_mode_filename()`
- `qe_register_cmd_line_options()`, `set_user_option()`, `set_tty_charset()`
- `qe_register_commands()`, `qe_register_bindings()`, `qe_find_cmd()`
- `qe_register_completion()`, `qe_register_variables()`
- `eb_register_data_type()`, `parse_command_line()`
- `eb_trace_bytes()`, `qe_toggle_control_h()` (split from `do_toggle_control_h()`)
- `unget_key()`, `qe_grab_keys()`, `qe_ungrab_keys()`, `qe_key_process()`
- `eb_new()`, `eb_find()`, `eb_find_new()`, `eb_scratch()`, `eb_find_file()`
- `new_shell_buffer()` `macro_add_key()`, `clear_macro(), `stop_macro()`
- `check_window()`, `check_buffer()`, `qe_kill_buffer()`, `qe_get_history()`
- `qe_register_charset()`, `find_charset()`
Add error message handlers:
- add `QEDisplay::dpy_error()` method
- add `qe_cfg_error()`, use for all expression parsing errors
- pass opaque pointer to `css_error()`
- add `qe_put_error()` and `qe_dpy_error()`
Add context argument:
- always pass a non-null window pointer to `do_refresh()`, `new_help_buffer()`
Rename functions:
- `find_resource_file` -> `qe_find_resource_file`
- `open_resource_file` -> `qe_open_resource_file`
- `input_methods_init` -> `qe_input_methods_init`
- `load_input_methods` -> `qe_load_input_methods`
- `unload_input_methods` -> `qe_unload_input_methods`
- `find_input_methods` -> `qe_find_input_methods`
- `register_input_method` -> `qe_register_input_method`
- `parse_command_line` -> `qe_parse_command_line`
- `eb_trace_bytes` -> `qe_trace_bytes`
- `eb_init` -> `qe_data_init`
- `eb_count_buffers` -> `qe_count_buffers`
- `eb_get_buffer_from_index` -> `qe_get_buffer_from_index`
- `init_all_modules` -> `qe_init_all_modules`
- `exit_all_modules` -> `qe_exit_all_modules`
- `load_all_modules` -> `qe_load_all_modules`
- `maybe_set_mark` -> `do_maybe_set_mark`
- `unget_key` -> `qe_unget_key`
- `minibuffer_init` -> `qe_minibuffer_init`
- `edit_display` -> `qe_display`
- `new_yank_buffer` -> `qe_new_yank_buffer`
- `new_shell_buffer` -> `qe_new_shell_buffer`
- `shell_find_mode` -> `qe_shell_find_mode`
- `save_selection` -> `qe_save_selection`
- `register_emulation_bindings` -> `qe_register_emulation_bindings`
- `macro_add_key` -> `qe_macro_add_key`
- `clear_macro` -> `qe_clear_macro`
- `stop_macro` -> `qe_stop_macro`
- `eb_format_message` -> `qe_format_message`
- `screen_init` -> `qe_screen_init`
- `charset_jis_init` -> `qe_charset_jis_init`
- `charset_more_init` -> `qe_charset_more_init`
- `check_window` -> `qe_check_window`
- `check_buffer` -> `qe_check_buffer`
- `eb_find_file` -> `qe_find_buffer_file`
- `eb_find` -> `qe_find_buffer_name`
- `eb_new` -> `qe_new_buffer`
- `eb_find_new` -> `qe_new_buffer` with `BC_REUSE`
- `eb_scratch` -> `qe_new_buffer` with `BC_REUSE | BC_CLEAR`
- `find_charset` -> `qe_find_charset`
Add asan, msan and ubsan targets
Fix `qe_encode64` buffer length computation.
Add `qe_new_shell_buffer` flags `SF_REUSE_BUFFER` and `SF_ERASE_BUFFER`
Bumped version to 6.3.3
fix redundant typedef
fix compilation errors
2024-12-01 23:34:00 +01:00
|
|
|
qe_module_init(variables_init);
|