Commit graph

765 commits

Author SHA1 Message Date
Charlie Gordon
ea3b85cdb1 fix cpp compilation: use non const typedef 2015-09-16 21:44:12 +00:00
Charlie Gordon
4f47d8b945 portability: avoid using or pseudo-keyword 2015-09-16 21:43:22 +00:00
Charlie Gordon
6dfb503d62 fixed do_set_visited_file_name if no file associated 2015-09-16 21:42:18 +00:00
Charlie Gordon
8591718dd2 clang: add colorizer for JetBrains Kotlin language 2015-09-16 12:58:33 +00:00
Charlie Gordon
d815596cc2 clang: improve idl colorizer
- add keywords
- add generic flag for mixed case capitalized typenames
2015-09-16 12:56:04 +00:00
Charlie Gordon
630c3ab063 fix compilation issues
- keyword order for inline functions
- track qs->active_window at load time
2015-09-16 12:40:58 +00:00
Charlie Gordon
c6d898dbb1 fix compilation warning 2015-09-16 12:35:43 +00:00
Charlie Gordon
fdaa11780f protect tty_resize against spurious window sizes 2015-09-16 12:35:01 +00:00
Charlie Gordon
eb4f3b878a fix compilation warning: keyword order 2015-09-16 12:33:36 +00:00
Charlie Gordon
50a92f2f53 protect against multiples inclusion 2015-09-16 12:33:03 +00:00
Charlie Gordon
ccd355c176 Makefile: create object directorieson the fly 2015-09-16 12:31:19 +00:00
Charlie Gordon
24fb2ba964 parser: small fixes and comments in simplistic parser 2015-09-14 19:05:53 +00:00
Charlie Gordon
9b433ae687 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
Charlie Gordon
415907161d clang: small improvement on regex coloring for jsx mode 2015-09-09 23:55:26 +00:00
Charlie Gordon
2df74ac150 haskell: colorize compiler directives 2015-09-01 10:14:30 +00:00
Charlie Gordon
be30361e2d html: force refresh upon mode selection 2015-08-31 08:51:17 +00:00
Charlie Gordon
6d87117bbc dired: set default position in new dired window to first entry 2015-08-30 21:51:49 +00:00
Charlie Gordon
bd10c24ac0 bufed: use buffer flag instead of buffer mode name 2015-08-30 15:31:28 +00:00
Charlie Gordon
545284f68b dired: code cleanup, better layout control
- refactored dired_sort_list() as dired_update_buffer():
  better detection of formating changes and less useless sorting
- make sort-mode, hflag, nflag... remanent and global for all dired buffers
- fix and simplify handling of current entry in dired popleft window.
- compute and display numbers of hidden files and directories
- total byte count only accounts for visible entries
- control dired-hflag with 'H': human readable sizes
- control dired-nflag with 'N': alpha/numeric/hidden uid/gid columns
- use variable setter function for dired-sort-mode and dired-time-format
2015-08-30 15:30:58 +00:00
Charlie Gordon
72f67310fa variables: add value setting handler support
- Allow handler to return error codes VAR_INVALID or VAR_READONLY
- Display explicit error messages
- Add variables.h to generic dependency list in Makefile
2015-08-30 12:03:46 +00:00
Charlie Gordon
81bca980fe cosmetics: untabify, remove trailing spaces 2015-08-30 11:27:12 +00:00
Charlie Gordon
f0aa3a4bd8 cosmetics: untabify, remove trailing spaces 2015-08-27 23:03:39 +00:00
Charlie Gordon
581eef3b5d buffers: fix improbable bugs
- make kill buffers system buffers (not displayed in buffer-list)
- only create *scratch* buffer in qe_kill_buffer() if needed
- prevent crash if killing style, log or kill buffers
- display \n as ^J in minibuf
2015-08-27 22:51:56 +00:00
Charlie Gordon
060f860756 fix more linux compilation warnings 2015-08-27 18:59:56 +00:00
Charlie Gordon
9ab179d048 fix linux compile warnings 2015-08-27 18:52:30 +00:00
Charlie Gordon
9331372a54 modes: upgrade mode selection and handling
- separate buffer and window specific mode data management, new API:
   QEModeData *qe_create_buffer_mode_data(EditBuffer *b, ModeDef *m);
   void *qe_get_buffer_mode_data(EditBuffer *b, ModeDef *m, EditState *e);
   QEModeData *qe_create_window_mode_data(EditState *s, ModeDef *m);
   void *qe_get_window_mode_data(EditState *e, ModeDef *m, int status);
   int qe_free_mode_data(QEModeData *md);
