Commit graph

1,242 commits

Author SHA1 Message Date
Charlie Gordon
4be625f5c4 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-28 00:00:03 +02:00
Charlie Gordon
84393d6c4f Add bell sounds
* add `QEDisplay::dpy_sound_bell`
* add `\007` prefix in `put_status` to sound bell
2024-07-28 00:00:03 +02:00
Charlie Gordon
492a8fc0ce Improve macro handling
* `C-x (` restarts macro learning mode if learning already
* add documentation on macro commands
2024-07-28 00:00:03 +02:00
Charlie Gordon
1df739bcb0 ocumentation
* add documentation comments
* `dbuf_init` and `dbuf_init2` return the object
* usr portable `memcpy` based approach for unaligned word access
2024-07-28 00:00:03 +02:00
Charlie Gordon
ea123bb012 Simplifications
* use `cp_skip_blanks` in language colorizers
* simplify signature matching for here documents
2024-07-28 00:00:03 +02:00
Charlie Gordon
af64810cb4 Add documentation on utility functions
* add `int ustr_get_identifier_x(dest, size, c, str, i, n, c1)`
* add `int cp_skip_blanks(const char32_t *str, int i, int n)`
2024-07-28 00:00:03 +02:00
Charlie Gordon
66f4b556ff Add documentation on utility functions
* adjusted `ustr_match_keyword` for consistency
* implement `byte_quote` natively
* implement `buf_byte_quote` using `byte_quote` instead of the reverse
2024-07-28 00:00:03 +02:00
Charlie Gordon
131490e482 Improve ppl-mode 2024-07-28 00:00:03 +02:00
Charlie Gordon
65e1bfcea7 Improve buf_t API and documentation
* rename `buf_encode_byte()` as `buf_quote_byte()`
* change `buf_printf` return value for consistency
* let `strquote` always return the length of the conversion like `snprintf`
2024-07-28 00:00:03 +02:00
Charlie Gordon
d60df466d3 Improve ustr_get_identifier
* remove `get_salmon_identifier()`
* change `swift_parse_identifier()` for consistency
* change `wolfram_get_identifier()` for consistency
2024-07-28 00:00:03 +02:00
Charlie Gordon
6e2b6e24c2 Add eb_add_tag()
* add `eb_add_tag(b, offset, name)`:
  * check for duplicate definitions
  * duplicate string argument
