Commit graph

28 commits

Author SHA1 Message Date
Charlie Gordon
d329669530 buffer: new APIs
- int eb_insert_uchars(EditBuffer *b, int offset, int c, int n);
- int eb_replace_uchar(EditBuffer *b, int offset, int c);
- inline eb_insert_spaces() using eb_insert_uchars() instead
- add minp(), maxp() and clampp() with side effect on first argument
- publish ucs2 and ucs4 charsets
2017-04-25 16:46:41 +00:00
Charlie Gordon
e08867b692 basic: reduce global variable clutter
- make more registered objects static
- document some non static global objects
- remove some global variables
2017-04-16 21:51:19 +00:00
Charlie Gordon
c5a3bb8ecb updated heading 2017-03-25 18:14:59 +00:00
Charlie Gordon
f0aa3a4bd8 cosmetics: untabify, remove trailing spaces 2015-08-27 23:03:39 +00:00
Charlie Gordon
671f634161 changed ustrstart() and ustristart() API
* take an `int *` for the match size instead of a `const unsigned int **`
2015-06-19 14:23:55 +00:00
Charlie Gordon
2e5cc16713 improve syntax colorizing modes consistency
* create separate modes for all syntax colorizers
* add colorizing_flags to mode structure for code sharing
* pass ModeDef struct pointer to colorizing function
* remove obsolete window fields
2014-05-30 17:18:12 +00:00
Charlie Gordon
b8004d7072 simplify mode definitions
* assume text mode primitives for MODEF_SYNTAX modes
* initialize mode structures inline instead of cloning text_mode
2014-05-29 18:29:14 +00:00
Charlie Gordon
851321452f use generic mode_probe function where possible 2014-05-27 15:50:47 +00:00
Charlie Gordon
f527a58e18 add mode flags to specify different types of modes
* add  mode_flags as extra argument to qe_register_mode
* change all mode registration calls accordingly
2014-05-27 12:05:52 +00:00
Charlie Gordon
2ef06f9131 pass QEColorizeContext to ColorizeFunc callbacks
* pass state and state_only as members of QEColorizeContext
* simplify ColorizeFunc, make them more consistent
* use offsets instead of pointers to prepare for further API changes
2014-04-05 15:49:14 +00:00
Charlie Gordon
b1ab7efb54 improve colorizers
* use mode specific namespace for colorizer states and styles
* use enum values instead of preprocessor macros for states and styles
2014-04-02 12:58:12 +00:00
Charlie Gordon
b2c2c9374e improve c-mode, add mode_flags to handle language mode flavors
* add mode_flags and mode_name in EditState
* pass mode_flags to ColorizeFuncs
* define several CLANG mode flavors for C, C++, Javascript, Java, etc.
* add flavor specific keyword lists for c-mode
* add regex support in c-mode for Javascript flavor
2014-03-24 10:58:09 +00:00
Charlie Gordon
0e9fbc96a1 add tabify / untabify support
* add tabify-buffer and tabify-region
* add untabify-buffer and untabify-region
* make eb_delete and eb_delete_range return actual number of bytes removed
* simplify some deletions with better use of eb_delete_xxx functions
2014-03-21 20:49:30 +00:00
Charlie Gordon
3246605e1b improve colorizer for long lines
* use COLORED_MAX_LINE_SIZE for line buffers
* incomplete fix for "ERROR: cursor not found" bugs
2014-03-18 08:20:04 +00:00
Charlie Gordon
0052071fb2 use SET_COLOR macros in various colorizers
* use macro to prepare for coloring API change
* done for lisp-mode, markdown-mode, perl-mode, shell-script-mode,
  org-mode, makefile-mode
2014-03-10 22:11:24 +00:00
Charlie Gordon
5039815fdd fix some mode probe issues
* perform generic test on extension in text_mode_probe
* allow mode force in language modes by returning 1 instead of 0 in probe
2014-02-06 00:22:17 +00:00
Charlie Gordon
a7853b3dff add support for end of line types
* support 3 types of end of line: Unix, Dos and old style Mac
* detect eol type automatically in detect_charset
* set buffer eol_type together with charset
* transparently convert eol sequence to \n upon reading buffers
  characters in eb_nextc().