- make a list of buffer specific mode data areas so multiple major modes
  can co-exist in different windows for the same buffer
- add mode.mode_free callback to release buffer specific resources
- remove buffer.close callback
- shell state is now buffer specific shell_mode data
- clean up compress and archive mode
- show more buffer modes in buffer-list
- simplify edit_set_mode(), display error message on failure
2015-08-27 15:31:59 +00:00
Charlie Gordon
f37a58b4a6 search: remember last search flags
- C-s and C-r in incremental search also restores flags from last search
- do_search_string() accepts empty string
2015-08-26 23:13:36 +00:00
Charlie Gordon
03db9d420a modes: simplified mode setting and saving
- get rid of ModeSavedData structures
- save window data upon buffer change and mode setting
- make generic_mode_close() and generic_mode_init() local
- simplify edit_set_mode() and switch_to_buffer()
- reset w.insert, w.hex_mode, w.hex_nibble, w.unihex_mode, w.wrap
  to mode specific default values upon mode change.
- split do_set_next_mode() command into qe_set_next_mode() lower level
  function with an extra status parameter report new mode.
2015-08-26 22:51:24 +00:00
Charlie Gordon
0dd8c31b9e bufed: improve dired display
- use static colors and styles
2015-08-26 01:12:21 +00:00
Charlie Gordon
5396a1850b bufed: improve buffer-list display
- use colors and styles
- abbreviate buffer name if too long
- store buffer pointers as opaque data
2015-08-26 01:07:29 +00:00
Charlie Gordon
f408a15503 buffers: misc improvements
- renamed kill_buffer_noconfirm(b) to qe_kill_buffer(b)
- pass extra argument to do_kill_buffer(b, force)
- add buffer name cache to quicken eb_find()
- always make buffer names unique with simpler naming scheme
- small improvement in new_yank_buffer()
2015-08-26 00:53:23 +00:00
Charlie Gordon
bc874d74b7 buffers: improved tracing function
- add EB_TRACE_COMMAND
- change the format of the *trace* buffer
2015-08-26 00:24:14 +00:00
Charlie Gordon
9014b3de79 buffers: clean up, add data_type_name
- rename raw_buffer_load1() to eb_raw_buffer_load1()
- rename log_reset() to eb_free_log_buffer()
- add buffer.data_type_name to display proper handler on modeline
2015-08-25 16:19:42 +00:00
Charlie Gordon
7b996ac907 buffers: changed find_page() low-level routine
- pass offset separately from page_offset return value.
  This will ease the change of int type to support huge files in 64 bits.
- use the page cache also for offsets beyond the page cache.
2015-08-24 12:59:25 +00:00
Charlie Gordon
315147c81f buffers: fixed crash bug and pathological memory fragmentation
- simplify eb_insert_low_level() and eb_insert_buffer() to avoid
  pathological cases of kill/yank sequences loading to catastrophic
  fragmentation. eg: kill a 1 byte region and yank it 1000 times