* use `ab_add_tag()` instead of `eb_add_property()` from language colorizers
* fix `get_js_identifier()` for `c == 0` case.
2024-07-28 00:00:03 +02:00
Charlie Gordon
a345775998 Add PPL mode
Add colorizer for Christian Neumanns' Practical Programming Language
2024-07-28 00:00:03 +02:00
Charlie Gordon
78254429f4 Some simplifications in C modes
* add `cp_skip_blanks()`
* extend `get_js_identifier()` for `c == 0` case
* export `java_mode`
* add documentation
2024-07-28 00:00:03 +02:00
Charlie Gordon
9e498ab933 remove unused target definitions 2024-07-28 00:00:03 +02:00
Charlie Gordon
e0d9a641d3
Add repeat-mode (#34)
- add `repeat` command on `C-x z`
- add `repeat-mode`, always enabled
- cycle all matching tags in current file on `goto-tag` and `find-tag`
- set up `repeat-mode` for these commands:
  - `undo` on `C-x u` (`u` repeats `undo`, `r` performs `redo`)
  - `undo` on `C-x r` (`r` repeats `redo`, `u` performs `undo`)
  - `find-window-left`, `find-window-right`, `find-window-up`, `find-window-dow`
    repeat navigation on `up`, `down`, `left`, `right`
  - `next-error`, `previous-error`: `M-n` and `M-p` repeat in corresponding direction
  - `next-buffer`, `previous-buffer: repeat buffers nagivation with `left` and `right`
  - `enlarge-window` / `shrink-window`: repeat resizing on `^`, `v`, `{`, `}`
     and cursor movement keys
  - `goto-tag` on `C-x ,` goto next tag with `,` and `.`
  - `call-last-kbd-macro` on `C-x e`: repeat macro on `e`
- add `eb_count_buffers` and `eb_get_buffer_from_index` for safe buffer navigation
- add transient bindings, known as repeat maps in GNU emacs
- pass `KeyDef **lp` (aka key maps) instead of mode for binding commands
- replace `do_next_buffer` and `do_prevous_buffer` with repeatable command
  `do_buffer_navigation`
- fix `bufed_select` crash bug when selecting buffer from a regular window
2024-05-25 23:37:05 +02:00
Charlie Gordon
6f34c65ef9
Use 1-based column numbers (#33)
- make `do-goto` accept a 1-based column number
- parse 1-based column numbers in filenames from the command line
- display 1-based column number in status lines
2024-05-21 15:14:55 +02:00
Charlie Gordon
7955a5aebb
Add window resizing commands (#32)
- add `enlarge-window` on `C-x ^`: Enlarge window vertically
- add `shrink-window` on `C-x v`: Shrink window vertically
- add `enlarge-window-horizontally` on `C-x }`: Enlarge window horizontally
- add `shrink-window-horizontally` on `C-x {`: Shrink window horizontally
- add `resize-window` on `C-x +`: Resize window interactively using the cursor keys
closes issue #21
2024-05-21 01:49:13 +02:00
Charlie Gordon
ea6a70963e
Improve documentation, configure and CI(#31)
- update **scandoc** tool
- start manual framework in qe-manual.c
- build qe-manual.md as a default target
- add more targets: linux-32bits, linux-390x, NetBSD, OpenBSD
- fix FreeBSD target: define `host_cc` 
- test for `bwapxx` macros
- test for `clang` / `gcc` / `tcc` compiler presence
- handle non standard `which` utility
2024-05-20 19:43:01 +02:00
Charlie Gordon
e2116cbdae
Modify perl colorizer for consistency with other languages (#30) 2024-05-20 11:03:29 +02:00
Charlie Gordon
b38d95345f
Add window-swap-states on C-x / to transpose windows (#29) 2024-05-20 00:29:23 +02:00
Charlie Gordon
04499c8adc
Sundries (#28)
- display character for `eval` results in range 32 to 127
- load files in memory up to 16MB
2024-05-19 21:32:00 +02:00
Charlie Gordon
ceb6b3370f
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
Charlie Gordon
c62d0f88ff
Fix fallthrough macro for older gcc compilers (#26) 2024-05-19 19:57:00 +02:00
Charlie Gordon
ed1cb90a91
add multi target build workflow (#25) 2024-05-19 19:28:59 +02:00
Charlie Gordon
a388a95305
Pass QEmacsState pointer to all module_init and module_exit functions (#24) 2024-05-19 19:15:08 +02:00
Charlie Gordon
3b271c9d2e
Select javascript mode on QuickJS scripts (#23) 2024-05-19 18:00:37 +02:00
クエン酸
bed552a905 Add commands next-buffer / previous-buffer (#20)
* Bind `next-buffer` to `C-x C-right` and `previous-buffer` to `C-x left` just like GNU Emacs
* next-buffer & previous-buffer skip buffers with BF_SYSTEM flag.
* next-buffer & previous-buffer command is ignored from minibuffer and popups.
* fix compilation errors on linux
2024-05-19 17:06:04 +02:00
Charlie Gordon
a9d4b1c0fa Add v8-torque support
- colorize decorators @xxx in js-mode
2024-03-10 12:15:59 +01:00
Charlie Gordon
234566f028
Merge pull request #17 from mystuffs/master
Add "Result" keyword for Rust
2024-03-06 08:43:41 +01:00
Charlie Gordon
eb46f4bd87 Improve shell-mode colorizer
- dump colorize_states in describe-window
- improve shell output parser to colorize code in shell output:
  * recognize patch output (diff -u)
  * recognize compiler errors
  * recognize some commands: cat, head, tail
2024-02-10 20:47:53 +01:00
Charlie Gordon
b179e97c1c Add ignore-preproc option in compare-windows
- add ignore-preproc global variable
- C-u 0 A-= resets the ignore flags
2024-02-10 20:41:53 +01:00
Charlie Gordon
85b5854d65 Fix markdown parsing bug 2024-02-10 20:37:38 +01:00
Charlie Gordon
a48695fb70 Add Vale and Bee language colorizers 2024-02-10 20:34:59 +01:00
Charlie Gordon
8994456e62 Fix clang compiler warnings
- add fallthrough pseudo keyword
- fix some macro issues
- fix compiler warnings
2024-02-10 20:29:26 +01:00
Charlie Gordon
b5ef5511ca Add Crystal language colorizer (work in progress) 2024-02-10 20:01:33 +01:00
Charlie Gordon
b625b5af00 Fun stuff
- add Newton fractal type
- accept universal argument in madelbrot-test for fractal type
2023-07-08 22:56:36 +02:00
Charlie Gordon
38e22bc211 Improve scripting language
- improve qs/js syntax highlighter
- improve markdown code block language detection
- fix binding for increase-width and decrease-width
- increase COLORED_MAX_LINE_SIZE to 16k
2023-07-08 22:54:49 +02:00
rilysh
abd615773a add "Result" keyword Rust 2023-05-21 12:16:26 -04:00
Charlie Gordon
1f79d713b0 Improve CSV syntax highlighter
* refine number and date matching
2023-03-15 09:58:33 +01:00
Charlie Gordon
7cf5878805 Add CSV mode
* add csv-mode with colorizer
* split lang/extra-modes.c to lang/emf.c and lang/sharp.c
* bump VERSION to 6.1.1c
2023-03-13 23:07:26 +01:00
Charlie Gordon
06b3d373bb Update number syntax for C23 and C++
* support quote as digit separator in C/C++ modes
  - this convention is horrible!
  - why not use _ which is compatible with the ppnumber syntax?
* bump VERSION to 6.1.1b
2023-03-09 12:57:59 +01:00
Charlie Gordon
d9633d761a Sundries
* update README.md and TODO.md
* study alternative key mapping scheme
* some constifications
2023-03-09 12:38:45 +01:00
Charlie Gordon
909f097165 Sundries
* should add auto-indent visual display for minified XML, JS, JSON files
2023-03-05 19:42:12 +01:00
Charlie Gordon
cdc935a773 Fix linux compilation problems
- add useless cast to fix unsigned comparison warning
- bump VERSION to 6.1.1a
2023-03-05 14:36:44 +01:00
Charlie Gordon
5a990e0866 Update stb_image.h to version 2.28
* version 2.28 (dated 2023-01-29) has many error detection patches
  but still needs some simple patches to silence warnings
* bumped VERSION to 6.1.1
2023-03-05 14:17:33 +01:00
Charlie Gordon
fcf4c46321 Add regex support for search and replace
* import libunicode and libregexp from QuickJS
* add utility functions:
  min/max_uint32, min/max_int64 clz/ctz/32/64
  bswap12/32/64
* add packed get and put inline functions
* add DynBuf package (dbuf_xxx)
* add unicode_to/from_utf8()
* add regex support in eb_search
* add partial regex support in query_replace: no subexpressions support
* bumped VERSION to 6.1.0
2023-03-05 13:34:19 +01:00
oguillaumin
f36144d6a8 Change license to MIT
* bumped VERSION to 6.0.0
2023-03-05 02:04:02 +01:00
oguillaumin
cb5fbbce4e Merge qfribidi into unicode_join
* remove qfribidi.h and qfribidi.c
* simplify get_mirror_char(), use table from Unicode 15.0
* improve bidir_get_type(), compact_list()
* use combined type tests for 3, 4 and 6 types
* bumped VERSION to 5.4.2
2023-03-05 01:12:14 +01:00
Charlie Gordon
b321c1923a increase string lengths in script fragments
* bump buffer size from 256 to 2048 in format and variable retrieval
* number VERSION to 5.4.1g
2023-03-04 15:59:09 +01:00
Charlie Gordon
c223ed2760 small changes in unicode_join:
* use more consistent names
* use incl/excl range in binary searches
2023-03-03 20:10:10 +01:00