* transparently convert \n to eol sequence in eb_encode_uchar()
* handle eol types in convert-file-buffer-coding-system: either preserve
  current value or force it via charset suffix -unix, -doc and -mac
* change read_charset() to accept eol_type suffix
* add eol_type and eol_char to CharsetDecodeState
* change charset methods to take CharsetDecodeState instead of charset pointers
* display eol_type in mode line if not unix
2014-02-05 00:56:48 +00:00
Charlie Gordon
fbb37ca1cb cosmetic changes in org mode
* start messages with capital letter
* factorize code for boundary error message
2014-01-29 23:24:00 +00:00
Charlie Gordon
e967914b5a improve consistency in new/delete methodology
* use qe_mallocz for all structures
* prevent spurious uses of malloc/free/realloc
* pass pointers to pointers to all deletion functions
* use consistent patterns for list deletions
* add more dependencies in Makefiles
2014-01-23 12:56:22 +00:00
Charlie Gordon
890af446cf simplify colorize_line functions: always pass NUL terminated line
* added ustrstart, ustrstr and ustristr utility functions
* simplified org_mode_colorize
2014-01-20 18:04:00 +00:00
Charlie Gordon
6830a827dc changed styles for org levels 2014-01-16 14:34:14 +00:00
Charlie Gordon
02da1bb7a1 add generic styles buffer from shell color mode
* styles_buffer hold static style info for each character in the buffer
* new buffer flags to create styles buffers with 1, 2 or 4 bytes per char
* copy static styles to the kill_ring and pasted them style enabled buffers
* preserve static styles in convert-buffer-file-coding-system
* display style bytes in bufed list
* add commands set-region-color, set-region-style, drop-styles
2014-01-15 19:44:24 +00:00
Charlie Gordon
e4011802e3 fix memory leak 2014-01-11 18:43:49 +00:00
Charlie Gordon
9e18c57f81 improve org-mode
* org_scan_chunk: no longer checks for space before chunk
* org_colorize_line: better check for heading line
* org_colorize_line: check for chunks after white space
* simplify do_org_todo
* add new functions:
  - do_org_mark_element (M-h)
  - do_org_mark_subtree (C-c @)
2014-01-11 15:38:28 +00:00
Charlie Gordon
327f2a2812 improve org mode, add new functions
* simplify org_next/prev_heading:
  - always return valid offset
  - level = 0 if not heading found
  - pointer to level can be NULL
* add new functions:
  - do_outline_next_vsible_heading      (C-c C-n)
  - do_outline_previous_vsible_heading  (C-c C-p)
  - do_outline_up_heading               (C-c C-u)
  - do_org_backward_same_level          (C-c C-b)
  - do_org_forward_same_level           (C-c C-f)
  - do_org_goto                         (C-c C-j)
  - org-insert-heading-respect-content  (C-enter)
  - org-insert-todo-heading-respect-content
* add flags in do_org_insert_heading
2014-01-10 14:00:08 +00:00
Charlie Gordon
de81442a78 improve org mode, add new functions
* improve colorizer:
  - handle blocks (with coloring for lisp src)
  - handle TeX escapes, macros
  - handle properties, wiki syntax for rich text
* simplify header line handling, and other such utility functions
* fix org-insert-heading, org-promote/demote, org-promote/demote-substree
* fix org-meta-return
* add org-move-subtree-up/down
* remove standard init_mode function
2014-01-10 01:25:14 +00:00
Charlie Gordon
9a58b44917 new character based APIs for buffers
* add eb_skip_chars
* rename eb_delete_nextc to eb_delete_uchar
* deprecate eb_line_pad
* use char based buffer API in orgmode
2014-01-08 16:26:44 +00:00
Charlie Gordon
857ec565ae org-mode: new mode for Org files by Francois Revol (orgmode.org)
* first version with very basic support.
2014-01-07 18:26:07 +00:00