- mmapped pages are (temporarily) no longer shared between buffers
2015-08-22 20:49:01 +00:00
Charlie Gordon
c506fbc39f buffers: added extra information on page layout in describe-buffer 2015-08-22 20:37:49 +00:00
Charlie Gordon
dff0947665 search: show search matches, fix bugs
- fix bug with word-match incremental search
- pass max offset to eb_search
- simplify search code, keep separate u32 and flag arrays
- add ISearchState* to EditWindow to display current or last matches
- add style for search matches
2015-08-19 20:33:01 +00:00
Charlie Gordon
91284c13a6 modes: fix bug in probe_mode, buffer was not NUL terminated 2015-08-19 19:54:29 +00:00
Charlie Gordon
bccfbef8a0 window handling, bufed/dired: fixed bugs, simplified code
- make show_popup(b) return the window
- pass an extra window argument to find_window() as a default return value
- add check_buffer(EditBuffer **sp) to validate a buffer pointer
- changed eb_find_window(): find a different window attached to a given buffer
- removed edit_find(), use eb_find_window() instead
- change edit_attach():
  take window before which to move arg window, use NULL to append at the end.
  If qs->active_window is NULL, set it to the first window
- add buffer flags BF_IS_LOG and BF_IS_STYLE
- create style buffers with a meaningful name
- create log buffers with a meaningful name
- add window flag WF_POPLEFT for dired interactive buffers
- no longer create process buffer and find files in dired pop left pane
- remember last buffer upon switch_to_buffer for predict_switch_to_buffer()
- rename do_file1() as extern qe_load_file() and make it return success status
- prevent do_find_file_other_window() from splitting window if too shallow
- fix window fusion algorithm when deleting left pane with split right pane
- prevent delete-other-windows() from minibuf and poups
- use mode structure as signature for bufed-mode, shell-mode
- make list-buffers open an interactive popup window
- toggle full buffer list with '.'
2015-08-19 19:20:57 +00:00
Charlie Gordon
e2fa870ad9 dired: fixed bugs, simplified code
- use mode structure as signature
- pass DiredState to internal functions
- no longer refuse to descend into symlink directories
- improve navigation when focus goes to a dired buffer in preview mode
- no longer make dired buffers system buffers to fix bufed behaviour
- make dired-time-format a global variable
2015-08-19 16:49:04 +00:00
Charlie Gordon
490a858c22 general: sanity checks
- make QECharset const by default, use struct QECharset for mutable references.
- use OWNED attribute to flag unique pointers to allocated memory.
- add typedefs for InputMethod, ISearchState
- use typedef for ModeDef
2015-08-19 16:22:30 +00:00
Charlie Gordon
7ef8195b34 Makefile: added missing search.c source file 2015-08-19 14:30:11 +00:00
Charlie Gordon
3f605392ec htmlsrc: parse hex html entities 2015-08-19 14:27:40 +00:00
Charlie Gordon
8fc273ccc6 libqhtml: parse hex html entities 2015-08-19 14:26:34 +00:00
Charlie Gordon
bac5773927 tty: rearrange code 2015-08-17 18:13:50 +00:00
Charlie Gordon
b8fb3f310e search: split search code from qe.c into new module search.c 2015-08-17 16:56:48 +00:00
Charlie Gordon
1033a348d8 search: another 35% speed improvement on large files
- improve utf8 handling in eb_prevc() using eb_read_one_byte()
- added utf8_is_trailing_byte(b) to standardize testing for this
- improve hex searching by 50% using eb_read_one_byte()
- improve regular searching by 35% by removing extra calls to eb_nextc()
2015-08-16 23:15:01 +00:00
Charlie Gordon
e80cb5a149 search: another 2.5x speed improvement on large files
- simplify eb_read() and eb_write() primitives
- make eb_write() return number of bytes actually written
- add eb_read_byte(buffer, offset) to read a single byte
- simplify eb_nextc() accordingly
2015-08-16 19:22:01 +00:00
Charlie Gordon
4dd09ba89d search: 10x speed improvement on large files
- do_center_window used to be very inefficient when invoked with point
  at a great distance from the current window.  This was slowing down
  successful searches on large files by a factor of 10 or more.
2015-08-16 18:01:06 +00:00
Charlie Gordon
456051b1a2 search: some fixes
- fix case matching cycling with C-c and A-c in incremental search
- use smartcase for search-forward and search-backward
- display status for search-forward and search-backward failures
- eb_search returns -1 upon abort
- make eb_search and search_abort_func private;
2015-08-16 17:52:13 +00:00