aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* another docstring fixletTom Tromey2012-08-191-1/+2
|
* minor docstring fixupTom Tromey2012-08-191-4/+4
|
* add condition-mutex and condition-nameTom Tromey2012-08-191-0/+27
|
* ensure name of a thread is a stringTom Tromey2012-08-191-0/+3
|
* ensure name of a mutex is a stringTom Tromey2012-08-191-0/+3
|
* use NILPTom Tromey2012-08-191-3/+3
|
* condition variablesTom Tromey2012-08-196-20/+255
| | | | | This implements condition variables for elisp. This needs more tests.
* comment fixesTom Tromey2012-08-181-1/+7
|
* refactor systhread.hTom Tromey2012-08-184-128/+121
| | | | | | This refactors systhread.h to move the notion of a "lisp mutex" into thread.c. This lets us make make the global lock and post_acquire_global_lock static.
* write docstrings for the thread functionsTom Tromey2012-08-171-26/+54
|
* declare unbind_for_thread_switch and rebind_for_thread_switch in lisp.hTom Tromey2012-08-172-4/+2
|
* process changesTom Tromey2012-08-154-28/+221
| | | | | | | | | | | | | | | This changes wait_reading_process_output to handle threads better. It introduces a wrapper for select that releases the global lock, and it ensures that only a single thread can select a given file descriptor at a time. This also adds the thread-locking feature to processes. By default a process can only have its output accepted by the thread that created it. This can be changed using set-process-thread. (If the thread exits, the process is again available for waiting by any thread.) Note that thread-signal will not currently interrupt a thread blocked on select. I'll fix this later.
* Prepare process.c for threads by not having global select masks.Tom Tromey2012-08-151-130/+165
| | | | The next step is to make it so selects can choose fds by thread.
* fix a latent bug in process.cTom Tromey2012-08-151-1/+1
| | | | | * process.c (wait_reading_process_output): Check Writeok bits, not write_mask.
* This adds thread-blocker, a function to examine what a thread isTom Tromey2012-08-152-1/+34
| | | | blocked on. I thought this would be another nice debugging addition.
* This adds names to mutexes. This seemed like a nice debuggingTom Tromey2012-08-153-13/+31
| | | | extension.
* This supplies the mutex implementation for Emacs Lisp.Tom Tromey2012-08-156-3/+117
| | | | | | | A lisp mutex is implemented using a condition variable, so that we can interrupt a mutex-lock operation by calling thread-signal on the blocking thread. I did things this way because pthread_mutex_lock can't readily be interrupted.
* This adds most of the thread features visible to emacs lisp.Tom Tromey2012-08-157-19/+400
| | | | | | | | | | | | | | | | | | I roughly followed the Bordeaux threads API: http://trac.common-lisp.net/bordeaux-threads/wiki/ApiDocumentation ... but not identically. In particular I chose not to implement interrupt-thread or destroy-thread, but instead a thread-signalling approach. I'm still undecided about *default-special-bindings* (which I did not implement). I think it would be more emacs-like to capture the let bindings at make-thread time, but IIRC Stefan didn't like this idea the first time around. There are one or two semantics issues pointed out in the patch where I could use some advice.
* This turns thread_state into a pseudovector and updates various bitsTom Tromey2012-08-155-3/+38
| | | | of Emacs to cope.
* This introduces some new functions to handle the specpdl. The basicTom Tromey2012-08-154-42/+134
| | | | | | | | | | | | | | idea is that when a thread loses the interpreter lock, it will unbind the bindings it has put in place. Then when a thread acquires the lock, it will restore its bindings. This code reuses an existing empty slot in struct specbinding to store the current value when the thread is "swapped out". This approach performs worse than my previously planned approach. However, it was one I could implement with minimal time and brainpower. I hope that perhaps someone else could improve the code once it is in.
* This introduces the low-level system threading support. It also addsTom Tromey2012-08-157-1/+286
| | | | | | | | | | | | | | | | | | | the global lock. The low-level support is a bit over-eager, in that even at the end of the present series, it will not all be used. I think thiat is ok since I plan to use it all eventually -- in particular for the emacs lisp mutex implementation. I've only implemented the pthreads-based version. I think it should be relatively clear how to port this to other systems, though. I'd also like to do a "no threads" port that will turn most things into no-ops, and have thread-creation fail. I was thinking perhaps I'd make a future (provide 'threads) conditional on threads actually working. One other minor enhancement available here is to make it possible to set the name of the new thread at the OS layer. That way gdb, e.g., could display thread names.
* This parameterizes the GC a bit to make it thread-ready.Tom Tromey2012-08-156-64/+140
| | | | | | | | | | | | | The basic idea is that whenever a thread "exits lisp" -- that is, releases the global lock in favor of another thread -- it must save its stack boundaries in the thread object. This way the boundaries are always available for marking. This is the purpose of flush_stack_call_func. I haven't tested this under all the possible GC configurations. There is a new FIXME in a spot that i didn't convert. Arguably all_threads should go in the previous patch.
* This introduces a thread-state object and moves various C globalsTom Tromey2012-08-1514-101/+223
| | | | | | | | | | | there. It also introduces #defines for these globals to avoid a monster patch. The #defines mean that this patch also has to rename a few fields whose names clash with the defines. There is currently just a single "thread"; so this patch does not impact Emacs behavior in any significant way.
* Fix bug #12196 with incorrect memory allocations for region-cache.Eli Zaretskii2012-08-152-3/+9
| | | | | src/region-cache.c (move_cache_gap): Update gap_len using the actual growth of the boundaries array. Do not change cache_len.
* Generalize and cleanup font subsystem checks.Dmitry Antipov2012-08-157-45/+36
| | | | | | * font.h (FONT_DEBUG, font_assert): Remove. * font.c, fontset.c, w32font.c, xfont.c, xftfont.c: Change font_assert to eassert. Use eassert where appropriate.
* Fix last change to xg_get_font.Dmitry Antipov2012-08-152-3/+7
| | | | * gtkutil.c (xg_get_font): Use pango_units_to_double.
* Extract better font information from the GTK >= 3.2 font chooser.Chong Yidong2012-08-155-51/+130
| | | | | | | | | | | | | | | * gtkutil.c (xg_get_font): Rename from xg_get_font_name. When using the new font chooser, use gtk_font_chooser_get_font_desc to extract the font descriptor instead of just the font name. In that case, return a font spec instead of a string. (x_last_font_name): Move to this file from xfns.c. * xfns.c (Fx_select_font): The return value can also be a font spec. Move x_last_font_name management to gtkutil.c. * xfaces.c: Make font weight and style symbols non-static. * lisp/frame.el (set-frame-font): Accept font objects.
* * src/minibuf.c (read_minibuf): Ignore caller's inhibit-read-only.Stefan Monnier2012-08-152-0/+6
| | | | Fixes: debbugs:12117
* * src/alloc.c (Fgarbage_collect): Use plural form consistently.Stefan Monnier2012-08-142-39/+62
|
* Fix compiler warning in keyboard.c.Eli Zaretskii2012-08-141-0/+2
|
* Fix last change in keyboard.c.Eli Zaretskii2012-08-141-0/+3
|
* Fix a problem with disabled mouse movement events.Eli Zaretskii2012-08-142-0/+12
| | | | | | src/keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each iteration through the command loop. Fixes a problem whereby mouse movements are ignored until the first mouse click.
* Use bool for Emacs Lisp booleans.Paul Eggert2012-08-144-5/+16
| | | | | | | | | | | | | | | | | This is more natural, and on my platform (GCC 4.7.1 x86-64) it makes Emacs's text size .03% smaller and presumably a bit faster. * admin/merge-gnulib (GNULIB_MODULES): Add stdbool. This documents a new direct dependency; stdbool was already being used indirectly via other gnulib modules. * lib-src/make-docfile.c (enum global_type): Sort values roughly in decreasing alignment, except put functions last. (compare_globals): Use this new property of enum global_type. (write_globals): Use bool, not int, for booleans. * src/lisp.h: Include <stdbool.h>. (struct Lisp_Boolfwd, defvar_bool): * src/lread.c (defvar_bool): Use bool, not int, for Lisp booleans. * src/regex.c [!emacs]: Include <stdbool.h>. (false, true): Remove; <stdbool.h> does this for us now.
* More doc fixes.Chong Yidong2012-08-154-6/+16
| | | | | | | | | | | | * lisp/minibuffer.el (read-file-name): Doc fix. * character.c (Fcharacterp): Doc fix (Bug#12076). * data.c (Findirect_variable): Doc fix (Bug#11040). * editfns.c (Fsave_current_buffer): Doc fix (Bug#11542). Fixes: debbugs:11542 debbugs:11040 debbugs:12076 debbugs:10881
* Doc fixes.Chong Yidong2012-08-153-7/+17
| | | | | | | | | | * lisp/emacs-lisp/regexp-opt.el (regexp-opt-charset): Doc fix. * src/chartab.c (Fmap_char_table): Doc fix. * src/editfns.c (Fformat): Doc fix. Fixes: debbugs:12059 debbugs:12085 debbugs:12061
* * src/keyboard.c (access_keymap_keyremap): Accept anonymous functions.Barry O'Reilly2012-08-143-2/+7
| | | | Fixes: debbugs:12022
* Don't call Fset_window_buffer from C code.Martin Rudalics2012-08-145-20/+49
| | | | | | | | | * frame.c (make_frame_without_minibuffer, make_minibuffer_frame) (delete_frame, Fmake_frame_invisible, Ficonify_frame): * minibuf.c (choose_minibuf_frame, read_minibuf): * w32fns.c (x_create_tip_frame): * xfns.c (x_create_tip_frame): Call set_window_buffer instead of Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
* * intervals.c (offset_intervals): Remove obsolete comment.Paul Eggert2012-08-142-6/+6
|
* * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.Andreas Schwab2012-08-142-3/+7
|
* Fix for undo recording in decode_coding.Gergely Risko2012-08-142-0/+14
| | | | | | | * coding.c (decode_coding): Record buffer modification before disabling undo_list. Fixes: debbugs:11773
* Revert and cleanup some recent overlay changes.Dmitry Antipov2012-08-148-122/+99
| | | | | | | | * buffer.h (enum overlay_type): Remove. (buffer_get_overlays, buffer_set_overlays): Likewise. (buffer_set_overlays_before, buffer_set_overlays_after): New function. Adjust users. (unchain_both): Add eassert.
* * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.Dmitry Antipov2012-08-142-2/+6
|
* * gtkutil.c (xg_mark_data): Don't assume C99.Paul Eggert2012-08-132-1/+5
|
* Don't redraw tool bar for Gtk+ unless out of date.Jan Djärv2012-08-132-0/+96
| | | | | | | | | | | | * gtkutil.c (xg_frame_tb_info): New struct. (TB_INFO_KEY): New define. (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present. (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info. (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info if not present. (update_frame_tool_bar): Return early if data in xg_frame_tb_info is up to date. Otherwise store new data. (free_frame_tool_bar): Free xg_frame_tb_info if present.
* Use KSET for write access to Lisp_Object members of struct kboard.Dmitry Antipov2012-08-1315-90/+98
| | | | | | | * keyboard.h (KSET): New macro. * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c: * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c: * xterm.c: Adjust users.
* Use BSET for write access to Lisp_Object members of struct buffer.Dmitry Antipov2012-08-1323-233/+249
| | | | | | | | * buffer.h (BSET): New macro. * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c: * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c: * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c: * window.c, xdisp.c, xfns.c: Adjust users.
* * src/lread.c (syms_of_lread): Initialize Vlexical_binding.BT Templeton2012-08-112-41/+45
|
* * nsterm.m (not_in_argv): New function.Jan Djärv2012-08-112-14/+25
| | | | | | | | (application:openFile, application:openTempFile:): (application:openFileWithoutUI:, application:openFiles:): Open file if not_in_argv returns non-zero. Fixes: debbugs:12171
* Use GtkFontChooser on Gtk+ 3.2 and up.Jan Djärv2012-08-112-5/+25
| | | | | | | | * src/gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER) (gtk_font_chooser_set_font, gtk_font_chooser_get_font): Define for Gtk+ versions less than 3.2. (xg_get_font_name): Use those functions/macros here. Reported by Frans Oilinki <moilinki@gmail.com>.
* ChangeLog date fixesGlenn Morris2012-08-101-3/+1
|